From 0941f784ef325fdafe0cfc3400a4f519cb44f0aa Mon Sep 17 00:00:00 2001 From: David Beguin Date: Fri, 8 May 2020 14:38:16 +0000 Subject: [PATCH] [FIX] survey: ignore randomise questions mode in live session As there is no session object, it is not possible to generate a randomised set of questions that will be displayed for all the clients. When getting the most voted answers while checking which question is the next one to display, or if this question is the last one, predefined questions are regenarated each time a fake user input is created (the most voted answers.) So at the end, while checking if a question is the last one, we compare different objects. This is not an issue for non-randomised survey, as everything is constant. So, until a solution is found to keep information related to a session in particular, randomised questions mode will be ignored in live session mode. Task ID: 2230980 X-original-commit: 7f0981c4a61429802a5fe24dd794221b1275dfe3 --- addons/survey/models/survey_survey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/survey/models/survey_survey.py b/addons/survey/models/survey_survey.py index 83acb2ad764..af4b530cea7 100644 --- a/addons/survey/models/survey_survey.py +++ b/addons/survey/models/survey_survey.py @@ -72,7 +72,7 @@ class Survey(models.Model): ('all', 'All questions'), ('random', 'Randomized per section')], string="Selection", required=True, default='all', - help="If randomized is selected, add the number of random questions next to the section.") + help="If randomized is selected, you can configure the number of random questions by section. This mode is ignored in live session.") progression_mode = fields.Selection([ ('percent', 'Percentage'), ('number', 'Number')], string='Progression Mode', default='percent', @@ -509,7 +509,7 @@ class Survey(models.Model): if self.questions_layout == 'page_per_section': result = self.page_ids elif self.questions_layout == 'page_per_question': - if self.questions_selection == 'random': + if self.questions_selection == 'random' and not self.session_state: result = user_input.predefined_question_ids else: result = self.question_and_page_ids.filtered(