drachels / moodle-mod_mootyper

4 stars 18 forks source link

High delay in large courses #125

Open davidherney opened 2 months ago

davidherney commented 2 months ago

Hi @drachels ...

Why are all users' grades updated when no "Aggregate type" is defined in the activity settings? This causes a course to take more than 4 minutes each time a new user goes to make an attempt. The course has 400 students.

I think that in line 147 of the gcnext.php file the user id is missing, is it possible that this is a mistake or is it intentional?

The time is exponentially reduced if I change it:

} else {
    // Otherwise, place a whole grade into the mdl_grade_items table.
    mootyper_update_grades($mootyper);
}

... like this:

} else {
    // Otherwise, place a whole grade into the mdl_grade_items table.
    mootyper_update_grades($mootyper, $record->userid);
}

I appreciate your comments on this.

Gracias

Saludos

drachels commented 2 months ago

Hi David, I think you are probably right. I will do some testing and checking on it plus a deprecated item in that same file, that I just discovered.

drachels commented 2 months ago

Your suggested change along with a bunch of others are now in the master branch. It will be a few days before I publish a new version as I need to check all the changes I just made to make sure they work with the new upcoming Moodle 4.5 code.