From 95a4f84f060036199927de3911f41a7ff443fdd3 Mon Sep 17 00:00:00 2001 From: Dominik Vitt Date: Wed, 9 Oct 2019 17:07:32 +0200 Subject: [PATCH] Fixed issue #14628: Array numbers question type doesn't include proper subquestion and answer details at "print answers" overview --- application/models/SurveyDynamic.php | 1 + .../question_types/template_array-multi-flexi-text.twig | 4 ++-- .../question_types/template_array-multi-flexi.twig | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/models/SurveyDynamic.php b/application/models/SurveyDynamic.php index 63faec01758..a84f860d13a 100644 --- a/application/models/SurveyDynamic.php +++ b/application/models/SurveyDynamic.php @@ -953,6 +953,7 @@ public function getQuestionArray($oQuestion, $oResponses, $bHonorConditions, $su foreach (Question::model()->findAllByAttributes(array('parent_qid' => $aQuestionAttributes['parent_qid'], 'scale_id' => ($oQuestion->parents['type'] == '1' ? 2 : 1))) as $oScaleSubquestion) { $tempFieldname = $fieldname.'_'.$oScaleSubquestion->title; $aQuestionAttributes['answervalues'][$oScaleSubquestion->title] = isset($oResponses[$tempFieldname]) ? $oResponses[$tempFieldname] : null; + $aQuestionAttributes['answervalueslabels'][$oScaleSubquestion->title] = isset($oScaleSubquestion->question) ? $oScaleSubquestion->question : null; } } diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig index 0ecfdcac9a2..aba6461bfee 100644 --- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig +++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi-text.twig @@ -6,8 +6,8 @@ {% if subquestion.question_order == 1 %} - {% for colname, value in subquestion.answervalues %} - {{colname}} + {% for colname, value in subquestion.answervalueslabels %} + {{value}} - {{colname}} {% endfor %} {% endif %} diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi.twig index a316741f938..1c778d64aad 100644 --- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi.twig +++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_array-multi-flexi.twig @@ -6,8 +6,8 @@ {% if subquestion.question_order == 1 %} - {% for colname, value in subquestion.answervalues %} - {{colname}} + {% for colname, value in subquestion.answervalueslabels %} + {{value}} - {{colname}} {% endfor %} {% endif %}