MDL-58852 choice: Use multilang for choice options in charts
authorLuca Bösch <luca.boesch@bfh.ch>
Mon, 8 May 2017 21:14:48 +0000 (23:14 +0200)
committer= <=>
Sun, 14 May 2017 19:31:10 +0000 (21:31 +0200)
mod/choice/lib.php

index f09321a..58ad781 100644 (file)
@@ -530,7 +530,8 @@ function prepare_choice_show_results($choice, $course, $cm, $allresponses) {
     $allusers = [];
     foreach ($choice->option as $optionid => $optiontext) {
         $display->options[$optionid] = new stdClass;
-        $display->options[$optionid]->text = $optiontext;
+        $display->options[$optionid]->text = format_string($optiontext, true,
+            ['context' => context_module::instance($cm->id)]);
         $display->options[$optionid]->maxanswer = $choice->maxanswers[$optionid];
 
         if (array_key_exists($optionid, $allresponses)) {