MDL-71301 qtype_gapselect: Make blank answer box labels more meaningful

This commit is contained in:
Issam Taboubi
2022-06-02 10:51:33 +08:00
committed by Jun Pataleta
parent b81a2f80f7
commit fd2c90c29a
2 changed files with 5 additions and 1 deletions
@@ -24,6 +24,7 @@
$string['addmorechoiceblanks'] = 'Blanks for {no} more choices';
$string['answer'] = 'Answer';
$string['blanknumber'] = 'Blank {$a}';
$string['choices'] = 'Choices';
$string['choicex'] = 'Choice [[{no}]]';
$string['combinedcontrolnamegapselect'] = 'drop-down menu';
+4 -1
View File
@@ -72,7 +72,10 @@ class qtype_gapselect_renderer extends qtype_elements_embedded_in_question_text_
}
// Use non-breaking space instead of 'Choose...'.
$selecthtml = html_writer::select($selectoptions, $qa->get_qt_field_name($fieldname),
$selecthtml = html_writer::label(get_string('blanknumber', 'qtype_gapselect', $place),
$attributes['id'], false,
array('class' => 'sr-only'));
$selecthtml .= html_writer::select($selectoptions, $qa->get_qt_field_name($fieldname),
$value, ' ', $attributes) . ' ' . $feedbackimage;
return html_writer::tag('span', $selecthtml, array('class' => 'control '.$groupclass));
}