tricky sql problem in development of quiz reports for Moodle 2.0

Re: tricky sql problem in development of quiz reports for Moodle 2.0

by Jamie Pratt -
Number of replies: 0
Plus... it's only a report, why do you need to do this all at once? There's no big performance issue is there?

I want to avoid having to load all the grades from the newest graded states into memory to do the calculation. There are a lot of calculations on the same page, I managed to do most of the calculations in sql without loading grades into memory but I can see no way of doing the sum for this calculation in sql because it is not possible to sort two columns independently in sql.

I don't think it is that important to do this in sql. Instead we may, IF the calculation takes a long time for a large data set, cache the results of the calculations, and have an indication of when the stats where last calculated and a recalculate now button on the report.