mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-60945 Web services: Too many progress records retrieved
The core_completion_get_activities_completion_status was getting the progress for all users on the course called, and then discarding all the records but one. This change ensures that only progress for the user we are interested in is retrieved from the database. This has a side benefit of removing a full table scan from the query finding the users inside the get_progress_all() method.
This commit is contained in:
parent
109aa07648
commit
3acb294828
@ -249,7 +249,7 @@ class core_completion_external extends external_api {
|
||||
|
||||
$completion = new completion_info($course);
|
||||
$activities = $completion->get_activities();
|
||||
$progresses = $completion->get_progress_all();
|
||||
$progresses = $completion->get_progress_all('u.id = :uid', ['uid' => $params['userid']]);
|
||||
$userprogress = $progresses[$user->id];
|
||||
|
||||
$results = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user