Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50930

New Web Service core_completion_mark_course_self_completed

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9, 3.0
    • Fix Version/s: 3.0
    • Component/s: Course completion
    • Labels:
    • Testing Instructions:
      Hide

      Note: Version numbers are bumped because a new web service is added into the Mobile app service

      1. Enable completion in Advanced features
      2. Create a new course, enable completion in the course settings.
      3. Go to the Course completion section in the course settings block
      4. Enable the Manual self completion criteria
      5. Enrol a student in the course
      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 CURL REST call simulating a WS client with the he student user .
        • You need to replace the wstoken, and courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=7&wsfunction=core_completion_mark_course_self_completed&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e'

          Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output

      9. Confirm that
        • You receive as response an array with an status true and 0 warnings
        • In the Course completion report you can see that the user has completed the Self "criteria", if you force the cron job you will see the course marked as completed too.
      Show
      Note: Version numbers are bumped because a new web service is added into the Mobile app service Enable completion in Advanced features Create a new course, enable completion in the course settings. Go to the Course completion section in the course settings block Enable the Manual self completion criteria Enrol a student in the course 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 CURL REST call simulating a WS client with the he student user . You need to replace the wstoken, and courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=7&wsfunction=core_completion_mark_course_self_completed&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output Confirm that You receive as response an array with an status true and 0 warnings In the Course completion report you can see that the user has completed the Self "criteria", if you force the cron job you will see the course marked as completed too.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50930-master

      Description

      This WS will be used for mark a course as self completed by a student

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Simey Lameze
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Jun Pataleta
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              16/Nov/15