Skip to content

Commit 257fd97

Browse files
committed
MOBILE-2178 survey: Remove HTML from select question
1 parent 4c12173 commit 257fd97

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

www/addons/mod/survey/controllers/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ angular.module('mm.addons.mod_survey')
110110
var isTextArea = q.multi && q.multi.length === 0 && q.type === 0;
111111
$scope.answers[q.name] = q.required ? -1 : (isTextArea ? '' : '0');
112112
}
113+
114+
if (q.multi && !q.multi.length && q.parent === 0 && q.type > 0) {
115+
// Options shown in a select. Remove all HTML.
116+
q.options = q.options.map(function(option) {
117+
return $mmText.cleanTags(option);
118+
});
119+
}
113120
});
114121
});
115122
});

www/addons/mod/survey/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h3 class="padding-horizontal">{{ question.text }}</h3>
7070
<label id="mma-mod_survey-{{question.name}}"><strong>{{question.num}}.</strong> {{ question.text }}</label>
7171
</div>
7272
<div class="col col-40 item-select">
73-
<select class="mma-mod_survey-select" ng-if="question.type > 0" ng-model="answers[question.name]" ng-options="i as o for (i,o) in question.options" aria-labelledby="mma-mod_survey-{{question.name}}" mm-ios-select-fix>
73+
<select class="mma-mod_survey-select" ng-model="answers[question.name]" ng-options="i as o for (i,o) in question.options" aria-labelledby="mma-mod_survey-{{question.name}}" mm-ios-select-fix>
7474
</select>
7575
</div>
7676
</div>

0 commit comments

Comments
 (0)