Skip to content

Commit 4c16f96

Browse files
refactor(Show Work components): Convert to standalone (#2232)
Clean up related files, remove modules where possible Use createComponent() instead of Switch to dynamically create show work components
1 parent 4535ff3 commit 4c16f96

File tree

99 files changed

+725
-1079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+725
-1079
lines changed

src/app/teacher/component-show-work.module.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/assets/wise5/components/Components.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ import { AiChatStudentComponent } from './aiChat/ai-chat-student/ai-chat-student
44
import { EditAiChatAdvancedComponent } from './aiChat/edit-ai-chat-advanced/edit-ai-chat-advanced.component';
55
import { AnimationAuthoring } from './animation/animation-authoring/animation-authoring.component';
66
import { AnimationGradingComponent } from './animation/animation-grading/animation-grading.component';
7+
import { AnimationShowWorkComponent } from './animation/animation-show-work/animation-show-work.component';
78
import { AnimationStudent } from './animation/animation-student/animation-student.component';
89
import { EditAnimationAdvancedComponent } from './animation/edit-animation-advanced/edit-animation-advanced.component';
910
import { AudioOscillatorAuthoring } from './audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component';
1011
import { AudioOscillatorGradingComponent } from './audioOscillator/audio-oscillator-grading/audio-oscillator-grading.component';
12+
import { AudioOscillatorShowWorkComponent } from './audioOscillator/audio-oscillator-show-work/audio-oscillator-show-work.component';
1113
import { AudioOscillatorStudent } from './audioOscillator/audio-oscillator-student/audio-oscillator-student.component';
1214
import { EditAudioOscillatorAdvancedComponent } from './audioOscillator/edit-audio-oscillator-advanced/edit-audio-oscillator-advanced.component';
1315
import { ConceptMapAuthoring } from './conceptMap/concept-map-authoring/concept-map-authoring.component';
1416
import { ConceptMapGradingComponent } from './conceptMap/concept-map-grading/concept-map-grading.component';
17+
import { ConceptMapShowWorkComponent } from './conceptMap/concept-map-show-work/concept-map-show-work.component';
1518
import { ConceptMapStudent } from './conceptMap/concept-map-student/concept-map-student.component';
1619
import { EditConceptMapAdvancedComponent } from './conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component';
1720
import { DialogGuidanceAuthoringComponent } from './dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component';
1821
import { DialogGuidanceGradingComponent } from './dialogGuidance/dialog-guidance-grading/dialog-guidance-grading.component';
22+
import { DialogGuidanceShowWorkComponent } from './dialogGuidance/dialog-guidance-show-work/dialog-guidance-show-work.component';
1923
import { DialogGuidanceStudentComponent } from './dialogGuidance/dialog-guidance-student/dialog-guidance-student.component';
2024
import { EditDialogGuidanceAdvancedComponent } from './dialogGuidance/edit-dialog-guidance-advanced/edit-dialog-guidance-advanced.component';
2125
import { DiscussionAuthoring } from './discussion/discussion-authoring/discussion-authoring.component';
@@ -24,34 +28,41 @@ import { DiscussionStudent } from './discussion/discussion-student/discussion-st
2428
import { EditDiscussionAdvancedComponent } from './discussion/edit-discussion-advanced/edit-discussion-advanced.component';
2529
import { DrawAuthoring } from './draw/draw-authoring/draw-authoring.component';
2630
import { DrawGradingComponent } from './draw/draw-grading/draw-grading.component';
31+
import { DrawShowWorkComponent } from './draw/draw-show-work/draw-show-work.component';
2732
import { DrawStudent } from './draw/draw-student/draw-student.component';
2833
import { EditDrawAdvancedComponent } from './draw/edit-draw-advanced/edit-draw-advanced.component';
2934
import { EditEmbeddedAdvancedComponent } from './embedded/edit-embedded-advanced/edit-embedded-advanced.component';
3035
import { EmbeddedAuthoring } from './embedded/embedded-authoring/embedded-authoring.component';
3136
import { EmbeddedGradingComponent } from './embedded/embedded-grading/embedded-grading.component';
37+
import { EmbeddedShowWorkComponent } from './embedded/embedded-show-work/embedded-show-work.component';
3238
import { EmbeddedStudent } from './embedded/embedded-student/embedded-student.component';
3339
import { EditGraphAdvancedComponent } from './graph/edit-graph-advanced/edit-graph-advanced.component';
3440
import { GraphAuthoring } from './graph/graph-authoring/graph-authoring.component';
3541
import { GraphGradingComponent } from './graph/graph-grading/graph-grading.component';
42+
import { GraphShowWorkComponent } from './graph/graph-show-work/graph-show-work.component';
3643
import { GraphStudent } from './graph/graph-student/graph-student.component';
3744
import { EditHTMLAdvancedComponent } from './html/edit-html-advanced/edit-html-advanced.component';
3845
import { HtmlAuthoringComponent } from './html/html-authoring/html-authoring.component';
3946
import { HtmlStudentComponent } from './html/html-student/html-student.component';
4047
import { EditLabelAdvancedComponent } from './label/edit-label-advanced/edit-label-advanced.component';
4148
import { LabelAuthoring } from './label/label-authoring/label-authoring.component';
4249
import { LabelGradingComponent } from './label/label-grading/label-grading.component';
50+
import { LabelShowWorkComponent } from './label/label-show-work/label-show-work.component';
4351
import { LabelStudentComponent } from './label/label-student/label-student.component';
4452
import { EditMatchAdvancedComponent } from './match/edit-match-advanced/edit-match-advanced.component';
4553
import { MatchAuthoringComponent } from './match/match-authoring/match-authoring.component';
4654
import { MatchGradingComponent } from './match/match-grading/match-grading.component';
55+
import { MatchShowWorkComponent } from './match/match-show-work/match-show-work.component';
4756
import { MatchStudent } from './match/match-student/match-student.component';
4857
import { EditMultipleChoiceAdvancedComponent } from './multipleChoice/edit-multiple-choice-advanced/edit-multiple-choice-advanced.component';
4958
import { MultipleChoiceAuthoring } from './multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component';
5059
import { MultipleChoiceGradingComponent } from './multipleChoice/multiple-choice-grading/multiple-choice-grading.component';
60+
import { MultipleChoiceShowWorkComponent } from './multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component';
5161
import { MultipleChoiceStudentComponent } from './multipleChoice/multiple-choice-student/multiple-choice-student.component';
5262
import { EditOpenResponseAdvancedComponent } from './openResponse/edit-open-response-advanced/edit-open-response-advanced.component';
5363
import { OpenResponseAuthoringComponent } from './openResponse/open-response-authoring/open-response-authoring.component';
5464
import { OpenResponseGradingComponent } from './openResponse/open-response-grading/open-response-grading.component';
65+
import { OpenResponseShowWorkComponent } from './openResponse/open-response-show-work/open-response-show-work.component';
5566
import { OpenResponseStudent } from './openResponse/open-response-student/open-response-student.component';
5667
import { EditOutsideUrlAdvancedComponent } from './outsideURL/edit-outside-url-advanced/edit-outside-url-advanced.component';
5768
import { OutsideUrlAuthoring } from './outsideURL/outside-url-authoring/outside-url-authoring.component';
@@ -74,6 +85,7 @@ import { SummaryStudent } from './summary/summary-student/summary-student.compon
7485
import { EditTableAdvancedComponent } from './table/edit-table-advanced/edit-table-advanced.component';
7586
import { TableAuthoring } from './table/table-authoring/table-authoring.component';
7687
import { TableGradingComponent } from './table/table-grading/table-grading.component';
88+
import { TableShowWorkComponent } from './table/table-show-work/table-show-work.component';
7789
import { TableStudentComponent } from './table/table-student/table-student.component';
7890

7991
export const components = {
@@ -87,48 +99,56 @@ export const components = {
8799
authoring: AnimationAuthoring,
88100
authoringAdvanced: EditAnimationAdvancedComponent,
89101
grading: AnimationGradingComponent,
102+
showWork: AnimationShowWorkComponent,
90103
student: AnimationStudent
91104
},
92105
AudioOscillator: {
93106
authoring: AudioOscillatorAuthoring,
94107
authoringAdvanced: EditAudioOscillatorAdvancedComponent,
95108
grading: AudioOscillatorGradingComponent,
109+
showWork: AudioOscillatorShowWorkComponent,
96110
student: AudioOscillatorStudent
97111
},
98112
ConceptMap: {
99113
authoring: ConceptMapAuthoring,
100114
authoringAdvanced: EditConceptMapAdvancedComponent,
101115
grading: ConceptMapGradingComponent,
116+
showWork: ConceptMapShowWorkComponent,
102117
student: ConceptMapStudent
103118
},
104119
DialogGuidance: {
105120
authoring: DialogGuidanceAuthoringComponent,
106121
authoringAdvanced: EditDialogGuidanceAdvancedComponent,
107122
grading: DialogGuidanceGradingComponent,
123+
showWork: DialogGuidanceShowWorkComponent,
108124
student: DialogGuidanceStudentComponent
109125
},
110126
Discussion: {
111127
authoring: DiscussionAuthoring,
112128
authoringAdvanced: EditDiscussionAdvancedComponent,
113129
grading: DiscussionGradingComponent,
130+
showWork: DiscussionStudent,
114131
student: DiscussionStudent
115132
},
116133
Draw: {
117134
authoring: DrawAuthoring,
118135
authoringAdvanced: EditDrawAdvancedComponent,
119136
grading: DrawGradingComponent,
137+
showWork: DrawShowWorkComponent,
120138
student: DrawStudent
121139
},
122140
Embedded: {
123141
authoring: EmbeddedAuthoring,
124142
authoringAdvanced: EditEmbeddedAdvancedComponent,
125143
grading: EmbeddedGradingComponent,
144+
showWork: EmbeddedShowWorkComponent,
126145
student: EmbeddedStudent
127146
},
128147
Graph: {
129148
authoring: GraphAuthoring,
130149
authoringAdvanced: EditGraphAdvancedComponent,
131150
grading: GraphGradingComponent,
151+
showWork: GraphShowWorkComponent,
132152
student: GraphStudent
133153
},
134154
HTML: {
@@ -140,24 +160,28 @@ export const components = {
140160
authoring: LabelAuthoring,
141161
authoringAdvanced: EditLabelAdvancedComponent,
142162
grading: LabelGradingComponent,
163+
showWork: LabelShowWorkComponent,
143164
student: LabelStudentComponent
144165
},
145166
Match: {
146167
authoring: MatchAuthoringComponent,
147168
authoringAdvanced: EditMatchAdvancedComponent,
148169
grading: MatchGradingComponent,
170+
showWork: MatchShowWorkComponent,
149171
student: MatchStudent
150172
},
151173
MultipleChoice: {
152174
authoring: MultipleChoiceAuthoring,
153175
authoringAdvanced: EditMultipleChoiceAdvancedComponent,
154176
grading: MultipleChoiceGradingComponent,
177+
showWork: MultipleChoiceShowWorkComponent,
155178
student: MultipleChoiceStudentComponent
156179
},
157180
OpenResponse: {
158181
authoring: OpenResponseAuthoringComponent,
159182
authoringAdvanced: EditOpenResponseAdvancedComponent,
160183
grading: OpenResponseGradingComponent,
184+
showWork: OpenResponseShowWorkComponent,
161185
student: OpenResponseStudent
162186
},
163187
OutsideURL: {
@@ -169,6 +193,7 @@ export const components = {
169193
authoring: PeerChatAuthoringComponent,
170194
authoringAdvanced: EditPeerChatAdvancedComponentComponent,
171195
grading: PeerChatGradingComponent,
196+
showWork: PeerChatStudentComponent,
172197
student: PeerChatStudentComponent
173198
},
174199
ShowGroupWork: {
@@ -192,6 +217,7 @@ export const components = {
192217
authoring: TableAuthoring,
193218
authoringAdvanced: EditTableAdvancedComponent,
194219
grading: TableGradingComponent,
220+
showWork: TableShowWorkComponent,
195221
student: TableStudentComponent
196222
}
197223
};

src/assets/wise5/components/animation/animation-grading/animation-grading.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
[componentId]="componentId"
44
[componentState]="componentState"
55
[isRevision]="isRevision"
6-
>
7-
</animation-show-work>
6+
/>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { NgModule } from '@angular/core';
2-
import { AnimationShowWorkModule } from '../animation-show-work/animation-show-work.module';
32
import { AnimationGradingComponent } from './animation-grading.component';
3+
import { AnimationShowWorkComponent } from '../animation-show-work/animation-show-work.component';
44

55
@NgModule({
66
declarations: [AnimationGradingComponent],
7-
imports: [AnimationShowWorkModule],
7+
imports: [AnimationShowWorkComponent],
88
exports: [AnimationGradingComponent]
99
})
1010
export class AnimationGradingModule {}

src/assets/wise5/components/animation/animation-show-work/animation-show-work.component.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/assets/wise5/components/animation/animation-show-work/animation-show-work.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import { Component } from '@angular/core';
22
import { ComponentShowWorkDirective } from '../../component-show-work.directive';
33

44
@Component({
5-
selector: 'animation-show-work',
6-
templateUrl: 'animation-show-work.component.html',
7-
standalone: false
5+
selector: 'animation-show-work',
6+
template: `
7+
@if (numTimesPlayClicked != null) {
8+
<div><span i18n>Number of Times Animation Played</span>: {{ numTimesPlayClicked }}</div>
9+
}
10+
`
811
})
912
export class AnimationShowWorkComponent extends ComponentShowWorkDirective {
10-
numTimesPlayClicked: number;
13+
protected numTimesPlayClicked: number;
1114

12-
ngOnInit() {
15+
ngOnInit(): void {
1316
super.ngOnInit();
1417
this.numTimesPlayClicked = this.componentState.studentData.numTimesPlayClicked;
1518
}

src/assets/wise5/components/animation/animation-show-work/animation-show-work.module.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { NgModule } from '@angular/core';
2-
import { AudioOscillatorShowWorkModule } from '../audio-oscillator-show-work/audio-oscillator-show-work.module';
32
import { AudioOscillatorGradingComponent } from './audio-oscillator-grading.component';
3+
import { AudioOscillatorShowWorkComponent } from '../audio-oscillator-show-work/audio-oscillator-show-work.component';
44

55
@NgModule({
66
declarations: [AudioOscillatorGradingComponent],
7-
imports: [AudioOscillatorShowWorkModule],
7+
imports: [AudioOscillatorShowWorkComponent],
88
exports: [AudioOscillatorGradingComponent]
99
})
1010
export class AudioOscillatorGradingModule {}

0 commit comments

Comments
 (0)