Skip to content

Commit fca14e4

Browse files
authored
Merge pull request #2942 from WISE-Community/issue-2940-extract-match-grading
Extract grading view from Match component
2 parents fb85352 + ce4abf8 commit fca14e4

11 files changed

Lines changed: 492 additions & 420 deletions

File tree

src/main/webapp/site/src/app/common-hybrid-angular.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import { WiseTinymceEditorComponent } from '../../../wise5/directives/wise-tinym
5757
import { MatAutocompleteModule } from '@angular/material/autocomplete';
5858
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
5959
import { MatRadioModule } from '@angular/material/radio';
60+
import { MatDividerModule } from '@angular/material/divider';
6061

6162
@Component({ template: `` })
6263
export class EmptyComponent {}
@@ -80,6 +81,7 @@ export class EmptyComponent {}
8081
MatCardModule,
8182
MatCheckboxModule,
8283
MatDialogModule,
84+
MatDividerModule,
8385
MatFormFieldModule,
8486
MatIconModule,
8587
MatInputModule,
@@ -138,6 +140,7 @@ export class EmptyComponent {}
138140
MatCardModule,
139141
MatCheckboxModule,
140142
MatDialogModule,
143+
MatDividerModule,
141144
MatFormFieldModule,
142145
MatIconModule,
143146
MatInputModule,

src/main/webapp/site/src/app/teacher-hybrid-angular.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { AudioOscillatorAuthoring } from '../../../wise5/components/audioOscilla
6161
import { AnimationAuthoring } from '../../../wise5/components/animation/animation-authoring/animation-authoring.component';
6262
import { OpenResponseGrading } from '../../../wise5/components/openResponse/open-response-grading/open-response-grading.component';
6363
import { MultipleChoiceGrading } from '../../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component';
64+
import { MatchGrading } from '../../../wise5/components/match/match-grading/match-grading.component';
6465

6566
@NgModule({
6667
declarations: [
@@ -90,6 +91,7 @@ import { MultipleChoiceGrading } from '../../../wise5/components/multipleChoice/
9091
LabelAuthoring,
9192
ManageStudentsComponent,
9293
MatchAuthoring,
94+
MatchGrading,
9395
MilestonesComponent,
9496
MilestoneReportDataComponent,
9597
MultipleChoiceAuthoring,

src/main/webapp/wise5/classroomMonitor/classroomMonitorComponents/shared/workgroupComponentRevisions/workgroupComponentRevisions.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,15 @@ const WorkgroupComponentRevisions = {
158158
</h3>
159159
<div style="padding: 20px;">
160160
<ng-content ng-switch="item.componentState.componentType">
161-
<div ng-switch-when="MultipleChoice|OpenResponse" ng-switch-when-separator="|" class="component__content" layout="row" layout-wrap>
161+
<div ng-switch-when="Match|MultipleChoice|OpenResponse" ng-switch-when-separator="|" class="component__content" layout="row" layout-wrap>
162162
<div flex="100" flex-gt-sm="66" layout="column" class="component--grading__response">
163+
<match-grading
164+
ng-if="item.componentState.componentType === 'Match'"
165+
node-id="{{::$ctrl.nodeId}}"
166+
component-id="{{::$ctrl.componentId}}"
167+
component-state="{{ item.componentState }}"
168+
workgroup-id="::$ctrl.workgroupId">
169+
</match-grading>
163170
<multiple-choice-grading
164171
ng-if="item.componentState.componentType === 'MultipleChoice'"
165172
node-id="{{::$ctrl.nodeId}}"

src/main/webapp/wise5/classroomMonitor/classroomMonitorComponents/shared/workgroupNodeGrading/workgroupNodeGrading.ts

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,28 +138,36 @@ const WorkgroupNodeGrading = {
138138
</h3>
139139
<ng-content ng-switch="::component.type">
140140
{{latestComponentState = $ctrl.getLatestComponentStateByWorkgroupIdAndComponentId($ctrl.workgroupId, component.id); ""}}
141-
<div ng-switch-when="MultipleChoice|OpenResponse" ng-switch-when-separator="|" class="component__content" layout="row" layout-wrap>
141+
<div ng-switch-when="Match|MultipleChoice|OpenResponse" ng-switch-when-separator="|" class="component__content" layout="row" layout-wrap>
142142
<div flex="100" flex-gt-sm="66" layout="column" class="component--grading__response">
143-
<multiple-choice-grading
144-
ng-if="component.type === 'MultipleChoice'"
145-
node-id="{{::$ctrl.nodeId}}"
146-
component-id="{{::component.id}}"
147-
component-state="{{latestComponentState}}">
148-
</multiple-choice-grading>
149-
<open-response-grading
150-
ng-if="component.type === 'OpenResponse'"
151-
node-id="{{::$ctrl.nodeId}}"
152-
component-id="{{::component.id}}"
153-
component-state="{{latestComponentState}}">
154-
</open-response-grading>
155-
<span flex></span>
156-
<component-revisions-info node-id="::$ctrl.nodeId"
157-
component-id="::component.id"
158-
from-workgroup-id="::$ctrl.teacherWorkgroupId"
159-
to-workgroup-id="::$ctrl.workgroupId"
160-
component-state="latestComponentState"
161-
active='true'>
162-
</component-revisions-info>
143+
<ng-content ng-if="latestComponentState != null && latestComponentState !== ''">
144+
<match-grading
145+
ng-if="component.type === 'Match'"
146+
node-id="{{::$ctrl.nodeId}}"
147+
component-id="{{::component.id}}"
148+
component-state="{{latestComponentState}}">
149+
</match-grading>
150+
<multiple-choice-grading
151+
ng-if="component.type === 'MultipleChoice'"
152+
node-id="{{::$ctrl.nodeId}}"
153+
component-id="{{::component.id}}"
154+
component-state="{{latestComponentState}}">
155+
</multiple-choice-grading>
156+
<open-response-grading
157+
ng-if="component.type === 'OpenResponse'"
158+
node-id="{{::$ctrl.nodeId}}"
159+
component-id="{{::component.id}}"
160+
component-state="{{latestComponentState}}">
161+
</open-response-grading>
162+
<span flex></span>
163+
<component-revisions-info node-id="::$ctrl.nodeId"
164+
component-id="::component.id"
165+
from-workgroup-id="::$ctrl.teacherWorkgroupId"
166+
to-workgroup-id="::$ctrl.workgroupId"
167+
component-state="latestComponentState"
168+
active='true'>
169+
</component-revisions-info>
170+
</ng-content>
163171
</div>
164172
<div flex="100" flex-gt-sm="33" class="component--grading__annotations">
165173
<component-grading node-id="::$ctrl.nodeId"

0 commit comments

Comments
 (0)