summaryrefslogtreecommitdiff
path: root/addons/survey/models
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2020-05-08 14:38:16 +0000
committerThibault Delavallée <tde@odoo.com>2020-07-28 08:03:36 +0000
commit0941f784ef325fdafe0cfc3400a4f519cb44f0aa (patch)
treef3ea972d664a32ce96e8b4b3fef5be2888de4a07 /addons/survey/models
parentd271c320582309fff6579b5f533b14fbd7544d15 (diff)
[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
Diffstat (limited to 'addons/survey/models')
-rw-r--r--addons/survey/models/survey_survey.py4
1 files 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(