-
Bug
-
Resolution: Fixed
-
Trivial
-
2.1.4, 2.2.1, 2.3
-
None
-
MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
Easy
-
Currently, the finish_attempt() function updates the quiz grade for the currently logged in user ($USER) no matter whose quiz attempt is being finished. The cause is the following line:
quiz_save_best_grade($this->get_quiz());
As a result, the finished attempt grade is never pushed to the gradebook. It would make more sense for finish_attempt() to update the grade for the user whose quiz attempt is being closed, a la:
quiz_save_best_grade($this->get_quiz(), $this->attempt->userid);
As far as I know, this does't currently cause issues in the Moodle core code, because Quiz attempts are always submitted by the owning user. Plugins which use question_usage_by_activity are affected; and this will likely cause issues with MDL-3030, when that comes to fruition.