MDL-76849 qtype_numerical: Include question number in answer fields
* Also covers its qtype_calculated and qtype_calculatedsimple which extend its renderer class
This commit is contained in:
@@ -114,8 +114,8 @@ class qtype_numerical_renderer extends qtype_renderer {
|
||||
}
|
||||
|
||||
if ($placeholder) {
|
||||
$inputinplace = html_writer::tag('label', get_string('answer'),
|
||||
array('for' => $inputattributes['id'], 'class' => 'accesshide'));
|
||||
$inputinplace = html_writer::tag('label', $options->add_question_identifier_to_label(get_string('answer')),
|
||||
array('for' => $inputattributes['id'], 'class' => 'sr-only'));
|
||||
$inputinplace .= $input;
|
||||
$questiontext = substr_replace($questiontext, $inputinplace,
|
||||
strpos($questiontext, $placeholder), strlen($placeholder));
|
||||
@@ -125,7 +125,9 @@ class qtype_numerical_renderer extends qtype_renderer {
|
||||
|
||||
if (!$placeholder) {
|
||||
$result .= html_writer::start_tag('div', array('class' => 'ablock form-inline'));
|
||||
$result .= html_writer::tag('label', get_string('answercolon', 'qtype_numerical'), array('for' => $inputattributes['id']));
|
||||
$label = $options->add_question_identifier_to_label(get_string('answercolon', 'qtype_numerical'), true);
|
||||
$result .= html_writer::tag('label', $label,
|
||||
array('for' => $inputattributes['id']));
|
||||
$result .= html_writer::tag('span', $input, array('class' => 'answer'));
|
||||
$result .= html_writer::end_tag('div');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user