Friday, March 6, 2020
1 change · master
New functionality added to Odoo
Survey creators can now show or skip questions based on earlier answers, creating more relevant and shorter survey paths for respondents. The feature works across standard survey layouts and live sessions, with scoring and printed results adjusted so hidden questions do not unfairly affect outcomes.
Original PR description
Purpose ======= This merge adds a new survey feature : conditional questions. A conditional question is a question that will be displayed to the user only if the user selects a specific answer from…
Purpose
=======
This merge adds a new survey feature : conditional questions. A conditional
question is a question that will be displayed to the user only if the user
selects a specific answer from another previous question i.e. question B is
displayed if user answers 'Choice 1' at question A.
Specifications
==============
There are 2 different ways to handle conditional questions.
* For one_page and page_per_section survey layout: conditional management is
done mainly at frontend side. The idea is to be able to load all the
questions of the section, hide the conditional questions and display them
dynamically on answer check.
E.g.: If user checks answer 'Choice 1' from question A, question B is
displayed immediately.
If question B is on section 2 and survey layout is set to section per page,
question B will be displayed immediately on next page template load.
Indeed, on each page load, server sends all the selected answers and the
template displays the conditional question depending on the already
elected answers;
* For page_per_question survey layout: conditional management is done mainly
at backend side. The idea is to find on each page the next question to
display depending on:
* navigation direction (next - previous)
* already selected answers and conditional question dependance
* survey questions sequence
E.g.: If questions survey are Question A, B and C and question B must be
displayed if answer 'Choice 1' from question A is selected.
At Question A, if user select 'Choice 1' and goes next: display B
At Question B, no matter the answer, if user goes next: display C
At Question B, no matter the answer, if user goes prev: display A
At Question A, if user select 'Choice 2' and goes next: display C
At Question C, no matter the answer, if user goes next: End survey
At Question C, if user has selected 'Choice 1' at question A and goes prev -> B
At Question C, if user has selected 'Choice 2' at question A and goes prev -> A
In both modes answers on questions that should not have been displayed to the
user depending on the previous selected answers are cleared.
E.g. : User checks 'choice 1' from question A, then complete question B.
Then user unchecks 'choice 1' -> answer on question B is cleared.
Remove questions that should not have been displayed to the user (depending of
the made choices) in scoring computation and print layout.
--> Inactives questions are removed from predefined questions when user finish
the survey.
E.g.: If the user selects first path on 2, he will never see second path.
If the user answers correctly to all question of first path, he should have
100%, instead of 50%, even if questions of path 2 are mandatory and scored.
Specifications: sessions
========================
This merge makes the live session mode work with conditional question.
The point is to determine which question to display next. As multiple users
are 'voting' for answers of the same questions, the way to determine the
next question to display is to keep only the most voted answer.
The most voted answer will be the only one to trigger the linked conditional
question.
E.g.: considering
- following survey configuration:
- Q1: A1, A2
- Q2: triggered by Q1-A1
- Q3: triggered by Q1-A2
- following user inputs:
- U1: A1 selected
- U2: A2 selected
- U3: A2 selected
The next question displayed to ALL users will be Q3.
Note: If U4 had selected A1, the next question would have been Q2 as
when there is an equality, we select the first one.
Links
=====
Task ID 23509
Upgrade PR odoo/upgrade#906