Moodle

CLONE - gradebook doesn't show - please reopen this issue

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Component/s: Administration
  • Labels:
    None
  • Environment:
    All
  • Affected Branches:
    MOODLE_19_STABLE

Description

Original Issue (closed as unable to reproduce): In one of my courses, the gradebook has suddenly disappeared. It shows up as a complete blank page. Other courses seem unaffected (at the moment)

I have a single course where this has occurred. Clicking on Grades in the course administration block leads to a completely blank page - in addition, no assignment submission can be viewed (the page resulting from "show 33 submissions" is also completely blank...).

Blank pages occur for either administrator, course teacher, or others added as teachers.

  1. grade_object.patch
    18/Dec/08 7:17 AM
    4 kB
    John T. Macklin
  2. health.php
    23/Oct/09 8:13 AM
    34 kB
    John T. Macklin

Issue Links

Activity

Hide
John T. Macklin added a comment -

Any attempts to access grades from this course results in:
Fatal error: Call to undefined method stdClass::generate_grades() in var/www/html/lib/grade/grade_item.php on line 658

In most of my recent tests I have discovered that the issue was caused by dupicate grade category item in this case
you can easily see in mdl_grade_items.id=34013, iteminstance=10182, itemtype='category' does not exist within courseid=8759
After removing the bogus id from mdl_grade_items the Gradebook then becomes operational.

mysql> select * from mdl_grade_categories where courseid=8759;
---------------------------------------------------------------------------------------------------------------------------------------------------------+

id courseid parent depth path fullname aggregation keephigh droplow aggregateonlygraded aggregateoutcomes aggregatesubcats timecreated timemodified

---------------------------------------------------------------------------------------------------------------------------------------------------------+

2213 8759 NULL 1 /2213/ ? 10 0 0 0 0 0 1219100492 1229371179
10176 8759 2213 2 /2213/10176/ Exam 1 11 0 0 1 0 0 1229371157 1229371158
10178 8759 2213 2 /2213/10178/ Exam 2 11 0 0 1 0 0 1229371168 1229371168
10179 8759 2213 2 /2213/10179/ Short Paper 11 0 0 1 0 0 1229371178 1229371178
10180 8759 2213 2 /2213/10180/ Research Paper 11 0 0 1 0 0 1229371193 1229371211

---------------------------------------------------------------------------------------------------------------------------------------------------------+

mysql> select * from mdl_grade_items where courseid=8759;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

id courseid categoryid itemname itemtype itemmodule iteminstance itemnumber iteminfo idnumber calculation gradetype grademax grademin scaleid outcomeid gradepass multfactor plusfactor aggregationcoef sortorder display decimals hidden locked locktime needsupdate timecreated timemodified

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

10242 8759 NULL NULL course NULL 2213 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 1 0 NULL 0 0 0 0 1219100492 1219100492
26007 8759 10176 Exam 1 mod assignment 12110 0 NULL 104917 NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 6 0 NULL 0 0 0 0 1223489110 1229372318
27995 8759 10178 Exam 2 mod assignment 12738 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 8 0 NULL 0 0 0 0 1225718682 1229397647
32322 8759 2213 Vital Signs Paper mod assignment 14007 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 2 0 NULL 0 0 0 0 1228835636 1229530921
34005 8759 NULL NULL category NULL 10176 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 5 0 NULL 0 0 0 0 1229371157 1229372296
33698 8759 2213 Final Exam mod assignment 14234 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 3 0 NULL 0 0 0 0 1229353614 1229395053
33714 8759 2213 Participation mod assignment 14236 0 NULL 124872 NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 4 0 NULL 0 0 0 0 1229358140 1229372296
34007 8759 NULL NULL category NULL 10178 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 7 0 NULL 0 0 0 0 1229371168 1229372318
34008 8759 NULL NULL category NULL 10179 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 9 0 NULL 0 0 0 0 1229371178 1229372340
34009 8759 NULL NULL category NULL 10180 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 10 0 NULL 0 0 0 0 1229371193 1229372341
34013 8759 NULL NULL category NULL 10182 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 11 0 NULL 0 0 0 0 1229371357 1229372362

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 rows in set (0.00 sec)

The file grade_object.patch is one suggested way of dealing with this issue!

