Best practice forum (Archived)

Totara 2.5.5 error when grading => completion

 
Jeff King
Totara 2.5.5 error when grading => completion
by Jeff King - Monday, 20 January 2014, 4:53 PM
 

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

Ciaran Irvine (Core Developer)
Re: Totara 2.5.5 error when grading => completion
by Ciaran Irvine (Core Developer) - Monday, 20 January 2014, 6:00 PM
 

Hi Jeff,

Thank you so much for the replication instructions - this was reported by another partner last week but we couldn't replicate the problem here. Hopefully with your additional information we'll be able to track this one down and get a fix in as soon as possible.

Jeff King
Re: Totara 2.5.5 error when grading => completion
by Jeff King - Tuesday, 21 January 2014, 9:46 AM
 

Thanks. Let me know if you need any further details on the replication steps. 

Jeff King
Re: Totara 2.5.5 error when grading => completion
by Jeff King - Tuesday, 21 January 2014, 2:03 PM
 

Hi,
I found another way to reproduce this, which also causes completion tracking to not get set properly. Again the error is around the “more than one record in fetch()” issue.

This case is where a person is completing a quiz which when processed would cause the course to show as complete, for a course with more than one other course having it as a completion criteria.
Example: Course X and Y both have Course A under “Completion of other courses” for completion criteria.

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 True/False question worth 10 marks. Enable completion tracking for this quiz “Require grade”
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) When I first attempted to submit the quiz I received a “fetch” error:
An error occurred while processing your responses (Found more than one record in fetch() !). Click continue to return to the page you were on and try again.

More information about this error

Debug info:
Error code: errorprocessingresponses
Stack trace:
line 476 of /lib/setuplib.php: moodle_exception thrown
line 188 of /mod/quiz/processattempt.php: call to print_error()

11) I was then able to re-attempt submitting the quiz, and it worked this time
12) Log in as an administrator and you will see that the quiz is complete for the user (when viewing Quiz results), but there is no checkmark in the completion report for the quiz or the course, event after running CRON

Hope we can find a resolution soon.

Matthew Lee
Re: Totara 2.5.5 error when grading => completion
by Matthew Lee - Thursday, 30 January 2014, 10:35 AM
 

Hi everyone

Is there any update on this bug? Will a fix be coming in next weeks release? We have a customer who is extremely anxious abou this one because they launched a big sales training campaign and results are not tracking properly. They have incentives tied to the program for the sales people, so its making them look bad that they can't track whose complete. Any feedback here would be appreciated.

thanks

Matt

Simon Coggins
Re: Totara 2.5.5 error when grading => completion
by Simon Coggins - Thursday, 30 January 2014, 12:46 PM
Group Totara

Hi Matt,

We have a patch in review but some problems were discovered during testing so we need to work through them.

The next 2.5 release is due on 4th February so we will do everything we can to get the patch in that release. If we are able to get it through testing before then we can send you a patch to apply sooner.

Simon

 

Moises Burgos
Re: Totara 2.5.5 error when grading => completion
by Moises Burgos - Monday, 3 February 2014, 8:16 PM
 

Hi Jeff,

This issue has been fixed in Totara 2.5.7 release. Please let us know if you have any more problems.


Moises