Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7
-
Fix Version/s: 1.9
-
Component/s: Gradebook
-
Labels:None
-
Environment:Moodle 1.7, PHP Version 5.1.2, MySQL 5.0.18, Redhat Linux Enterprise 4
-
Database:MySQL
-
Affected Branches:MOODLE_17_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
When viewing the gradebook for a course within Moodle, the following errors appear when PHP debugging is turned to "developer".
Error: Invalid context creation request for level "50", instance "".
Error: Invalid context creation request for level "50", instance "".
With the original user, a message saying "No grades available" appeared (I'm double checking for the exact wording). With a test user on the same course, I get the same error messages, but then a gradebook roster.
The course in question has 13 off-line assignments associated with it. The dates for these assignments are mostly in the past, as the faculty member has not set dates for them yet.
The faculty member does not have this problem with other courses. To test this, I created a new course, added an assignment, and had him look at the gradebook – the error did not appear.
The same error does not appear when logged in as a site-wide administrator (but does appear when a user is assigned the roles of teacher and admin for the same course).
We've figured out the error: it only occurs if the user has created an assignment, and then hidden it. In the example case, the faculty member had created 13 assignments, and hidden all of them.
With everything hidden, the "invalid context creation request" error appeared and the grade book displayed its message "no grades available".
When one of the assignments was unhidden, the error message disappeared, and the gradebook reappeared. I don't know the Moodle code or database well enough yet to trouble shoot this, but it seems like something is going wonky with the MySQL query not looking for hidden assignments.
It seems that the gradebook should appear regardless of whether there are any grades in it, since an unhidden assignment with no grades will cause the gradebook to appear, or am I not understanding the intention here?