Commit a1924752 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1625380: Stopping an annotation being set to another standard



If the annotation has feedback and/or assessment set to something
other than 'begun'

behatnotneeded

Change-Id: I1a97e91c453628d1f79a09ef8ee588ac1829f163
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 70a3b094)
parent 982ada76
......@@ -250,7 +250,14 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
'options' => array(),
);
foreach ($standard->options as $option) {
$selectoptions[$standard->id]['options'][$option->id] = $option->name;
// We are not allowed to change standard if either the assement has changed
// from initial state and/or there is feedback on the annotation
if ($evidence && $evidence->element && ((int) $evidence->state !== Framework::EVIDENCE_BEGUN || $textreadonly)) {
$selectoptions[$standard->id]['options'][$option->id] = array('value' => $option->name, 'disabled' => (!($evidence->element == $option->id)));
}
else {
$selectoptions[$standard->id]['options'][$option->id] = $option->name;
}
$selectdescriptions[$option->id] = $option->description;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment