diff options
| author | David Beguin <dbe@odoo.com> | 2020-04-16 08:00:46 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-07-28 08:03:33 +0000 |
| commit | 2efc4678bca33da5a09078e54e3c06d2f96ffa7a (patch) | |
| tree | 349e1741b51ecee59e9a09e749c6fdb3bca632a8 /addons | |
| parent | e4e049ef22e1b0fc52e9cd05dd47367fe668eb94 (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/survey/static/src/js/survey_form.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/survey/static/src/js/survey_form.js b/addons/survey/static/src/js/survey_form.js index e4bcf76fea9..ada2b644d32 100644 --- a/addons/survey/static/src/js/survey_form.js +++ b/addons/survey/static/src/js/survey_form.js @@ -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; |
