mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-54056 gradingform_guide: Conditionally render comments chooser
Render the frequently-used comments only if there are defined frequently used comments
This commit is contained in:
parent
fc1ef59fbe
commit
f8a5c98eb6
@ -235,10 +235,13 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
// Grading remark text area.
|
||||
$input = html_writer::tag('textarea', s($currentremark), $remarkparams);
|
||||
|
||||
// Show the frequently-used comments chooser only if there are defined entries.
|
||||
if (!empty($comments)) {
|
||||
// Frequently used comments chooser.
|
||||
$chooserbuttonid = 'criteria-' . $criterion['id'] . '-commentchooser';
|
||||
$commentchooserparams = array('id' => $chooserbuttonid, 'class' => 'commentchooser');
|
||||
$commentchooser = html_writer::tag('button', get_string('insertcomment', 'gradingform_guide'), $commentchooserparams);
|
||||
$commentchooser = html_writer::tag('button', get_string('insertcomment', 'gradingform_guide'),
|
||||
$commentchooserparams);
|
||||
|
||||
// Option items for the frequently used comments chooser dialog.
|
||||
$commentoptions = array();
|
||||
@ -254,6 +257,7 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
// Include comment_chooser module.
|
||||
$PAGE->requires->js_call_amd('gradingform_guide/comment_chooser', 'initialise',
|
||||
array($criterion['id'], $chooserbuttonid, $remarkid, $commentoptions));
|
||||
}
|
||||
|
||||
// Hidden marking guide remark label.
|
||||
$remarklabelparams = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user