-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.3.10, 4.4.6, 4.5.2, 5.0
-
MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
-
mdl-85036_405
-
mdl-85036_500
-
mdl-85036_main
-
-
The class completion_info_exporter doesn't correctly fetch information for the specified user, returning information for the logged in user instead.
Original ticket's description
Hi everyone,
I’m reporting you an issue about the completion related to the webservice "core_completion_get_activities_completion_status". Maybe I misunderstood how it works, but for me the activity restrictions, by group especially, are not processed to calculate a student completion. My Moodle is on version 4.3.10 (Build: 20250210)
- Create a course and set it on Custom section format.
- Add 2 students
- Create 3 sections
- Create 3 pages activities with completion set to with completion set to View the activity
- Create two groups, assign one student to each group
- Go to More > Course completion > Condition: Activity completion and select the 3 activities (ALL selected activities to be completed)
- Add the Course Completion status block to the page
- Put restrictions by group on the second and third sections so Group 1 can view section 2 and Group 2 can see section 3
- Login as a student s1
When we use the web service "core_completion_get_activities_completion_status" it returns you all activities. The web service put the "uservisible" parameter on true even on the activity that the student can't access and can't see.
Concerning the web service if we change the line 56 in the constructor of "completion_info_exporter" by this ↓:
$this->cminfo = \cm_info::create((object)['id' => $cm->id, 'course' => $cm->course], $userid);
It put the "uservisible" parameter on false for the activity that the student can't achieve.
I test on the version 4.5.2 (Build: 20250210), the issue is still here
Thank you for your time and your attention.
Best regards
[EDIT: at the beginning the ticket reported a problem conerning different component of Moodle. So, we focused this ticket only at the web service. But other issues have been reported.
We can see with the block completion_status that the student can’t complete the course because he can’t even access to it. In addition, on the page « My courses » the completion of the course show 50%.
Other related issues have been linked to this ticket.]
- has been marked as being related by
-
MDL-51447 Hidden activities are listed on the completion progress details page
-
- Open
-
-
MDL-60912 Percentage complete in course overview on Dashboard does not consider hidden or blocked activities
-
- Open
-
-
MDL-69352 Exclude modules in course progress which are not visible or available
-
- Open
-