diff --git a/classes/output/sort_voting_form.php b/classes/output/sort_voting_form.php index 2aa81a8..06458a3 100644 --- a/classes/output/sort_voting_form.php +++ b/classes/output/sort_voting_form.php @@ -70,7 +70,7 @@ public function export_for_template(renderer_base $output): array { $position = isset($existingvotes[$option->id]) ? $existingvotes[$option->id] : $defaultposition++; $optionsclean[] = [ 'id' => $option->id, - 'text' => $option->text, + 'text' => format_text($option->text, FORMAT_HTML), 'position' => $position, ]; } diff --git a/lib.php b/lib.php index 48215c6..70638be 100644 --- a/lib.php +++ b/lib.php @@ -389,6 +389,10 @@ function sortvoting_get_response_data(stdClass $sortvoting, bool $onlyactive = t $previousvote = null; $maxvotescount = empty($existingvotes) ? 0 : (int) max(array_column($existingvotes, 'votescount')); foreach ($existingvotes as $key => $vote) { + // Format text for the results. + $existingvotes[$key]->text = format_text($vote->text, FORMAT_HTML); + + // Get correct positions, using the same for equal votes. if ($previousvote !== null && $previousvote->avg !== $vote->avg) { $position++; }