From 854083f70a0ea4d6d1a5950c65e10f447c87bcaf Mon Sep 17 00:00:00 2001 From: Sahil Patel Date: Tue, 14 Mar 2023 15:59:23 +0530 Subject: [PATCH] [IMP] survey: improve mcq design Currently, in the survey for single/multiple choice questions, the layout is not consistent. For example, if there are four choices available, the layout is 3-1 (3 small options in the first row, 1 full-width option in the last row). Apart from that, if the string for options is long, the radio/check box comes at the bottom right corner, which should always be at the top right corner. This commit does the following improvements: 1/ Improve the choices layout to make it beautiful. now there will be only one answer per row similar to the 'One Page Per Question' layout. 2/ The radio / check-box icon will be displayed in the top right corner regardless of the length of the option strings. 3/ If there is one or more image(s) in the answers then we will follow 2x2 layout instead of one row per answer. TaskID-2712296 closes odoo/odoo#99229 Signed-off-by: Florian Charlier (flch) --- .../src/scss/survey_templates_form.scss | 14 -- addons/survey/views/survey_templates.xml | 187 +++++++++--------- .../survey/views/survey_templates_print.xml | 2 +- 3 files changed, 94 insertions(+), 109 deletions(-) diff --git a/addons/survey/static/src/scss/survey_templates_form.scss b/addons/survey/static/src/scss/survey_templates_form.scss index c7419150ee3..109a4467214 100644 --- a/addons/survey/static/src/scss/survey_templates_form.scss +++ b/addons/survey/static/src/scss/survey_templates_form.scss @@ -139,20 +139,6 @@ _::-webkit-full-page-media, _:future, :root .o_survey_wrap { font-weight: 300; } - .o_survey_page_per_question.o_survey_simple_choice.o_survey_minimized_display, - .o_survey_page_per_question.o_survey_multiple_choice.o_survey_minimized_display, - .o_survey_page_per_question.o_survey_numerical_box, - .o_survey_page_per_question.o_survey_date, - .o_survey_page_per_question.o_survey_datetime { - // 'pixel perfect' layouting for choice questions having less than 5 choices in page_per_question mode - // we use media queries instead of bootstrap classes because they don't provide everything needed here - @media (min-width: 768px) { - width: 50%; - position: relative; - left: 25%; - } - } - .o_survey_question_matrix { td { min-width: 100px; diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index c4e5a7f376a..0a40dfe31f5 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -185,8 +185,8 @@ t-att-data-time-limit-minutes="time_limit_minutes"/> -

-
+

+
@@ -199,8 +199,8 @@ -

-
+

+
@@ -221,24 +221,22 @@
- - + +
+ t-attf-class="o_survey_page_per_question o_survey_#{question.question_type} #{'w-lg-50 mx-lg-auto' if question.question_type in ('numerical_box', 'date', 'datetime') else ''}"> +
Sorry, you have not been fast enough.
+
We have registered your answer! Please wait for the host to go to the next question.
-
Sorry, you have not been fast enough.
-
We have registered your answer! Please wait for the host to go to the next question.
Pay attention to the host screen until the next question.
@@ -316,6 +314,9 @@ or any(triggering_answer in selected_answers for triggering_answer in triggering_answers_by_question[question.id])))"/> + + + @@ -325,7 +326,10 @@ The answer you entered is not valid. If other, please specify: -
- - - - - - - - + + + + + + + +
@@ -423,138 +427,133 @@ diff --git a/addons/survey/views/survey_templates_print.xml b/addons/survey/views/survey_templates_print.xml index 01c619b2c07..b051c0cea93 100644 --- a/addons/survey/views/survey_templates_print.xml +++ b/addons/survey/views/survey_templates_print.xml @@ -25,7 +25,7 @@
-
+