Details
-
Sub-task
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.8.3
-
MOODLE_28_STABLE
-
MOODLE_29_STABLE
-
MDL-49314-master -
Hide
Note: Version number is bumped because a new web service is added into the Mobile app service.
- Enable completion at site level
- Create a course with a student, enable completion in the course settings.
- Create a couple of activities or resources, enable "Manually completion" for those activities, create another activity with a different type of completion. Create another one with completion disabled.
- Login with the student account, mark as complete one activity
- Enable "Mobile services": Plugins ► Web Services ► Mobile
- Create a Token for the student :
- Click on Site administration ► Plugins ► Web services ► Manage tokens
- Next, you can do a couple of CURL REST call simulating a WS client with the student user .
- You need to replace the wstoken, courseid and userid and the URL of your moodle instance
curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseid=4&userid=106&wsfunction=core_completion_get_activities_completion_status&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed
- You need to replace the wstoken, courseid and userid and the URL of your moodle instance
- Confirm that
- You can see a list of activities, only those ones with completion enabled. You see the completion state for every activity and is correct. You also see the tracking mode (auto/manual) correctly)
- Create a token for a teacher, execute the same curl call. as a teacher you must see the user completion status.
ShowNote: Version number is bumped because a new web service is added into the Mobile app service. Enable completion at site level Create a course with a student, enable completion in the course settings. Create a couple of activities or resources, enable "Manually completion" for those activities, create another activity with a different type of completion. Create another one with completion disabled. Login with the student account, mark as complete one activity Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student : Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the student user . You need to replace the wstoken, courseid and userid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseid=4&userid=106&wsfunction=core_completion_get_activities_completion_status&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that You can see a list of activities, only those ones with completion enabled. You see the completion state for every activity and is correct. You also see the tracking mode (auto/manual) correctly) Create a token for a teacher, execute the same curl call. as a teacher you must see the user completion status.
Description
Returns activities completion status for a user in a course
Attachments
Issue Links
- blocks
-
MDL-49313 core_completion_get_course_completion_status
-
- Closed
-