b746bcd186
Currently, large courses can take a long time to perform a full regrade. This is currently handled with a progress bar to prevent frontend timeouts while the regrade takes place. However, because it can take so long a teacher may not want to wait with the page open for several minutes, particularly if they are performing several operations that trigger a regrade. This adds a new async flag to grade_regrade_final_grades which is true by default. Instead of performing the regrade immediately, this queues an instance of \core\task\regrade_final_grades for the course, which will be executed in the background. It is advisable to always leave the async flag set true, except in the following scenarios: - Automated tests. - The regrade_final_grades task which actually wants to do the calculations immediately. - When you have performed a check to determine that the regrade process is unlikely to take a long time, for example there are only a small number of grade items.