"Nothing to display" on quiz with 20 attempts - Moodle 1.9

"Nothing to display" on quiz with 20 attempts - Moodle 1.9

by Toan Tran -
Number of replies: 3
We are using Moodle version 1.9.  On one of the quizzes with 20 attempts, the Overview screen shows "Nothing to display" where the attempt list should be.    Other quizzes display properly.

Has anyone encountered this issue that can provide some insight and/or workaround?

Thanks

Toan

Attachment Capture.JPG
Average of ratings: Useful (1)
In reply to Toan Tran

Re: "Nothing to display" on quiz with 20 attempts - Moodle 1.9

by Toan Tran -

After a bit of Googling, I found that the code has to do with newer versions of mySQL throwing this error on older versions of Moodle.

The fix was changing /mod/quiz/report/overview/report.php as follows (note the two casts as signed):

Before:
            $select .= 'qa.uniqueid AS attemptuniqueid, qa.id AS attempt, ' .
                    'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, ' .
                    'qa.sumgrades, qa.timefinish, qa.timestart, qa.timefinish - qa.timestart AS duration ';

After:
            $select .= 'qa.uniqueid AS attemptuniqueid, qa.id AS attempt, ' .
                    'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, ' .
                    'qa.sumgrades, qa.timefinish, qa.timestart, CAST(qa.timefinish AS SIGNED) - CAST(qa.timestart AS SIGNED) AS duration ';


Just in case someone else runs into the same issue.


Average of ratings: Useful (3)
In reply to Toan Tran

Re: "Nothing to display" on quiz with 20 attempts - Moodle 1.9

by Martín Echegaray -

Perfect Toan Tran!

Worked fine for us.

Thank you!