Skip to content

Commit

Permalink
MDL-71301 qtype_gapselect: Make blank answer box labels more meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
taboubi authored and junpataleta committed Jun 2, 2022
1 parent 117b240 commit 5ff0eb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions question/type/gapselect/lang/en/qtype_gapselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 4 additions & 1 deletion question/type/gapselect/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ protected function embedded_element(question_attempt $qa, $place,
}

// 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));
}
Expand Down

0 comments on commit 5ff0eb0

Please sign in to comment.