1
1
< ion-header >
2
2
< ion-toolbar >
3
3
< ion-title >
4
- < h1 > {{ plugin.name }}</ h1 >
4
+ < h1 > {{'addon.mod_assign.grade' | translate }}</ h1 >
5
5
</ ion-title >
6
6
< ion-buttons slot ="end ">
7
7
< ion-button fill ="clear " (click) ="closeModal() " [ariaLabel] ="'core.close' | translate ">
@@ -11,8 +11,104 @@ <h1>{{ plugin.name }}</h1>
11
11
</ ion-toolbar >
12
12
</ ion-header >
13
13
< ion-content >
14
- < form name ="addon-mod_assign-edit-feedback-form " *ngIf ="userId && plugin " #editFeedbackForm >
15
- < addon-mod-assign-feedback-plugin [assign] ="assign " [submission] ="submission " [userId] ="userId " [plugin] ="plugin " [edit] ="true " />
16
- < ion-button expand ="block " (click) ="done($event) "> {{ 'core.done' | translate }}</ ion-button >
17
- </ form >
14
+ @if (gradeInfo) {
15
+ < form name ="addon-mod_assign-edit-feedback-form " #editFeedbackForm >
16
+ <!-- Numeric grade.
17
+ Use a text input because otherwise we cannot read the value if it has an invalid character. -->
18
+ < ion-item class ="ion-text-wrap " *ngIf ="grade.method === 'simple' && !grade.scale ">
19
+ < ion-input name ="grade " *ngIf ="!grade.disabled " type ="text " [(ngModel)] ="grade.grade " min ="0 " [max] ="gradeInfo.grade "
20
+ [lang] ="grade.lang " [label] ="'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo.grade} " labelPlacement ="stacked "
21
+ [helperText] ="grade.disabled ? ('addon.mod_assign.gradelocked' | translate) : null " />
22
+ </ ion-item >
23
+
24
+ <!-- Grade using a scale. -->
25
+ < ion-item class ="ion-text-wrap " *ngIf ="grade.method === 'simple' && grade.scale ">
26
+ < ion-select name ="grade " [(ngModel)] ="grade.grade " interface ="action-sheet " [disabled] ="grade.disabled "
27
+ [cancelText] ="'core.cancel' | translate " [interfaceOptions] ="{header: 'addon.mod_assign.grade' | translate} ">
28
+ < p class ="item-heading " slot ="label "> {{ 'addon.mod_assign.grade' | translate }}</ p >
29
+ < ion-select-option *ngFor ="let grade of grade.scale " [value] ="grade.value ">
30
+ {{grade.label}}
31
+ </ ion-select-option >
32
+ </ ion-select >
33
+ </ ion-item >
34
+
35
+ <!-- Outcomes. -->
36
+ < ion-item class ="ion-text-wrap " *ngFor ="let outcome of gradeInfo.outcomes ">
37
+ < ion-select name ="outcome " *ngIf ="outcome.itemNumber " [(ngModel)] ="outcome.selectedId " interface ="action-sheet "
38
+ [disabled] ="!!gradeInfo.disabled " [cancelText] ="'core.cancel' | translate " [interfaceOptions] ="{header: outcome.name } ">
39
+ < p class ="item-heading " slot ="label "> {{ outcome.name }}</ p >
40
+ < ion-select-option *ngFor ="let grade of outcome.options " [value] ="grade.value ">
41
+ {{grade.label}}
42
+ </ ion-select-option >
43
+ </ ion-select >
44
+ < p *ngIf ="!outcome.itemNumber "> {{ outcome.selected }}</ p >
45
+ </ ion-item >
46
+
47
+ <!-- Assign grade if it wasn't released to gradebook. -->
48
+ < ion-item class ="ion-text-wrap " *ngIf ="gradeInfo && grade.unreleasedGrade !== undefined ">
49
+ < ion-label >
50
+ < p class ="item-heading "> {{ 'addon.mod_assign.currentassigngrade' | translate }}</ p >
51
+ < p *ngIf ="grade.method !== 'simple' || !grade.scale "> {{ grade.unreleasedGrade}} / {{ gradeInfo.grade }}</ p >
52
+ < p *ngIf ="grade.method === 'simple' && grade.scale "> {{ grade.unreleasedGrade }}</ p >
53
+ </ ion-label >
54
+ </ ion-item >
55
+
56
+ <!-- Gradebook grade for simple grading. -->
57
+ < ion-item class ="ion-text-wrap " *ngIf ="grade.method === 'simple' ">
58
+ < ion-label >
59
+ < p class ="item-heading "> {{ 'addon.mod_assign.currentgrade' | translate }}</ p >
60
+ < p *ngIf ="grade.gradebookGrade && !grade.scale ">
61
+ {{ grade.gradebookGrade }}
62
+ </ p >
63
+ < p *ngIf ="grade.gradebookGrade && grade.scale ">
64
+ {{ grade.scale[grade.gradebookGrade].label }}
65
+ </ p >
66
+ < p *ngIf ="!grade.gradebookGrade "> -</ p >
67
+ </ ion-label >
68
+ </ ion-item >
69
+
70
+ @if (feedback) {
71
+ < addon-mod-assign-feedback-plugin *ngFor ="let plugin of feedback.plugins " [assign] ="assign " [submission] ="userSubmission "
72
+ [userId] ="submitId " [plugin] ="plugin " [canEdit] ="true " [edit] ="true " />
73
+ }
74
+
75
+ <!--- Apply grade to all team members. -->
76
+ < ion-item class ="ion-text-wrap " *ngIf ="assign.teamsubmission ">
77
+ < ion-toggle name ="applyToAll " [(ngModel)] ="grade.applyToAll ">
78
+ < p class ="item-heading "> {{ 'addon.mod_assign.groupsubmissionsettings' | translate }}</ p >
79
+ < p > {{ 'addon.mod_assign.applytoteam' | translate }}</ p >
80
+ </ ion-toggle >
81
+ </ ion-item >
82
+
83
+ <!-- Attempt status. -->
84
+ @if (assign.maxattempts !== 1) {
85
+ < ion-item class ="ion-text-wrap ">
86
+ < ion-label >
87
+ < p class ="item-heading "> {{ 'addon.mod_assign.attemptsettings' | translate }}</ p >
88
+ < p *ngIf ="assign.maxattempts === unlimitedAttempts ">
89
+ {{ 'addon.mod_assign.outof' | translate :
90
+ {'$a': {'current': currentAttemptNumber, 'total': maxAttemptsText} } }}
91
+ </ p >
92
+ < p *ngIf ="assign.maxattempts !== unlimitedAttempts ">
93
+ {{ 'addon.mod_assign.outof' | translate :
94
+ {'$a': {'current': currentAttemptNumber, 'total': assign.maxattempts} } }}
95
+ </ p >
96
+ < p >
97
+ {{ 'addon.mod_assign.attemptreopenmethod' | translate }}:
98
+ {{ 'addon.mod_assign.attemptreopenmethod_' + assign.attemptreopenmethod | translate }}
99
+ </ p >
100
+ </ ion-label >
101
+ </ ion-item >
102
+ < ion-item *ngIf ="allowAddAttempt ">
103
+ < ion-toggle name ="addAttempt " [(ngModel)] ="grade.addAttempt ">
104
+ < p > {{ 'addon.mod_assign.addattempt' | translate }}</ p >
105
+ </ ion-toggle >
106
+ </ ion-item >
107
+ }
108
+
109
+ < ion-button expand ="block " (click) ="submitGrade() " type ="submit ">
110
+ {{ 'core.gradeverb' | translate }}
111
+ </ ion-button >
112
+ </ form >
113
+ }
18
114
</ ion-content >
0 commit comments