mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-49176 gradingform_guide: display newline characters as <br> tags
This commit is contained in:
parent
f4bfbd5aa2
commit
556e33d77c
@ -111,7 +111,8 @@ M.gradingform_guideeditor.editmode = function(el, editmode) {
|
||||
value = M.util.get_string('clicktoedit', 'gradingform_guide')
|
||||
taplain.addClass('empty')
|
||||
}
|
||||
taplain.one('.textvalue').set('innerHTML', Y.Escape.html(value))
|
||||
// Replace newlines with <br> tags, when displaying in the page.
|
||||
taplain.one('.textvalue').set('innerHTML', Y.Escape.html(value).replace(/(?:\r\n|\r|\n)/g, '<br>'))
|
||||
if (tb) {
|
||||
tbplain.one('.textvalue').set('innerHTML', Y.Escape.html(tb.get('value')))
|
||||
}
|
||||
|
@ -145,6 +145,10 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
'name' => '{NAME}[criteria][{CRITERION-id}][descriptionmarkers]'));
|
||||
$maxscore = html_writer::tag('div', s($criterion['maxscore']),
|
||||
array('class'=>'criteriondescriptionscore', 'name' => '{NAME}[criteria][{CRITERION-id}][maxscore]'));
|
||||
|
||||
// Retain newlines as <br> tags when displaying the marking guide.
|
||||
$description = nl2br($description);
|
||||
$descriptionmarkers = nl2br($descriptionmarkers);
|
||||
}
|
||||
|
||||
if (isset($criterion['error_description'])) {
|
||||
@ -290,6 +294,8 @@ class gradingform_guide_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$description = s($comment['description']);
|
||||
}
|
||||
// Retain newlines as <br> tags when displaying 'frequently used comments'.
|
||||
$description = nl2br($description);
|
||||
}
|
||||
$descriptionclass = 'description';
|
||||
if (isset($comment['error_description'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user