diff --git a/src/app/teacher/component-show-work.module.ts b/src/app/teacher/component-show-work.module.ts index b33893a04d0..73e80fc8752 100644 --- a/src/app/teacher/component-show-work.module.ts +++ b/src/app/teacher/component-show-work.module.ts @@ -7,11 +7,11 @@ import { DrawShowWorkModule } from '../../assets/wise5/components/draw/draw-show import { EmbeddedShowWorkModule } from '../../assets/wise5/components/embedded/embedded-show-work/embedded-show-work.module'; import { GraphShowWorkModule } from '../../assets/wise5/components/graph/graph-show-work/graph-show-work.module'; import { LabelShowWorkModule } from '../../assets/wise5/components/label/label-show-work/label-show-work.module'; -import { MatchShowWorkModule } from '../../assets/wise5/components/match/match-show-work/match-show-work-module'; import { OpenResponseShowWorkModule } from '../../assets/wise5/components/openResponse/open-response-show-work/open-response-show-work.module'; import { TableShowWorkModule } from '../../assets/wise5/components/table/table-show-work/table-show-work.module'; import { MultipleChoiceShowWorkComponent } from '../../assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component'; import { DialogGuidanceShowWorkComponent } from '../../assets/wise5/components/dialogGuidance/dialog-guidance-show-work/dialog-guidance-show-work.component'; +import { MatchShowWorkComponent } from '../../assets/wise5/components/match/match-show-work/match-show-work.component'; @NgModule({ imports: [ @@ -24,7 +24,7 @@ import { DialogGuidanceShowWorkComponent } from '../../assets/wise5/components/d EmbeddedShowWorkModule, GraphShowWorkModule, LabelShowWorkModule, - MatchShowWorkModule, + MatchShowWorkComponent, MultipleChoiceShowWorkComponent, OpenResponseShowWorkModule, TableShowWorkModule @@ -39,7 +39,7 @@ import { DialogGuidanceShowWorkComponent } from '../../assets/wise5/components/d EmbeddedShowWorkModule, GraphShowWorkModule, LabelShowWorkModule, - MatchShowWorkModule, + MatchShowWorkComponent, MultipleChoiceShowWorkComponent, OpenResponseShowWorkModule, TableShowWorkModule diff --git a/src/assets/wise5/components/match/match-grading/match-grading.component.html b/src/assets/wise5/components/match/match-grading/match-grading.component.html index fe14bff1eab..a14521ba134 100644 --- a/src/assets/wise5/components/match/match-grading/match-grading.component.html +++ b/src/assets/wise5/components/match/match-grading/match-grading.component.html @@ -3,5 +3,4 @@ [componentId]="componentId" [componentState]="componentState" [isRevision]="isRevision" -> - +/> diff --git a/src/assets/wise5/components/match/match-grading/match-grading.module.ts b/src/assets/wise5/components/match/match-grading/match-grading.module.ts index 6191534c776..5482b183625 100644 --- a/src/assets/wise5/components/match/match-grading/match-grading.module.ts +++ b/src/assets/wise5/components/match/match-grading/match-grading.module.ts @@ -1,10 +1,10 @@ import { NgModule } from '@angular/core'; -import { MatchShowWorkModule } from '../match-show-work/match-show-work-module'; import { MatchGradingComponent } from './match-grading.component'; +import { MatchShowWorkComponent } from '../match-show-work/match-show-work.component'; @NgModule({ declarations: [MatchGradingComponent], - imports: [MatchShowWorkModule], + imports: [MatchShowWorkComponent], exports: [MatchGradingComponent] }) export class MatchGradingModule {} diff --git a/src/assets/wise5/components/match/match-show-work/match-show-work-module.ts b/src/assets/wise5/components/match/match-show-work/match-show-work-module.ts deleted file mode 100644 index 0197752c868..00000000000 --- a/src/assets/wise5/components/match/match-show-work/match-show-work-module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { MatchCommonModule } from '../match-common.module'; -import { MatchShowWorkComponent } from './match-show-work.component'; - -@NgModule({ - declarations: [MatchShowWorkComponent], - imports: [MatchCommonModule], - exports: [MatchShowWorkComponent] -}) -export class MatchShowWorkModule {} diff --git a/src/assets/wise5/components/match/match-show-work/match-show-work.component.html b/src/assets/wise5/components/match/match-show-work/match-show-work.component.html index 0076471a3fa..e0c6a7ead2d 100644 --- a/src/assets/wise5/components/match/match-show-work/match-show-work.component.html +++ b/src/assets/wise5/components/match/match-show-work/match-show-work.component.html @@ -2,13 +2,13 @@

