Questions that will be asked in a survey.
Each question can have one of more suggested answers (eg. in case of
multi-answer checkboxes, radio buttons...).
Technical note:
survey.question is also the model used for the survey's pages (with the "is_page" field set to True).
A page corresponds to a "section" in the interface, and the fact that it separates the survey in
actual pages in the interface depends on the "questions_layout" parameter on the survey.survey model.
Pages are also used when randomizing questions. The randomization can happen within a "page".
Using the same model for questions and pages allows to put all the pages and questions together in a o2m field
(see survey.survey.question_and_page_ids) on the view side and easily reorganize your survey by dragging the
items around.
It also removes on level of encoding by directly having 'Add a page' and 'Add a question'
links on the list view of questions, enabling a faster encoding.
However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"
That makes the use and display of these information at view and controller levels easier to understand.