Hello,
I believe I have found a bug with the latest Totara 2.5.5.
The bug is related to grading a quiz that would cause a course to be complete for a user, when there is more than one other course that has the course as a completion criteria.
Example: Course X and Course Y have Course A as a completion criteria in their completion settings. When you grade a quiz in Course A which would make that course complete, an error is thrown “Found more than one record in fetch() !”.
This error does NOT happen if there is only one course that depends on Course A to be complete in its criteria.
Here are the steps to reproduce.
1) Setup a fresh install of Totara 2.5.5
2) Create a new course “Course A” with Completion enabled.
3) Add 1 quiz to the course with one essay question worth 10 marks. Enable completion tracking for this quiz
4) Edit course completion criteria for the course. Check off the quiz under “Activity Completion”. Set a required course grade of 50 (this might not be required but it’s what I did)
5) Now create another course “Course X” with Completion enabled.
6) Edit Course X’s course completion to inlcude “Coruse A” under “Completion of other courses”
7) Now create a “Course Y”, setup the same way as Course X
8) Enroll a student in all 3 courses
9) Login as the student, and take the quiz in Course A.
10) Now login as an administrator, and view the Quiz
11) Click on Administration ->Results -> Manual Grading
12) Click “grade” under the “To Grade” column where there should be 1 quiz waiting to grade
13) Assign a grade of 10 to the quiz and click “Save and go to next page”
14) You will get a “Found more than one record in fetch() !” error.
I did some digging and I believe the problem lies in the completion_handle_criteria_course_calc() function in /completion/completion_criteria_completion.php.
It appears to expect only 1 criteria which is why it gets an error when there is more than one. The code is fairly complex so I am not positive of a correct fix.
Hope this helps. Hopefully it can be fixed quickly.
As a side note, I don’t believe this bug existed in Totara version 2.5.3, if that helps at all.
--
Jeff King
Envisiontel