Jeff Graham: assignments duplicated 4 times in gradebook table?

Jeff Graham: assignments duplicated 4 times in gradebook table?

by A. T. Wyatt -
Number of replies: 4
I just downloaded the excel export of my gradebook, and find that my assignments seem to be duplicated 4 times within the gradebook.

This is surely a table problem, although I am not sure how to find the gradebook data that goes with my course.

I checked more than one course, and they all seem to have a similar problem.

I think this has to do with the Gradebook enhancements we installed or it is repeating a set for each category??  I am attaching an example spreadsheet.

Any advice?  Thanks!

atw
In reply to A. T. Wyatt

Re: Jeff Graham: assignments duplicated 4 times in gradebook table?

by Jeff Graham -
Hi A.T. Wyatt,

Not sure what is going on here, but it is indicitave of duplicate  entries in mdl_grade_items. You can check in that table modid and cminstance in pairs should not be duplicated.

You can try the following SQL via the db if you are comfortable with that;
select count(*) as num, courseid, modid, cminstance from mdl_grade_item GROUP BY cminstance, modid ORDER BY num;
If you see entries with a value > 1 in the left column that is what is probably causing your problem.  My guess is you will probably see quite a few entries with '4' as a value. Can you identify what you have done to create this course?

This issue doesn't show up in the gradebook as viewed within moodle though?
In reply to Jeff Graham

Re: Jeff Graham: assignments duplicated 4 times in gradebook table?

by A. T. Wyatt -
We have pretty well established that this happens when using categories.  It only shows up when you export, but I didn't know if the problem was JUST in export (which means there is no problem, because you could just delete the empty columns) or if my tables were wrecked!!  That was what worried me!

We think it goes away when we quit using categories (or, at least, one instructor reported that).  It comes back when the assignments are re-categorized.

I am going to upload an offending course on a different server (one that has only the core install--no enhancements/hacking by yours truly) and see what happens.  I will report back.

atw


Reporting back!  Aha!  It is messed up on a non-hacked Moodle 1.6.2!  That means the problem is with the core.  If you have categories, it exports a lot of duplicates (one set for each category).  If you do NOT have categories, you get one set of grades (because you have one category).

Should I report this as a bug?  Or is this just how it is supposed to work?
In reply to A. T. Wyatt

Re: Jeff Graham: assignments duplicated 4 times in gradebook table?

by Jeff Graham -
Hi AT,

This has been fixed in both versions of gradebookplus_v2. I was finally able to reproduce the error, and it was a categories related issue, but was really just bad code on the text/excel download.

I have completely reworked the text/excel download.

regards,
Jeff
In reply to Jeff Graham

Re: Jeff Graham: assignments duplicated 4 times in gradebook table?

by A. T. Wyatt -
Thank you! I apologize for not posting back that I figured out it had to do with the export, not the tables. We just deleted a lot of columns when we exported the gradebook for archival purposes at mid term and semester finals.

I will look forward to applying the new patches for next semester.

atw