MDL-83856 gradingform_guide: fix remark format to always be FORMAT_HTML
This commit is contained in:
+1
-1
@@ -203,7 +203,7 @@ class fetch extends external_api {
|
||||
$definitionid,
|
||||
'remark',
|
||||
$filling['remark'],
|
||||
(int) $filling['remarkformat']
|
||||
(int) FORMAT_HTML
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -857,16 +857,19 @@ class gradingform_guide_instance extends gradingform_instance {
|
||||
parent::update($data);
|
||||
|
||||
foreach ($data['criteria'] as $criterionid => $record) {
|
||||
// Hardcoding/defaulting to html format for new/existing record
|
||||
$record['remarkformat'] = FORMAT_HTML;
|
||||
|
||||
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
|
||||
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
|
||||
'score' => $record['score'], 'remarkformat' => FORMAT_MOODLE);
|
||||
'score' => $record['score'], 'remarkformat' => $record['remarkformat']);
|
||||
if (isset($record['remark'])) {
|
||||
$newrecord['remark'] = $record['remark'];
|
||||
}
|
||||
$DB->insert_record('gradingform_guide_fillings', $newrecord);
|
||||
} else {
|
||||
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
|
||||
foreach (array('score', 'remark'/*, 'remarkformat' TODO */) as $key) {
|
||||
foreach (array('score', 'remark', 'remarkformat') as $key) {
|
||||
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
|
||||
$newrecord[$key] = $record[$key];
|
||||
}
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ class fetch extends external_api {
|
||||
$definitionid,
|
||||
'remark',
|
||||
$filling['remark'],
|
||||
(int) $filling['remarkformat']
|
||||
(int) FORMAT_HTML
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -863,16 +863,19 @@ class gradingform_rubric_instance extends gradingform_instance {
|
||||
$currentgrade = $this->get_rubric_filling();
|
||||
parent::update($data);
|
||||
foreach ($data['criteria'] as $criterionid => $record) {
|
||||
// Hardcoding/defaulting to html format for new/existing record
|
||||
$record['remarkformat'] = FORMAT_HTML;
|
||||
|
||||
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
|
||||
$newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
|
||||
'levelid' => $record['levelid'], 'remarkformat' => FORMAT_MOODLE);
|
||||
'levelid' => $record['levelid'], 'remarkformat' => $record['remarkformat']);
|
||||
if (isset($record['remark'])) {
|
||||
$newrecord['remark'] = $record['remark'];
|
||||
}
|
||||
$DB->insert_record('gradingform_rubric_fillings', $newrecord);
|
||||
} else {
|
||||
$newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
|
||||
foreach (array('levelid', 'remark'/*, 'remarkformat' */) as $key) {
|
||||
foreach (array('levelid', 'remark', 'remarkformat') as $key) {
|
||||
// TODO MDL-31235 format is not supported yet
|
||||
if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
|
||||
$newrecord[$key] = $record[$key];
|
||||
|
||||
Reference in New Issue
Block a user