MDL-76597 mod_quiz: Add label for question checkboxes

This commit is contained in:
Jun Pataleta 2023-01-05 12:27:14 +08:00
parent ca841d1489
commit 77a0f1b129
2 changed files with 6 additions and 2 deletions

View File

@ -784,12 +784,15 @@ class edit_renderer extends \plugin_renderer_base {
* @return string HTML to output.
*/
public function get_checkbox_render(structure $structure, int $slot) : string {
$questionslot = $structure->get_displayed_number_for_slot($slot);
$checkbox = new \core\output\checkbox_toggleall($this->togglegroup, false,
[
'id' => 'selectquestion-' . $structure->get_displayed_number_for_slot($slot),
'id' => 'selectquestion-' . $questionslot,
'name' => 'selectquestion[]',
'value' => $structure->get_displayed_number_for_slot($slot),
'value' => $questionslot,
'classes' => 'select-multiple-checkbox',
'label' => get_string('selectquestionslot', 'quiz', $questionslot),
'labelclasses' => 'sr-only',
]);
return $this->render($checkbox);

View File

@ -930,6 +930,7 @@ $string['selectedattempts'] = 'Selected attempts...';
$string['selectmultipleitems'] = 'Select multiple items';
$string['selectmultipletoolbar'] = 'Select multiple toolbar';
$string['selectnone'] = 'Deselect all';
$string['selectquestionslot'] = 'Select question {$a}';
$string['selectquestiontype'] = '-- Select question type --';
$string['serveradded'] = 'Server added';
$string['serveridentifier'] = 'Identifier';