mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-54056-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
372def96c4
@ -235,26 +235,30 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
|||||||
// Grading remark text area.
|
// Grading remark text area.
|
||||||
$input = html_writer::tag('textarea', s($currentremark), $remarkparams);
|
$input = html_writer::tag('textarea', s($currentremark), $remarkparams);
|
||||||
|
|
||||||
// Frequently used comments chooser.
|
// Show the frequently-used comments chooser only if there are defined entries.
|
||||||
$chooserbuttonid = 'criteria-' . $criterion['id'] . '-commentchooser';
|
if (!empty($comments)) {
|
||||||
$commentchooserparams = array('id' => $chooserbuttonid, 'class' => 'commentchooser');
|
// Frequently used comments chooser.
|
||||||
$commentchooser = html_writer::tag('button', get_string('insertcomment', 'gradingform_guide'), $commentchooserparams);
|
$chooserbuttonid = 'criteria-' . $criterion['id'] . '-commentchooser';
|
||||||
|
$commentchooserparams = array('id' => $chooserbuttonid, 'class' => 'commentchooser');
|
||||||
|
$commentchooser = html_writer::tag('button', get_string('insertcomment', 'gradingform_guide'),
|
||||||
|
$commentchooserparams);
|
||||||
|
|
||||||
// Option items for the frequently used comments chooser dialog.
|
// Option items for the frequently used comments chooser dialog.
|
||||||
$commentoptions = array();
|
$commentoptions = array();
|
||||||
foreach ($comments as $id => $comment) {
|
foreach ($comments as $id => $comment) {
|
||||||
$commentoption = new stdClass();
|
$commentoption = new stdClass();
|
||||||
$commentoption->id = $id;
|
$commentoption->id = $id;
|
||||||
$commentoption->description = s($comment['description']);
|
$commentoption->description = s($comment['description']);
|
||||||
$commentoptions[] = $commentoption;
|
$commentoptions[] = $commentoption;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Include string for JS for the comment chooser title.
|
||||||
|
$PAGE->requires->string_for_js('insertcomment', 'gradingform_guide');
|
||||||
|
// Include comment_chooser module.
|
||||||
|
$PAGE->requires->js_call_amd('gradingform_guide/comment_chooser', 'initialise',
|
||||||
|
array($criterion['id'], $chooserbuttonid, $remarkid, $commentoptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include string for JS for the comment chooser title.
|
|
||||||
$PAGE->requires->string_for_js('insertcomment', 'gradingform_guide');
|
|
||||||
// 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.
|
// Hidden marking guide remark label.
|
||||||
$remarklabelparams = array(
|
$remarklabelparams = array(
|
||||||
'class' => 'hidden',
|
'class' => 'hidden',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user