From a50f89ecf56928d303f027267fcb0c7caa1b28d3 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Thu, 5 Jul 2012 12:16:30 +0800 Subject: [PATCH] MDL-30816 Choice module: add format_string() for choice name. --- mod/choice/renderer.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/choice/renderer.php b/mod/choice/renderer.php index 08ddb02df1dac..07bbd19d84cda 100644 --- a/mod/choice/renderer.php +++ b/mod/choice/renderer.php @@ -141,7 +141,7 @@ public function display_publish_name_vertical($choices) { $table->cellspacing = 0; $table->attributes['class'] = 'results names '; $table->tablealign = 'center'; - $table->summary = get_string('responsesto', 'choice', $choices->name); + $table->summary = get_string('responsesto', 'choice', format_string($choices->name)); $table->data = array(); $count = 0; @@ -206,6 +206,7 @@ public function display_publish_name_vertical($choices) { if ($choices->showunanswered || $optionid > 0) { if (!empty($options->user)) { + $optionusers = ''; foreach ($options->user as $user) { $data = ''; if (empty($user->imagealt)){ @@ -223,8 +224,9 @@ public function display_publish_name_vertical($choices) { $name = html_writer::tag('a', fullname($user, $choices->fullnamecapability), array('href'=>$userlink, 'class'=>'username')); $data .= html_writer::tag('div', $name, array('class'=>'fullname')); $data .= html_writer::tag('div','', array('class'=>'clearfloat')); - $cell->text = html_writer::tag('div', $data, array('class'=>'user')); + $optionusers .= html_writer::tag('div', $data, array('class'=>'user')); } + $cell->text = $optionusers; } } $columns[] = $cell; @@ -277,7 +279,7 @@ public function display_publish_anonymous_vertical($choices) { $table->cellpadding = 5; $table->cellspacing = 0; $table->attributes['class'] = 'results anonymous '; - $table->summary = get_string('responsesto', 'choice', $choices->name); + $table->summary = get_string('responsesto', 'choice', format_string($choices->name)); $table->data = array(); $count = 0; @@ -380,7 +382,7 @@ public function display_publish_anonymous_horizontal($choices) { $table->cellpadding = 5; $table->cellspacing = 0; $table->attributes['class'] = 'results anonymous '; - $table->summary = get_string('responsesto', 'choice', $choices->name); + $table->summary = get_string('responsesto', 'choice', format_string($choices->name)); $table->data = array(); $columnheaderdefault = new html_table_cell();