Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29934 Web service API Roadmap
  3. MDL-49314

core_completion_get_activities_completion_status

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Enable completion at site level
      2. Create a course with a student, enable completion in the course settings.
      3. 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.
      4. Login with the student account, mark as complete one activity
      5. Enable "Mobile services": Plugins ► Web Services ► Mobile
      6. Create a Token for the student :
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. 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
          

      8. 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.
      Show
      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 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.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49314-master

      Description

      Returns activities completion status for a user in a course

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15