[FIX] survey: block selection by key when already answered in session

Before this commit, during a session, it was still possible to select another
choice (in a multiple choice question) even after having selected and submitted
an answer.

After this commit, if the question has already been answered or time limit
already ran out, it's not possible to use key to select another choice.

Task ID: 2230980

X-original-commit: e1acda0493092f5020576fc30768141a99b9fd48
This commit is contained in:
David Beguin
2020-07-28 08:03:33 +00:00
committed by Thibault Delavallée
parent e4e049ef22
commit 2efc4678bc
@@ -85,6 +85,10 @@ publicWidget.registry.SurveyFormWidget = publicWidget.Widget.extend({
if (this.$("textarea").is(":focus") || this.$('input').is(':focus')) {
return;
}
// If in session mode and question already answered, do not handle keydown
if (this.$('fieldset[disabled="disabled"]').length !== 0) {
return;
}
var self = this;
var keyCode = event.keyCode;