From 622d83d7bcc2a74846ca4e02190e15c8f8706116 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 12 Jul 2019 15:43:40 +0800 Subject: [PATCH] MDL-65928 mod_choice: Use proper string for 'select/deselect all' labels * Because string concatenation is bad! --- mod/choice/lang/en/choice.php | 2 ++ mod/choice/renderer.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/choice/lang/en/choice.php b/mod/choice/lang/en/choice.php index f9ec368a556..7aa6252052b 100644 --- a/mod/choice/lang/en/choice.php +++ b/mod/choice/lang/en/choice.php @@ -70,6 +70,7 @@ $string['choice:view'] = 'View choice activity'; $string['chooseaction'] = 'Choose an action ...'; $string['chooseoption'] = 'Choose: {$a}'; $string['description'] = 'Description'; +$string['deselectalloption'] = 'Deselect all "{$a}"'; $string['includeinactive'] = 'Include responses from inactive/suspended users'; $string['indicator:cognitivedepth'] = 'Choice cognitive'; $string['indicator:cognitivedepth_help'] = 'This indicator is based on the cognitive depth reached by the student in a Choice activity.'; @@ -134,6 +135,7 @@ $string['responsesto'] = 'Responses to {$a}'; $string['results'] = 'Results'; $string['savemychoice'] = 'Save my choice'; $string['search:activity'] = 'Choice - activity information'; +$string['selectalloption'] = 'Select all "{$a}"'; $string['showpreview'] = 'Show preview'; $string['showpreview_help'] = 'Allow students to preview the available options before the choice is opened for submission.'; $string['showunanswered'] = 'Show column for unanswered'; diff --git a/mod/choice/renderer.php b/mod/choice/renderer.php index ecd3e6a97dd..2811996f4a8 100644 --- a/mod/choice/renderer.php +++ b/mod/choice/renderer.php @@ -193,8 +193,8 @@ class mod_choice_renderer extends plugin_renderer_base { // Build the select/deselect all for this option. $selectallid = 'select-response-option-' . $optionid; $togglegroup = 'responses response-option-' . $optionid; - $selectalltext = get_string('selectall', 'moodle') . ' ' . $headertitle; - $deselectalltext = get_string('deselectall', 'moodle') . ' ' . $headertitle; + $selectalltext = get_string('selectalloption', 'choice', $headertitle); + $deselectalltext = get_string('deselectalloption', 'choice', $headertitle); $mastercheckbox = new \core\output\checkbox_toggleall($togglegroup, true, [ 'id' => $selectallid, 'name' => $selectallid,