improving gradebook performance

improving gradebook performance

by Jeff Graham -
Number of replies: 3
Hi all,

I was thinking this morning of a way to improve the existing gradebook performance, especially on large courses (100+ students). The gradebook performance is nearly unacceptable in these courses. I haven't profiled the performance, but my guess is that the time is mostly due to creating the $grades_by_student array which houses all of the gradebook information after categories, weighting, exceptions, drop the x lowest, etc. This process is repeated even if there has been no new grades, and no changes to the gradebook settings.

If there was a way to cache this object in the database I imagine we could see somewhere around a 50% speed improvement in gradebook performance. The biggest issue I see is determining when the $grades_by_student array needs to be rebuilt. One option, that I don't necessarily like, is to give this option to the instructor; a 'cache grades' option or something similar, the big issue is grades being out of sync if a student were to take a quiz after the grades were last cached. A 'cache grades' would need to be issued after any grade changes; this could be supplemented with nightly cron, but still wouldn't be "live." I imagine there is a better way. My guess is that for most of a course there are many views during periods where the gradebook data has not changed at all.

Storing it shouldn't be a major issue via serialize() and unserialize(). This process would of course need to be done on a course by course basis.

Any ideas?
Average of ratings: -
In reply to Jeff Graham

Re: improving gradebook performance

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Jeff, I've been meaning for ages to get a new Gradebook spec started to capture some of the ideas we've had in the past. The main one is about performance.

See this first very quick draft: http://docs.moodle.org/en/Grades_development

Arab Open University have volunteered to put manpower into this, but I want to make sure that it reflects all the ideas of the community first, and also uses the ideas in Gradebook plus.

Let's continue discussion in the Gradebook forum and on that Moodle Docs page.
In reply to Martin Dougiamas

Re: improving gradebook performance

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
I like and am quite excited about what I read about the changes to the gradebook. Is this something that might be seen as soon as 1.7? The sooner the better. I wonder if it would be helpful to have some grade adjustment fields associated with the grades. I can envision several scenarios where this would be helpful. If there were a field called adjustment, adjustment type, and adjustment comment (perhaps even a separate table linked to the grade id) a teacher could take off 5 points for a late assignment, 10% off of a quiz that a student was allowed to take take, etc. While this can be done manually by the teacher for assignments, on graded work like a quiz it would be difficult to keep track of special adjustments to a grade. I have felt this most with not being able to manually assign a grade to a quiz and the push approach would allow for this but it would be nice if there was the added ability to keep track of it should the quiz need to be regraded. The grade could be pushed and then adjustments added. By default there would be not adjustments but I think allowing for them would open up a great number of options for teachers. Then having a more flexible interface for building exports to be used with other systems would be a tremendous benefit. I continue be impressed with the vision, foresight, and responsiveness of the Moodle community. I don't know if there is a Whose Who of Open Source projects, but I would list Moodle as the number one best project to be a part of.


In reply to Martin Dougiamas

Re: improving gradebook performance

by Ludo (Marc Alier) -
Hi!
In the Universtitat Politecnica de Catalunya http://www.upc.edu we had to
change completelly the gradebook. This was because by regulation grades must be a number within 0 an 10 with one decimal ( the pass grade is allways at 5 )
We handle a separate grades table that feeds from activities grades.
We did also allow to entry grades to activities from the gradebook ( teachers requirement) and used latex to define formulas to calculate the course final grade.
We intend to release and present it during the next spain moodlemoot.
Eloy knows about it (I sended him the code), if you want I can send you our code ( its a lilte dirty in terms of moodle codig regulations) but so far works and out teachers are happy with the change. Maybe can give some ideas.
Cheers
Ludo