Review Certificate taking 20-40 seconds

Review Certificate taking 20-40 seconds

by Jay S -
Number of replies: 2
The more students who have received a certificate, the more time it takes to review a certificate.

5 seconds 1 completed user
17 seconds 17 completed users
26 seconds 380 completed users

I have ,looked around, not been able to find a similar problem

BTW
Moodle 1.8

Average of ratings: -
In reply to Jay S

Re: Review Certificate taking 20-40 seconds

by Jay S -

The problem is with the certificate_get_course_grade function from certificate/lib.php. This function gets all the grades for all the users of a course. When a user visits the certificate page, view.php, this function is called. This is why it was taking so long.

 

The solution will not be ideal if a future course requires a grade on the certificate, and theres over a hundred students. If this happens, modifications to the certificate_get_course_grade function will be needed.

 

The modification:

 

Page: mod/certificate/type/landscape/certificate.php
Line: 32
Added:
if($certificate->requiredgrade)
{

grade code...

}

In reply to Jay S

Re: Review Certificate taking 20-40 seconds

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Jason,

that function has been removed from the 1.9 version of the certificate module, and some scalability work has been done to improve it.... when you upgrade to Moodle 1.9 - make sure you get the updated Certificate Module as well!