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

Add enddate to WebServices returning course information

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with an start and end date
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one student in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the student token.
        • You need to replace the wstoken, and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_course_get_courses_by_field&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      5. Now check that:
        • The student receive correctly the list of courses in the site where he is enrolled and the startdate and enddate values match the ones for the course.
      6. Now, execute the following curl request (replacing userid with the student user id)

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&userid=136
        8&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      7. Check that:
        • The student receive correctly the list of courses where he is enrolled and the startdate and enddate values match the ones for the course.
      Show
      Create a course with an start and end date As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one student in the course: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student token. You need to replace the wstoken, and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_course_get_courses_by_field&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Now check that: The student receive correctly the list of courses in the site where he is enrolled and the startdate and enddate values match the ones for the course. Now, execute the following curl request (replacing userid with the student user id) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&userid=136 8&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Check that: The student receive correctly the list of courses where he is enrolled and the startdate and enddate values match the ones for the course.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58659-master

      Description

      In some web services the end date was not added (like get_courses_by_field) and for being able to print the new overview in the Mobile app we'll require the start and end date in the core_enrol_get_users_courses.

      We consider this as a bug, because when the enddate was added (or when the WS was created) this field should've been added.

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Pau Ferrer
            Integrator:
            Jake Dallimore
            Tester:
            Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/May/17