-
    -
  • - -
  • +
      + @for (item of sourceBucket.items; track item.id) { +
    • + +
    • + }
-
-
-
-

-
-
    -
  • +
    +
    - -
  • -
+

+
+
    + @for (item of bucket.items; track item.id) { +
  • + +
  • + } +
+
-
+ } diff --git a/src/assets/wise5/components/match/match-show-work/match-show-work.component.ts b/src/assets/wise5/components/match/match-show-work/match-show-work.component.ts index 9f4d2420651..1226a4218dd 100644 --- a/src/assets/wise5/components/match/match-show-work/match-show-work.component.ts +++ b/src/assets/wise5/components/match/match-show-work/match-show-work.component.ts @@ -3,26 +3,31 @@ import { NodeService } from '../../../services/nodeService'; import { ProjectService } from '../../../services/projectService'; import { ComponentShowWorkDirective } from '../../component-show-work.directive'; import { MatchService } from '../matchService'; +import { MatchFeedbackSectionComponent } from '../match-student/match-feedback-section/match-feedback-section.component'; +import { CommonModule } from '@angular/common'; +import { MatchChoiceItemComponent } from '../match-choice-item/match-choice-item.component'; +import { FlexLayoutModule } from '@angular/flex-layout'; @Component({ + imports: [ + CommonModule, + FlexLayoutModule, + MatchChoiceItemComponent, + MatchFeedbackSectionComponent + ], selector: 'match-show-work', - templateUrl: 'match-show-work.component.html', + standalone: true, styleUrls: [ '../match-student/match-student-default/match-student-default.component.scss', 'match-show-work.component.scss' - ] + ], + templateUrl: 'match-show-work.component.html' }) export class MatchShowWorkComponent extends ComponentShowWorkDirective { - sourceBucketId = '0'; - sourceBucket: any; - targetBuckets: any[] = []; - isHorizontal: boolean; - isChoicesAfter: boolean; - bucketWidth: number; - hasCorrectAnswer: boolean; - isCorrect: boolean; - submitCounter: number; - isLatestComponentStateSubmit: boolean; + protected hasCorrectAnswer: boolean; + protected sourceBucket: any; + private sourceBucketId = '0'; + protected targetBuckets: any[] = []; constructor( protected matchService: MatchService, @@ -32,31 +37,24 @@ export class MatchShowWorkComponent extends ComponentShowWorkDirective { super(nodeService, projectService); } - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.hasCorrectAnswer = this.matchService.componentHasCorrectAnswer(this.componentContent); - this.isCorrect = this.componentState.studentData.isCorrect; - this.isChoicesAfter = this.componentContent.choicesAfter; - this.isHorizontal = this.componentContent.horizontal; - this.submitCounter = this.componentState.studentData.submitCounter; - this.isLatestComponentStateSubmit = this.componentState.isSubmit; this.initializeBuckets(this.componentState.studentData.buckets); } - initializeBuckets(buckets: any[]): void { - for (const bucket of buckets) { + private initializeBuckets(buckets: any[]): void { + buckets.forEach((bucket) => { this.setItemStatuses(bucket.items); if (bucket.id === this.sourceBucketId) { this.sourceBucket = bucket; } else { this.targetBuckets.push(bucket); } - } + }); } - setItemStatuses(items: any[]): void { - for (const item of items) { - this.matchService.setItemStatus(item, this.hasCorrectAnswer); - } + private setItemStatuses(items: any[]): void { + items.forEach((item) => this.matchService.setItemStatus(item, this.hasCorrectAnswer)); } } diff --git a/src/assets/wise5/components/showWork/show-work-student/show-work-student.component.html b/src/assets/wise5/components/showWork/show-work-student/show-work-student.component.html index 7465569d17e..248ead6363b 100644 --- a/src/assets/wise5/components/showWork/show-work-student/show-work-student.component.html +++ b/src/assets/wise5/components/showWork/show-work-student/show-work-student.component.html @@ -69,7 +69,7 @@ [nodeId]="nodeId" [componentId]="componentId" [componentState]="studentWork" - > + />