MOBILE-3213 survey: Check question is required to disable the submission
parent
67b5deb5bc
commit
a6e68c7176
|
@ -163,13 +163,10 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
|
||||||
* @return If answers are valid
|
* @return If answers are valid
|
||||||
*/
|
*/
|
||||||
isValidResponse(): boolean {
|
isValidResponse(): boolean {
|
||||||
for (const x in this.answers) {
|
return !this.questions.some((question) => {
|
||||||
if (this.answers[x] === -1) {
|
return question.required && question.name &&
|
||||||
return false;
|
(question.type === 0 ? this.answers[question.name] == '' : parseInt(this.answers[question.name], 10) === -1);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue