diff --git a/application/models/SurveyDynamic.php b/application/models/SurveyDynamic.php
index 5a1e64c5a75..79530764a21 100644
--- a/application/models/SurveyDynamic.php
+++ b/application/models/SurveyDynamic.php
@@ -864,6 +864,7 @@ public function getQuestionArray($oQuestion, $oResponses, $bHonorConditions, $su
$aQuestionAttributes['dateformat'] = getDateFormatDataForQID($aQuestionAttributes, array_merge(self::$survey->attributes, $oQuestion->survey->languagesettings[$oQuestion->language]->attributes));
}
$aQuestionAttributes['answervalue'] = isset($oResponses[$fieldname]) ? $oResponses[$fieldname] : null;
+ $aQuestionAttributes['answercode'] = $aQuestionAttributes['answervalue']; // Must keep original code for -oth- and maybe other
if ((in_array($oQuestion->type, ["!", "L", "O", "F", "H"]))
|| ($oQuestion->type=='T' && $oQuestion->parent_qid != 0) ) {
diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-dropdown.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-dropdown.twig
index ee84b70ed2f..3bf7636f215 100644
--- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-dropdown.twig
+++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-dropdown.twig
@@ -5,7 +5,12 @@
- {{question.answervalue}} - {{question.answeroption.answer}}
+ {{question.answervalue}} -
+ {% if question.answercode == '-oth-' %}
+ {{question.answeroption.answer|escape}}
+ {% else %}
+ {{question.answeroption.answer}}
+ {%endif %}
diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio.twig
index f8ed3bd85e9..bd6d4261114 100644
--- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio.twig
+++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_list-radio.twig
@@ -3,7 +3,11 @@
- {{question.answeroption.answer}}
+ {% if question.answercode == '-oth-' %}
+ {{question.answeroption.answer|escape}}
+ {% else %}
+ {{question.answeroption.answer}}
+ {%endif %}
{{question.answervalue}}
diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig
index 92b70b99d74..a5de9d7a5e8 100644
--- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig
+++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt-comments.twig
@@ -7,14 +7,14 @@
{% if subquestion.answervalue is sameas("Y") %}
{% else %}
- {{subquestion.answervalue}}
+ {{subquestion.answervalue|escape}}
{% endif %}
{{subquestion.question}} ({{subquestion.qid}})
- {{subquestion.comment.answervalue}}
+ {{subquestion.comment.answervalue|escape}}
{% endfor %}
diff --git a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt.twig b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt.twig
index 925631cd5d7..6b9fd720c26 100644
--- a/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt.twig
+++ b/themes/survey/vanilla/views/subviews/printanswers/question_types/template_multiple-opt.twig
@@ -7,7 +7,7 @@
{% if subquestion.answervalue is sameas("Y") %}
{% else %}
- {{subquestion.answervalue}}
+ {{subquestion.answervalue|escape}}
{% endif %}