From 2961feb71ca7d000c8484da2c8dae97933a3f70b Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 24 Nov 2020 13:08:54 +0800 Subject: [PATCH] MDL-70288 qtype: Remove unnecessary empty label string * When a label is passed to an (advanced) checkbox and no text was provided, the label will be displayed on the right of the the checkbox element. So there's no point in passing an empty string for the label just to render the text to the right of the checkbox. --- question/type/ddimageortext/edit_ddimageortext_form.php | 6 ++---- question/type/ddmarker/edit_ddmarker_form.php | 6 ++---- question/type/ddwtos/edit_ddwtos_form.php | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/question/type/ddimageortext/edit_ddimageortext_form.php b/question/type/ddimageortext/edit_ddimageortext_form.php index 9b9f1d831e7..7d499e7f5b9 100644 --- a/question/type/ddimageortext/edit_ddimageortext_form.php +++ b/question/type/ddimageortext/edit_ddimageortext_form.php @@ -116,8 +116,7 @@ class qtype_ddimageortext_edit_form extends qtype_ddtoimage_edit_form_base { protected function definition_draggable_items($mform, $itemrepeatsatstart) { $mform->addElement('header', 'draggableitemheader', get_string('draggableitems', 'qtype_ddimageortext')); - $mform->addElement('advcheckbox', 'shuffleanswers', ' ', - get_string('shuffleimages', 'qtype_'.$this->qtype())); + $mform->addElement('advcheckbox', 'shuffleanswers', get_string('shuffleimages', 'qtype_'.$this->qtype())); $mform->setDefault('shuffleanswers', 0); $this->repeat_elements($this->draggable_item($mform), $itemrepeatsatstart, $this->draggable_items_repeated_options(), @@ -143,8 +142,7 @@ class qtype_ddimageortext_edit_form extends qtype_ddtoimage_edit_form_base { get_string('group', 'qtype_gapselect'), $options, array('class' => 'draggroup')); - $grouparray[] = $mform->createElement('advcheckbox', 'infinite', ' ', - get_string('infinite', 'qtype_ddimageortext')); + $grouparray[] = $mform->createElement('advcheckbox', 'infinite', get_string('infinite', 'qtype_ddimageortext')); $draggableimageitem[] = $mform->createElement('group', 'drags', get_string('draggableitemheader', 'qtype_ddimageortext', '{no}'), $grouparray); diff --git a/question/type/ddmarker/edit_ddmarker_form.php b/question/type/ddmarker/edit_ddmarker_form.php index 8242691a437..15ff5864e7c 100644 --- a/question/type/ddmarker/edit_ddmarker_form.php +++ b/question/type/ddmarker/edit_ddmarker_form.php @@ -44,8 +44,7 @@ class qtype_ddmarker_edit_form extends qtype_ddtoimage_edit_form_base { } protected function definition_inner($mform) { - $mform->addElement('advcheckbox', 'showmisplaced', ' ', - get_string('showmisplaced', 'qtype_ddmarker')); + $mform->addElement('advcheckbox', 'showmisplaced', get_string('showmisplaced', 'qtype_ddmarker')); parent::definition_inner($mform); $mform->addHelpButton('drops[0]', 'dropzones', 'qtype_ddmarker'); @@ -60,8 +59,7 @@ class qtype_ddmarker_edit_form extends qtype_ddtoimage_edit_form_base { protected function definition_draggable_items($mform, $itemrepeatsatstart) { $mform->addElement('header', 'draggableitemheader', get_string('markers', 'qtype_ddmarker')); - $mform->addElement('advcheckbox', 'shuffleanswers', ' ', - get_string('shuffleimages', 'qtype_'.$this->qtype())); + $mform->addElement('advcheckbox', 'shuffleanswers', get_string('shuffleimages', 'qtype_'.$this->qtype())); $mform->setDefault('shuffleanswers', 0); $this->repeat_elements($this->draggable_item($mform), $itemrepeatsatstart, $this->draggable_items_repeated_options(), diff --git a/question/type/ddwtos/edit_ddwtos_form.php b/question/type/ddwtos/edit_ddwtos_form.php index f42b439d0db..84479dd84f8 100644 --- a/question/type/ddwtos/edit_ddwtos_form.php +++ b/question/type/ddwtos/edit_ddwtos_form.php @@ -49,8 +49,7 @@ class qtype_ddwtos_edit_form extends qtype_gapselect_edit_form_base { protected function choice_group($mform) { $grouparray = parent::choice_group($mform); - $grouparray[] = $mform->createElement('checkbox', 'infinite', ' ', - get_string('infinite', 'qtype_ddwtos'), null, + $grouparray[] = $mform->createElement('checkbox', 'infinite', get_string('infinite', 'qtype_ddwtos'), '', null, array('size' => 1, 'class' => 'tweakcss')); return $grouparray; }