mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
MDL-31235 core_grades: use text filters for criterion fields
This commit is contained in:
parent
8503f2cfd8
commit
75b8733197
@ -962,7 +962,7 @@ class gradingform_guide_instance extends gradingform_instance {
|
||||
if (!empty($this->validationerrors)) {
|
||||
foreach ($this->validationerrors as $id => $err) {
|
||||
$a = new stdClass();
|
||||
$a->criterianame = s($criteria[$id]['shortname']);
|
||||
$a->criterianame = format_text($criteria[$id]['shortname'], FORMAT_HTML);
|
||||
$a->maxscore = $criteria[$id]['maxscore'];
|
||||
if ($this->validationerrors[$id]['score'] < 0) {
|
||||
$html .= html_writer::tag('div', get_string('err_scoreisnegative', 'gradingform_guide', $a),
|
||||
|
@ -137,7 +137,11 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
'id' => '{NAME}[criteria][{CRITERION-id}][shortname]',
|
||||
'aria-describedby' => '{NAME}-criterion-name-label'
|
||||
);
|
||||
$shortname = html_writer::div(s($criterion['shortname']), 'criterionshortname', $shortnameparams);
|
||||
$shortname = html_writer::div(
|
||||
format_text($criterion['shortname'], FORMAT_HTML),
|
||||
'criterionshortname',
|
||||
$shortnameparams
|
||||
);
|
||||
|
||||
$descmarkerclass = '';
|
||||
$descstudentclass = '';
|
||||
@ -149,10 +153,12 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
$descstudentclass = ' hide';
|
||||
}
|
||||
}
|
||||
$description = html_writer::tag('div', s($criterion['description']),
|
||||
$description = html_writer::tag('div',
|
||||
format_text($criterion['description'], $criterion['descriptionformat']),
|
||||
array('class'=>'criteriondescription'.$descstudentclass,
|
||||
'name' => '{NAME}[criteria][{CRITERION-id}][descriptionmarkers]'));
|
||||
$descriptionmarkers = html_writer::tag('div', s($criterion['descriptionmarkers']),
|
||||
$descriptionmarkers = html_writer::tag('div',
|
||||
format_text($criterion['descriptionmarkers'], $criterion['descriptionmarkersformat']),
|
||||
array('class'=>'criteriondescriptionmarkers'.$descmarkerclass,
|
||||
'name' => '{NAME}[criteria][{CRITERION-id}][descriptionmarkers]'));
|
||||
$maxscore = html_writer::tag('div', s($criterion['maxscore']),
|
||||
@ -248,7 +254,7 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
foreach ($comments as $id => $comment) {
|
||||
$commentoption = new stdClass();
|
||||
$commentoption->id = $id;
|
||||
$commentoption->description = $comment['description'];
|
||||
$commentoption->description = html_to_text(format_text($comment['description'], $comment['descriptionformat']));
|
||||
$commentoptions[] = $commentoption;
|
||||
}
|
||||
|
||||
@ -264,7 +270,8 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
'class' => 'hidden',
|
||||
'id' => '{NAME}-remarklabel{CRITERION-id}'
|
||||
);
|
||||
$remarklabeltext = get_string('criterionremark', 'gradingform_guide', $criterion['shortname']);
|
||||
$remarklabeltext = get_string('criterionremark', 'gradingform_guide',
|
||||
format_text($criterion['shortname'], FORMAT_HTML));
|
||||
$remarklabel = html_writer::label($remarklabeltext, $remarkid, false, $remarklabelparams);
|
||||
|
||||
$criteriontemplate .= html_writer::tag('td', $remarklabel . $input . $commentchooser, array('class' => 'remark'));
|
||||
@ -391,7 +398,7 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
'title' => get_string('clicktocopy', 'gradingform_guide'),
|
||||
'id' => '{NAME}[comments][{COMMENT-id}]', 'class'=>'markingguidecomment'));
|
||||
} else {
|
||||
$description = s($comment['description']);
|
||||
$description = format_text($comment['description'], $comment['descriptionformat']);
|
||||
}
|
||||
// Retain newlines as <br> tags when displaying 'frequently used comments'.
|
||||
$description = nl2br($description);
|
||||
|
Loading…
x
Reference in New Issue
Block a user