diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index e15cddb88f3..cc275b64e9f 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -204,8 +204,6 @@ class Survey(http.Controller): values = {'survey': survey, 'answer': answer} if token: values['token'] = token - if survey.scoring_type != 'no_scoring': - values['graph_data'] = json.dumps(answer._prepare_statistics()[answer]) return values # ------------------------------------------------------------ @@ -616,6 +614,8 @@ class Survey(http.Controller): 'scoring_display_correction': survey_sudo.scoring_type == 'scoring_with_answers' and answer_sudo, 'format_datetime': lambda dt: format_datetime(request.env, dt, dt_format=False), 'format_date': lambda date: format_date(request.env, date), + 'graph_data': json.dumps(answer_sudo._prepare_statistics()[answer_sudo]) + if answer_sudo and survey_sudo.scoring_type == 'scoring_with_answers' else False, }) @http.route('/survey//certification_preview', type="http", auth="user", website=True) diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index cd941377caf..267af1065d0 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -296,18 +296,6 @@ -
-
- -
-
- -
-
diff --git a/addons/survey/views/survey_templates_print.xml b/addons/survey/views/survey_templates_print.xml index ede6f44df29..01c619b2c07 100644 --- a/addons/survey/views/survey_templates_print.xml +++ b/addons/survey/views/survey_templates_print.xml @@ -13,6 +13,18 @@
+
+
+ +
+
+ +
+