Skip to content

Commit

Permalink
refactor(EditComponentAnnotations): Convert to standalone (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Nov 20, 2024
1 parent bf79ba0 commit c303da8
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 202 deletions.
11 changes: 1 addition & 10 deletions src/app/teacher/grading-common.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { NgModule } from '@angular/core';
import { IntersectionObserverModule } from '@ng-web-apis/intersection-observer';
import { EditComponentAnnotationsComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/edit-component-annotations/edit-component-annotations.component';
import { EditComponentCommentComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/edit-component-comment/edit-component-comment.component';
import { EditComponentScoreComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/edit-component-score/edit-component-score.component';
import { GradingEditComponentMaxScoreComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/grading-edit-component-max-score/grading-edit-component-max-score.component';
import { WorkgroupItemComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroup-item/workgroup-item.component';
import { WorkgroupInfoComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroupInfo/workgroup-info.component';
import { WorkgroupNodeScoreComponent } from '../../assets/wise5/classroomMonitor/classroomMonitorComponents/shared/workgroupNodeScore/workgroup-node-score.component';
Expand All @@ -18,9 +15,7 @@ import { NavItemProgressComponent } from '../classroom-monitor/nav-item-progress
@NgModule({
imports: [
ComponentGradingModule,
EditComponentScoreComponent,
EditComponentCommentComponent,
GradingEditComponentMaxScoreComponent,
EditComponentAnnotationsComponent,
IntersectionObserverModule,
NavItemProgressComponent,
StatusIconComponent,
Expand All @@ -30,17 +25,13 @@ import { NavItemProgressComponent } from '../classroom-monitor/nav-item-progress
WorkgroupNodeStatusComponent
],
declarations: [
EditComponentAnnotationsComponent,
WorkgroupComponentGradingComponent,
WorkgroupItemComponent,
WorkgroupSelectAutocompleteComponent
],
exports: [
ComponentGradingModule,
EditComponentAnnotationsComponent,
EditComponentCommentComponent,
EditComponentScoreComponent,
GradingEditComponentMaxScoreComponent,
IntersectionObserverModule,
NavItemProgressComponent,
StatusIconComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,74 +1,108 @@
<div *ngIf="!showAllAnnotations" class="annotations--grading">
<div
class="annotations--grading__score annotations--grading__item"
fxLayout="row"
fxLayoutAlign="start center"
>
<edit-component-score
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="isDisabled || !canGradeStudentWork"
[fromWorkgroupId]="fromWorkgroupId"
[latestAnnotationScore]="latestAnnotations.score"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
<span> / </span>
<grading-edit-component-max-score
[componentId]="componentId"
[disabled]="isDisabled || !canAuthorProject"
[nodeId]="nodeId"
/>
</div>
<div *ngIf="edit || !showAutoComment()" class="annotations--grading__item">
<edit-component-comment
[comment]="comment"
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="isDisabled || !canGradeStudentWork"
[fromWorkgroupId]="fromWorkgroupId"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
></edit-component-comment>
</div>
<div
*ngIf="showAutoComment()"
class="annotations--grading__item annotations--grading__auto-comment"
>
<div class="heavy" fxLayout="row" fxLayoutGap="4px">
<span class="md-no-float" i18n>Auto Comment</span>
<span *ngIf="!isDisabled">(<a (click)="toggleEditComment()" i18n>Edit</a>)</span>:
</div>
<div class="annotations--grading__auto-comment__content">
<span [innerHTML]="latestAnnotations.comment.data.value"></span>
</div>
</div>
</div>

<div *ngIf="showAllAnnotations">
<div
*ngIf="hasNoAnnotations()"
class="annotations--grading annotations--grading__item text-secondary"
i18n
>
No feedback given for this version
@if (showAllAnnotations) {
<div>
@if (hasNoAnnotations()) {
<div class="annotations--grading annotations--grading__item text-secondary" i18n>
No feedback given for this version
</div>
}
@if (hasTeacherAnnotations()) {
<div class="annotations--grading">
@if (latestAnnotations.score) {
<div
class="annotations--grading__item annotations--grading__score"
fxLayout="row"
fxLayoutAlign="start center"
>
<edit-component-score
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[fromWorkgroupId]="fromWorkgroupId"
[latestAnnotationScore]="latestAnnotations.score"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
<span> / </span>
<grading-edit-component-max-score
[componentId]="componentId"
[disabled]="true"
[nodeId]="nodeId"
/>
</div>
}
@if (latestAnnotations.comment) {
<div class="annotations--grading__item">
<edit-component-comment
[comment]="latestAnnotations.comment.data.value"
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[fromWorkgroupId]="fromWorkgroupId"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
</div>
}
</div>
}
@if (hasTeacherAndAutoAnnotations()) {
<div class="component--grading__annotations__divider"></div>
}
@if (hasAutoAnnotations()) {
<div class="annotations--grading">
@if (latestAnnotations.autoScore) {
<div
class="annotations--grading__item annotations--grading__score"
fxLayout="row"
fxLayoutAlign="start center"
>
<edit-component-score
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[fromWorkgroupId]="fromWorkgroupId"
[latestAnnotationScore]="latestAnnotations.autoScore"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
<span> / </span>
<grading-edit-component-max-score
[nodeId]="nodeId"
[componentId]="componentId"
[disabled]="true"
/>
</div>
}
@if (latestAnnotations.autoComment) {
<div class="annotations--grading__item annotations--grading__auto-comment">
<div class="heavy" fxLayout="row" fxLayoutGap="4px">
<span class="md-no-float" i18n>Auto Comment</span>:
</div>
<div class="annotations--grading__auto-comment__content disabled-text">
<span [innerHTML]="latestAnnotations.autoComment.data.value"></span>
</div>
</div>
}
</div>
}
</div>

<div *ngIf="hasTeacherAnnotations()" class="annotations--grading">
} @else {
<div class="annotations--grading">
<div
*ngIf="latestAnnotations.score"
class="annotations--grading__item annotations--grading__score"
class="annotations--grading__score annotations--grading__item"
fxLayout="row"
fxLayoutAlign="start center"
>
<edit-component-score
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[disabled]="isDisabled || !canGradeStudentWork"
[fromWorkgroupId]="fromWorkgroupId"
[latestAnnotationScore]="latestAnnotations.score"
[nodeId]="nodeId"
Expand All @@ -79,65 +113,37 @@
<span> / </span>
<grading-edit-component-max-score
[componentId]="componentId"
[disabled]="true"
[disabled]="isDisabled || !canAuthorProject"
[nodeId]="nodeId"
/>
</div>
<div *ngIf="latestAnnotations.comment" class="annotations--grading__item">
<edit-component-comment
[comment]="latestAnnotations.comment.data.value"
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[fromWorkgroupId]="fromWorkgroupId"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
></edit-component-comment>
</div>
</div>

<div
class="component--grading__annotations__divider"
*ngIf="hasTeacherAndAutoAnnotations()"
></div>

<div *ngIf="hasAutoAnnotations()" class="annotations--grading">
<div
*ngIf="latestAnnotations.autoScore"
class="annotations--grading__item annotations--grading__score"
fxLayout="row"
fxLayoutAlign="start center"
>
<edit-component-score
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="true"
[fromWorkgroupId]="fromWorkgroupId"
[latestAnnotationScore]="latestAnnotations.autoScore"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
<span> / </span>
<grading-edit-component-max-score
[nodeId]="nodeId"
[componentId]="componentId"
[disabled]="true"
/>
</div>
<div
class="annotations--grading__item annotations--grading__auto-comment"
*ngIf="latestAnnotations.autoComment"
>
<div class="heavy" fxLayout="row" fxLayoutGap="4px">
<span class="md-no-float" i18n>Auto Comment</span>:
@if (edit || !showAutoComment()) {
<div class="annotations--grading__item">
<edit-component-comment
[comment]="comment"
[componentId]="componentId"
[componentStateId]="componentStateId"
[disabled]="isDisabled || !canGradeStudentWork"
[fromWorkgroupId]="fromWorkgroupId"
[nodeId]="nodeId"
[periodId]="periodId"
[runId]="runId"
[toWorkgroupId]="toWorkgroupId"
/>
</div>
<div class="annotations--grading__auto-comment__content disabled-text">
<span [innerHTML]="latestAnnotations.autoComment.data.value"></span>
}
@if (showAutoComment()) {
<div class="annotations--grading__item annotations--grading__auto-comment">
<div class="heavy" fxLayout="row" fxLayoutGap="4px">
<span class="md-no-float" i18n>Auto Comment</span>
@if (!isDisabled) {
<span>(<a (click)="toggleEditComment()" i18n>Edit</a>)</span>:
}
</div>
<div class="annotations--grading__auto-comment__content">
<span [innerHTML]="latestAnnotations.comment.data.value"></span>
</div>
</div>
</div>
}
</div>
</div>
}
Loading

0 comments on commit c303da8

Please sign in to comment.