MDL-58030 gradingform_guide: Init $commentchooser before use

The initialisation of $commentschooser was moved into an IF condition,
whilst still using it outside of that IF conditions scope. As such, if
there are no comments to choose from, the variable is never init'd but
it still goes to use it, emitting a PHP notice.
This commit is contained in:
Adam Olley
2017-02-21 14:31:20 +10:30
parent 9ec952f237
commit 767761b7d8
+1
View File
@@ -236,6 +236,7 @@ class gradingform_guide_renderer extends plugin_renderer_base {
$input = html_writer::tag('textarea', s($currentremark), $remarkparams);
// Show the frequently-used comments chooser only if there are defined entries.
$commentchooser = '';
if (!empty($comments)) {
// Frequently used comments chooser.
$chooserbuttonid = 'criteria-' . $criterion['id'] . '-commentchooser';