Details
Description
The quiz report generates an SQL error for courses which do not have any students enrolled in them. Asking for a report first generate a PHP error at line 297 of mod/quiz/report/overview/report.php because the array_keys method does not return an array. The empty $students variable then causes a bad SQL query to be generated. I have not looked at the code to figure out how to fix it but adding a student to the course fixes the problem. Presumably what is needed is a quick check for at least one student in the course to be inserted somewhere appropriate.
I would regard this as a low priority bug because it really only affects developers but may cause new users worry if they try a moodle quiz for the first time before any students are added.