From e8ca0ae1667fa62fe0f09c36327e995b85a9be46 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 26 Oct 2017 19:00:46 +0100 Subject: [PATCH] MDL-60139 question manual grading: move code to reduce confusion Move the variable definition closer to where it is used. --- question/behaviour/rendererbase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/question/behaviour/rendererbase.php b/question/behaviour/rendererbase.php index ea6a1878afe..b47488726e5 100644 --- a/question/behaviour/rendererbase.php +++ b/question/behaviour/rendererbase.php @@ -126,9 +126,6 @@ abstract class qbehaviour_renderer extends plugin_renderer_base { if (!is_null($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( 'type' => 'hidden', @@ -152,6 +149,9 @@ abstract class qbehaviour_renderer extends plugin_renderer_base { 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', html_writer::tag('label', get_string('mark', 'question'), array('for' => $markfield)),