-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathedit-open-response-advanced.component.html
More file actions
618 lines (617 loc) · 22.7 KB
/
Copy pathedit-open-response-advanced.component.html
File metadata and controls
618 lines (617 loc) · 22.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<mat-tab-group animationDuration="0ms" [selectedIndex]="selectedTabIndex">
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>settings</mat-icon> <span i18n>General</span>
</ng-template>
<translatable-textarea
[content]="componentContent"
key="starterSentence"
label="Starter Sentence"
i18n-label
(defaultLanguageTextChanged)="componentChanged()"
/>
<div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.isStudentAudioRecordingEnabled"
(ngModelChange)="componentChanged()"
i18n
>
Allow students to record audio response
</mat-checkbox>
</div>
@if (isNotebookEnabled()) {
<edit-component-add-to-notebook-button [componentContent]="componentContent" />
<br />
}
<div class="flex flex-col justify-start items-start">
<edit-component-save-button [componentContent]="component.content" />
<edit-component-submit-button [componentContent]="component.content" />
@if (component.content.showSubmitButton) {
<edit-component-max-submit [componentContent]="component.content" />
}
<edit-component-default-feedback [componentContent]="component.content" />
<edit-component-max-score [componentContent]="component.content" />
<edit-component-exclude-from-total-score [componentContent]="component.content" />
<edit-component-width [componentContent]="component.content" />
</div>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>visibility</mat-icon> <span i18n>Visibility</span>
</ng-template>
<edit-component-constraints [componentContent]="component.content" />
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>join_inner</mat-icon> <span i18n>Connections</span>
</ng-template>
<edit-connected-components
[nodeId]="component.nodeId"
[componentId]="component.id"
[allowedConnectedComponentTypes]="allowedConnectedComponentTypes"
[componentContent]="component.content"
[connectedComponents]="component.content.connectedComponents"
(connectedComponentsChanged)="connectedComponentsChanged($event)"
/>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>message</mat-icon> <span i18n>Rubric</span>
</ng-template>
<ng-template matTabContent>
<!-- lazy load needed for tinymce to work -->
<edit-component-rubric [componentContent]="component.content" />
</ng-template>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label> <mat-icon>sell</mat-icon> <span i18n>Tags</span></ng-template>
<edit-component-tags [componentContent]="component.content" />
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>auto_awesome</mat-icon> <span i18n>AI</span>
</ng-template>
@if (aiEnabled) {
<!-- currently C-Rater can be used without the global AI being turned on, due to legacy reasons. -->
<edit-component-summarizer-system-prompt [componentContent]="component.content" />
}
<div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.enableCRater"
(ngModelChange)="enableCRaterClicked()"
i18n
>
Enable AI Model
</mat-checkbox>
</div>
@if (componentContent.enableCRater) {
<c-rater-item-select [componentContent]="componentContent" />
<div>
<mat-form-field>
<mat-label i18n>Score On</mat-label>
<mat-select
[(ngModel)]="componentContent.cRater.scoreOn"
(ngModelChange)="componentChanged()"
>
<mat-option value="submit" i18n>Submit</mat-option>
<mat-option value="save" i18n>Save</mat-option>
<mat-option value="change" i18n>Change</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.cRater.showScore"
(ngModelChange)="componentChanged()"
i18n
>
Show Score
</mat-checkbox>
</div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.cRater.showFeedback"
(ngModelChange)="componentChanged()"
i18n
>
Show Feedback
</mat-checkbox>
<div class="section-container">
<mat-checkbox
color="primary"
class="checkbox"
[ngModel]="componentContent.cRater.feedback?.enabled"
(ngModelChange)="setFeedbackEnabled($event)"
i18n
>
Enable Feedback Rules
</mat-checkbox>
@if (componentContent.cRater.feedback?.enabled) {
<edit-feedback-rules [feedbackRules]="componentContent.cRater.feedback.rules" />
}
</div>
@if (
!componentContent.cRater.feedback?.enabled &&
componentContent.cRater.scoringRules.length > 0
) {
<div class="section-container">
<div class="flex gap-2 section-label">
<span i18n>Scoring Rule</span>
<button
mat-raised-button
color="primary"
(click)="addScoringRule()"
matTooltip="Add Scoring Rule"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>add</mat-icon>
</button>
</div>
@for (
scoringRule of componentContent.cRater.scoringRules;
track $index;
let scoringRuleIndex = $index;
let isFirst = $first;
let isLast = $last
) {
<div class="flex flex-row flex-wrap items-start justify-start gap-4 section-item">
<mat-form-field class="scoring-rule-score">
<mat-label i18n>Score</mat-label>
<input
matInput
type="number"
min="0"
[(ngModel)]="scoringRule.score"
(ngModelChange)="componentChanged()"
/>
</mat-form-field>
<translatable-textarea
[content]="scoringRule"
key="feedbackText"
label="Feedback Text"
i18n-label
(defaultLanguageTextChanged)="componentChanged()"
class="scoring-rule-feedback-text"
/>
<div class="flex gap-2">
<button
mat-raised-button
color="primary"
(click)="moveObjectUp(componentContent.cRater.scoringRules, scoringRuleIndex)"
[disabled]="isFirst"
matTooltip="Move Scoring Rule Up"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="moveObjectDown(componentContent.cRater.scoringRules, scoringRuleIndex)"
[disabled]="isLast"
matTooltip="Move Scoring Rule Down"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="scoringRuleDeleteClicked(scoringRuleIndex)"
matTooltip="Delete Scoring Rule"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
}
</div>
}
<div class="section-container">
<div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.cRater.enableMultipleAttemptScoringRules"
(click)="enableMultipleAttemptScoringRulesClicked()"
i18n
>
Enable Multiple Attempt Feedback
</mat-checkbox>
</div>
@if (componentContent.cRater.enableMultipleAttemptScoringRules) {
<div class="flex gap-2 section-label">
<span i18n>Multiple Attempt Scoring Rules</span>
<button
mat-raised-button
color="primary"
(click)="addMultipleAttemptScoringRule()"
matTooltip="Add Multiple Attempt Scoring Rule"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>add</mat-icon>
</button>
</div>
@for (
multipleAttemptScoringRule of componentContent.cRater.multipleAttemptScoringRules;
track $index;
let multipleAttemptScoringRuleIndex = $index;
let isFirst = $first;
let isLast = $last
) {
<div class="flex flex-row flex-wrap items-center justify-start gap-4 section-item">
<mat-form-field class="previous-score">
<mat-label i18n>Previous Score</mat-label>
<input
matInput
[(ngModel)]="multipleAttemptScoringRule.scoreSequence[0]"
(ngModelChange)="componentChanged()"
min="0"
/>
</mat-form-field>
<mat-form-field class="current-score">
<mat-label i18n>Current Score</mat-label>
<input
matInput
[(ngModel)]="multipleAttemptScoringRule.scoreSequence[1]"
(ngModelChange)="componentChanged()"
min="0"
/>
</mat-form-field>
<translatable-textarea
[content]="multipleAttemptScoringRule"
key="feedbackText"
label="Feedback to Student"
i18n-label
(defaultLanguageTextChanged)="componentChanged()"
class="multiple-attempt-feedback"
/>
<div class="flex gap-2">
<button
mat-raised-button
color="primary"
(click)="
moveObjectUp(
componentContent.cRater.multipleAttemptScoringRules,
multipleAttemptScoringRuleIndex
)
"
[disabled]="isFirst"
matTooltip="Move Multiple Attempt Scoring Rule Up"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="
moveObjectDown(
componentContent.cRater.multipleAttemptScoringRules,
multipleAttemptScoringRuleIndex
)
"
[disabled]="isLast"
matTooltip="Move Multiple Attempt Scoring Rule Down"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="multipleAttemptScoringRuleDeleteClicked(multipleAttemptScoringRuleIndex)"
matTooltip="Delet Multiple Attempt Scoring"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
}
}
</div>
<div class="section-container">
<div>
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="componentContent.enableNotifications"
(ngModelChange)="enableNotificationsClicked()"
i18n
>
Enable Notifications
</mat-checkbox>
</div>
@if (componentContent.enableNotifications) {
<div class="flex gap-2 section-label">
<span i18n>Notifications</span>
<button
mat-raised-button
color="primary"
(click)="addNotification()"
matTooltip="Add New Notification"
matTooltipPosition="above"
i18n
>
<mat-icon>add</mat-icon>
</button>
</div>
@for (
notification of componentContent.notificationSettings.notifications;
track $index;
let notificationIndex = $index;
let isFirst = $first;
let isLast = $last
) {
<div class="section-item">
<div class="flex gap-4">
<mat-form-field class="notification-score">
<mat-label i18n>Previous Score</mat-label>
<input
matInput
type="number"
min="0"
[(ngModel)]="notification.enableCriteria.scoreSequence[0]"
(ngModelChange)="componentChanged()"
/>
</mat-form-field>
<mat-form-field class="notification-score">
<mat-label i18n>Current Score</mat-label>
<input
matInput
type="number"
min="0"
[(ngModel)]="notification.enableCriteria.scoreSequence[1]"
(ngModelChange)="componentChanged()"
/>
</mat-form-field>
<div class="flex-grow"></div>
<div class="flex gap-2">
<button
mat-raised-button
color="primary"
(click)="
moveObjectUp(
componentContent.notificationSettings.notifications,
notificationIndex
)
"
[disabled]="isFirst"
matTooltip="Move Notification Up"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="
moveObjectDown(
componentContent.notificationSettings.notifications,
notificationIndex
)
"
[disabled]="isLast"
matTooltip="Move Notification Down"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="notificationDeleteClicked(notificationIndex)"
matTooltip="Delete Notification"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
<div class="flex items-start justify-start gap-4">
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="notification.isAmbient"
i18n
>
Enable Ambient Display Dismiss Mode
</mat-checkbox>
@if (notification.isAmbient) {
<mat-form-field>
<mat-label i18n>Dismiss Code</mat-label>
<input
matInput
[(ngModel)]="notification.dismissCode"
(ngModelChange)="componentChanged()"
/>
</mat-form-field>
}
</div>
<div class="flex items-start justify-start gap-4">
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="notification.isNotifyStudent"
i18n
>
Notify Student
</mat-checkbox>
@if (notification.isNotifyStudent) {
<translatable-textarea
[content]="notification"
key="notificationMessageToStudent"
label="Feedback to Student"
i18n-label
(defaultLanguageTextChanged)="componentChanged()"
class="notification-feedback"
/>
}
</div>
<div class="flex items-start justify-start gap-4">
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="notification.isNotifyTeacher"
i18n
>
Notify Teacher
</mat-checkbox>
@if (notification.isNotifyTeacher) {
<translatable-textarea
[content]="notification"
key="notificationMessageToTeacher"
label="Feedback to Teacher"
i18n-label
(defaultLanguageTextChanged)="componentChanged()"
class="notification-feedback"
/>
}
</div>
</div>
}
}
</div>
<div class="section-container">
<mat-checkbox
color="primary"
class="checkbox"
[(ngModel)]="useCustomCompletionCriteria"
(click)="useCustomCompletionCriteriaClicked($event)"
i18n
>
Use Custom Completion Criteria
</mat-checkbox>
@if (useCustomCompletionCriteria && componentContent.completionCriteria != null) {
<div class="flex gap-2 section-label">
<span i18n>Custom Completion Criteria</span>
<button
mat-raised-button
color="primary"
(click)="addCompletionCriteria()"
matTooltip="Add Completion Criteria"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>add</mat-icon>
</button>
</div>
@for (
criteria of componentContent.completionCriteria.criteria;
track $index;
let criteriaIndex = $index;
let isFirst = $first;
let isLast = $last
) {
<div class="flex flex-row flex-wrap items-center justify-start gap-4 section-item">
<mat-form-field class="custom-completion-criteria-step">
<mat-label i18n>Step</mat-label>
<mat-select [(ngModel)]="criteria.nodeId" (ngModelChange)="componentChanged()">
@for (nodeId of nodeIds; track $index) {
@if (isApplicationNode(nodeId)) {
<mat-option [value]="nodeId">
{{ getNodePositionAndTitle(nodeId) }}
</mat-option>
}
}
</mat-select>
</mat-form-field>
<mat-form-field class="custom-completion-criteria-component">
<mat-label i18n>Activity</mat-label>
<mat-select [(ngModel)]="criteria.componentId" (ngModelChange)="componentChanged()">
@for (
component of getComponents(criteria.nodeId);
let componentIndex = $index;
track component.id
) {
<mat-option [value]="component.id">
{{ componentIndex + 1 }}. {{ component.type }}
@if (component.id === componentId) {
<span i18n>(This activity)</span>
}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field class="custom-completion-criteria-action">
<mat-label>Action</mat-label>
<mat-select [(ngModel)]="criteria.name" (ngModelChange)="componentChanged()">
<mat-option value="isSubmitted" i18n>Submit</mat-option>
<mat-option value="isSaved" i18n>Save</mat-option>
</mat-select>
</mat-form-field>
<div class="flex-grow"></div>
<div class="flex gap-2">
<button
mat-raised-button
color="primary"
(click)="
moveObjectUp(componentContent.completionCriteria.criteria, criteriaIndex)
"
[disabled]="isFirst"
matTooltip="Move Completion Criteria Up"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="
moveObjectDown(componentContent.completionCriteria.criteria, criteriaIndex)
"
[disabled]="isLast"
matTooltip="Move Completion Criteria Down"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="deleteCompletionCriteria(criteriaIndex)"
matTooltip="Delete Completion Criteria"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
}
}
</div>
<div class="section-container">
@if (componentContent.enableCRater) {
<edit-crater-info [cRaterRubric]="componentContent.cRater.rubric" />
}
</div>
}
</mat-tab>
<mat-tab>
<ng-template mat-tab-label> <mat-icon>code</mat-icon> <span i18n>JSON</span></ng-template>
<edit-component-json [component]="component" />
</mat-tab>
</mat-tab-group>