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

core_completion_get_course_completion_status

XMLWordPrintable

    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49313-master
    • 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. Go to the Course -> Course completion settings. Add several different types of conditions (including activity conditions with the one you created before).
      5. Login with the student account, mark as complete one activity
      6. Enable "Mobile services": Plugins ► Web Services ► Mobile
      7. Create a Token for the student :
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. 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' --data 'courseid=4&userid=106&wsfunction=core_completion_get_course_completion_status&wstoken=ffbe3a3002f235bf9d01fd9369e10b66'

      9. Confirm that
        • You can see a list of all the different completion criterias and their current status for the user. You can see also the global completion status for the user in the course, check that the values matches with the information in the web interface (you can use the course completion block to compare results)
        • Create a token for a teacher, request the completion status for the user. You should see the same response than before.
      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. Go to the Course -> Course completion settings. Add several different types of conditions (including activity conditions with the one you created before). 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' --data 'courseid=4&userid=106&wsfunction=core_completion_get_course_completion_status&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' Confirm that You can see a list of all the different completion criterias and their current status for the user. You can see also the global completion status for the user in the course, check that the values matches with the information in the web interface (you can use the course completion block to compare results) Create a token for a teacher, request the completion status for the user. You should see the same response than before.

      Return the completion status for a user in a course

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Jetha Chan Jetha Chan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.