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

Invalid type for the status return parameter in get_course_completion_status

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.9.1
    • 2.9.2
    • Course completion
    • MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-51281-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. Enable and configure completion in other course (you can just enable "self completion" as criteria)
      4. Go to the first course -> Course completion settings. Add a condition "Condition: Completion of other courses" and choose the other course, add also additional rules: Date, Enrolment duration and Course grade (it can be anything)
      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 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' | python -m "json.tool"

      8. 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)
      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. Enable and configure completion in other course (you can just enable "self completion" as criteria) Go to the first course -> Course completion settings. Add a condition "Condition: Completion of other courses" and choose the other course, add also additional rules: Date, Enrolment duration and Course grade (it can be anything) 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 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' | python -m "json.tool" 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)

    Description

      If in a course completion configuration we add a different course as a dependency the response of the function is a link to that course.

      This broke the external description expected response since it currently expects PARAM_TEXT

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Andrew Lyons Andrew Lyons
            Adrian Greeve Adrian Greeve
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Sep/15