Skip to content

Commit 0437380

Browse files
committed
TD-4388: Assessment resource settings need a required field marker
1 parent 03f6801 commit 0437380

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
<div class="d-flex">
6767
<div class="selection pr-50">
68-
<div>Provide guidance for the learner at the end of this assessment. <i class="warningTriangle fas fa-exclamation-triangle warm-yellow"></i></div>
68+
<div>Provide guidance for the learner at the end of this assessment. <i v-if="!IsVisible" class="warningTriangle fas fa-exclamation-triangle warm-yellow"></i></div>
6969
<EditSaveFieldWithCharacterCount v-model="assessmentDetails.endGuidance.blocks[0].title"
7070
addEditLabel="title"
7171
v-bind:characterLimit="60"
@@ -79,7 +79,7 @@
7979
<h3>Tip</h3>
8080
You can offer guidance to the learner at the end of the assessment such as next steps or recommendations on other learning resources to try. </div>
8181
</div>
82-
<Button class="mt-5" color="green" v-on:click="isOpen = false" :disabled="!canSaveAll">Save settings</Button>
82+
<Button class="mt-5" color="green" v-on:click="isOpen = false" :disabled="!IsVisible">Save settings</Button>
8383
</div>
8484
</div>
8585
</v-card>
@@ -131,6 +131,7 @@
131131
endGuidance: "",
132132
initialGuidance: "",
133133
guidanceValid: true,
134+
IsVisible: false,
134135
}
135136
},
136137
watch: {
@@ -139,7 +140,7 @@
139140
{
140141
this.assessmentDetails.endGuidance.addBlock(BlockTypeEnum.Text);
141142
}
142-
this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
143+
this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
143144
},
144145
["assessmentDetails.passMark"](value){ this.assessmentDetails.passMark = this.capNumberFieldBy(value, 100)},
145146
["assessmentDetails.maximumAttempts"](value){ this.assessmentDetails.maximumAttempts = this.capNumberFieldBy(value, 10)},
@@ -156,6 +157,14 @@
156157
}
157158
158159
this.assessmentDetails.assessmentSettingsAreValid = settingsAreValid;
160+
161+
if (this.endGuidance != "") {
162+
this.IsVisible = true;
163+
}
164+
else {
165+
this.IsVisible = false;
166+
}
167+
159168
return settingsAreValid;
160169
},
161170
},
@@ -169,9 +178,23 @@
169178
{
170179
this.endGuidance = description;
171180
}
181+
182+
if (this.endGuidance != "") {
183+
this.IsVisible = true;
184+
}
185+
else {
186+
this.IsVisible = false;
187+
}
172188
},
173189
setGuidanceValidity(valid: boolean) {
174-
this.guidanceValid = valid;
190+
if (this.endGuidance == "") {
191+
this.guidanceValid = false;
192+
this.IsVisible = false;
193+
}
194+
else {
195+
this.guidanceValid = valid;
196+
this.IsVisible = true;
197+
}
175198
}
176199
}
177200
});

0 commit comments

Comments
 (0)