MDL-60139 question manual grading: move code to reduce confusion

Move the variable definition closer to where it is used.
This commit is contained in:
Tim Hunt 2017-10-26 19:00:46 +01:00
parent 808b68835b
commit 284c795d23

View file

@ -126,9 +126,6 @@ abstract class qbehaviour_renderer extends plugin_renderer_base {
if (!is_null($currentmark)) { if (!is_null($currentmark)) {
$attributes['value'] = $currentmark; $attributes['value'] = $currentmark;
} }
$a = new stdClass();
$a->max = $qa->format_max_mark($options->markdp);
$a->mark = html_writer::empty_tag('input', $attributes);
$markrange = html_writer::empty_tag('input', array( $markrange = html_writer::empty_tag('input', array(
'type' => 'hidden', 'type' => 'hidden',
@ -152,6 +149,9 @@ abstract class qbehaviour_renderer extends plugin_renderer_base {
array('class' => 'error')) . html_writer::empty_tag('br'); array('class' => 'error')) . html_writer::empty_tag('br');
} }
$a = new stdClass();
$a->max = $qa->format_max_mark($options->markdp);
$a->mark = html_writer::empty_tag('input', $attributes);
$mark = html_writer::tag('div', html_writer::tag('div', $mark = html_writer::tag('div', html_writer::tag('div',
html_writer::tag('label', get_string('mark', 'question'), html_writer::tag('label', get_string('mark', 'question'),
array('for' => $markfield)), array('for' => $markfield)),