Show
John T. Macklin added a comment - Any attempts to access grades from this course results in: Fatal error: Call to undefined method stdClass::generate_grades() in var/www/html/lib/grade/grade_item.php on line 658 In most of my recent tests I have discovered that the issue was caused by dupicate grade category item in this case you can easily see in mdl_grade_items.id=34013, iteminstance=10182, itemtype='category' does not exist within courseid=8759 After removing the bogus id from mdl_grade_items the Gradebook then becomes operational. mysql> select * from mdl_grade_categories where courseid=8759; ---------------------------------------------------------------------------------------------------------------------------------------------------------+
id courseid parent depth path fullname aggregation keephigh droplow aggregateonlygraded aggregateoutcomes aggregatesubcats timecreated timemodified
---------------------------------------------------------------------------------------------------------------------------------------------------------+
2213 8759 NULL 1 /2213/ ? 10 0 0 0 0 0 1219100492 1229371179
10176 8759 2213 2 /2213/10176/ Exam 1 11 0 0 1 0 0 1229371157 1229371158
10178 8759 2213 2 /2213/10178/ Exam 2 11 0 0 1 0 0 1229371168 1229371168
10179 8759 2213 2 /2213/10179/ Short Paper 11 0 0 1 0 0 1229371178 1229371178
10180 8759 2213 2 /2213/10180/ Research Paper 11 0 0 1 0 0 1229371193 1229371211
---------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql> select * from mdl_grade_items where courseid=8759; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id courseid categoryid itemname itemtype itemmodule iteminstance itemnumber iteminfo idnumber calculation gradetype grademax grademin scaleid outcomeid gradepass multfactor plusfactor aggregationcoef sortorder display decimals hidden locked locktime needsupdate timecreated timemodified
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10242 8759 NULL NULL course NULL 2213 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 1 0 NULL 0 0 0 0 1219100492 1219100492
26007 8759 10176 Exam 1 mod assignment 12110 0 NULL 104917 NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 6 0 NULL 0 0 0 0 1223489110 1229372318
27995 8759 10178 Exam 2 mod assignment 12738 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 8 0 NULL 0 0 0 0 1225718682 1229397647
32322 8759 2213 Vital Signs Paper mod assignment 14007 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 2 0 NULL 0 0 0 0 1228835636 1229530921
34005 8759 NULL NULL category NULL 10176 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 5 0 NULL 0 0 0 0 1229371157 1229372296
33698 8759 2213 Final Exam mod assignment 14234 0 NULL   NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 3 0 NULL 0 0 0 0 1229353614 1229395053
33714 8759 2213 Participation mod assignment 14236 0 NULL 124872 NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 4 0 NULL 0 0 0 0 1229358140 1229372296
34007 8759 NULL NULL category NULL 10178 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 7 0 NULL 0 0 0 0 1229371168 1229372318
34008 8759 NULL NULL category NULL 10179 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 9 0 NULL 0 0 0 0 1229371178 1229372340
34009 8759 NULL NULL category NULL 10180 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 10 0 NULL 0 0 0 0 1229371193 1229372341
34013 8759 NULL NULL category NULL 10182 NULL NULL NULL NULL 1 100.00000 0.00000 NULL NULL 0.00000 1.00000 0.00000 0.00000 11 0 NULL 0 0 0 0 1229371357 1229372362
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11 rows in set (0.00 sec) The file grade_object.patch is one suggested way of dealing with this issue!
Hide
John T. Macklin added a comment -

One Suggested method of resolution ...

Show
John T. Macklin added a comment - One Suggested method of resolution ...
Hide
John T. Macklin added a comment -

Seems to be related to issue 10636

Show
John T. Macklin added a comment - Seems to be related to issue 10636
Hide
John T. Macklin added a comment -

Have recently came across this issue again in a Moodle 1.9.3 Site which caused viewing of the Grader Report to fail with
error "Found more than one record in fetch ()" but this time with a bit of a different twist.

When analyzing the mdl_grade_items table we discovered there were multiple entries for itemtype='course'
for a given courseid. Item instances seemed to also be duplicated for itemtype='course' where
itemtype='course' and courseid=# of our problem course.

As a result I did add some cleanup to the existing health.php script.

The cleanup for itemtype='course' can be called specifically via http://mysite.edu/admin/health.php?solution=problem_000014

?solution=problem_000014, ?solution=problem_000015 and ?solution=problem_000016 deal with Duplicate Grade Item table issues.

Placing this info here for those whom simply don't want to upgrade their site but rather fix and then clean up the mess in the Grade Items table first. Personally after upgrading to Moodle 1.9.5+ I have not seen this issue on my own site.

Show
John T. Macklin added a comment - Have recently came across this issue again in a Moodle 1.9.3 Site which caused viewing of the Grader Report to fail with error "Found more than one record in fetch ()" but this time with a bit of a different twist. When analyzing the mdl_grade_items table we discovered there were multiple entries for itemtype='course' for a given courseid. Item instances seemed to also be duplicated for itemtype='course' where itemtype='course' and courseid=# of our problem course. As a result I did add some cleanup to the existing health.php script. The cleanup for itemtype='course' can be called specifically via http://mysite.edu/admin/health.php?solution=problem_000014 ?solution=problem_000014, ?solution=problem_000015 and ?solution=problem_000016 deal with Duplicate Grade Item table issues. Placing this info here for those whom simply don't want to upgrade their site but rather fix and then clean up the mess in the Grade Items table first. Personally after upgrading to Moodle 1.9.5+ I have not seen this issue on my own site.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: