moodle-mod_tincanlaunch
moodle-mod_tincanlaunch copied to clipboard
Completion cron should only download new statements since the last time the task ran
Currently the completion cron queries the LRS once for each learner/module instance combination.
#126 seeks to improve this behavior by only requesting statements once per module. However, if there were a course with many students (over 100, for example) or there are many xAPI Launch Link modules, there could still be some performance issues.
An option for further enhancement would be to leverage the since
query parameter and download all statements matching completed
or voided
since the last time it checked then iterate through the statements to update the student records.
Ideally, this would collect all the statements in the response (continuing to query the LRS for more statements until there are no more). Then all modules and users could be updated from this response by matching up actor and activity information. Depending on the interval that cron runs on, this could potentially update all modules and users with just a handful of requests allowing this to scale much better for environments with many modules or users.