-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.7, 2.8.3
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
wip_
MDL-49327_2.9_guide_getinstance -
When $instanceid is zero, the get_or_create_instance() function tries to find an existing marking guide instance for the specified $raterid and $itemid in DB, but it doesn't check the definitionid (note: the definition is attached to gradeable area which is attached to a context).
Unfortunately there is no way to reproduce this bug, because only Assignment supports AGM for now. In order you are need at least two activity modules with AGM support and define the guide in both of it. Furthermore, these modules must use the same $itemid during grading. After that, you are need to grade the submission in first module. Then, during grading the submission in second module, the guide form will be filled with the values of first module form. It happens because the get_or_create_instance() function just took the first record it found ignoring the definitionid though the definitionid is only field which represents the context there (see note above).
How it's done in guide (works incorrectly):
if ($rs = $DB->get_records('grading_instances', array('raterid' => $raterid, 'itemid' => $itemid), |
'timemodified DESC', '*', 0, 1)) { |
...
|
How it's done in rubric (works correctly):
$params = array('definitionid' => $this->definition->id, 'raterid' => $raterid, 'itemid' => $itemid); |
if ($rs = $DB->get_records('grading_instances', $params, 'timemodified DESC', '*', 0, 1)) { |