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

New Web Service mod_workshop_get_user_plan

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with a workshop
      2. Enrol a couple of users as teacher and student in that course
      3. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token in the mobile app service for the student in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student.
        • You need to replace the wstoken with the student one, workshopid (workshop instance id) and the URL of your moodle instance

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

      6. Now check that the returned data match with the user planner (the table with four columns displayed at the top of the workshop module)
      7. You will see that information for all the 5 phases is returned
      8. The first phase must be marked as active (field active set to true)
      9. Now, as teacher, switch to the following phase (adding the missing required data in the first phase)
      10. Execute the same curl request and check that the phase active now is the second one in the curl response
      11. Now, execute the same curl request but using the teacher wstoken and check that in the second phase tasks field you see the same tasks listed that are listed in the web interface
      12. Now, execute the same curl request but appending userid=STUDENT_USER_ID and check that you retrieve the user plan of the specified user: you can compare the curl response of this request with the same response of the same request using the student wstoken (they should be the same).
      Show
      Create a course with a workshop Enrol a couple of users as teacher and student in that course Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for the 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. You need to replace the wstoken with the student one, workshopid (workshop instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'workshopid=9&wsfunction=mod_workshop_get_user_plan&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that the returned data match with the user planner (the table with four columns displayed at the top of the workshop module) You will see that information for all the 5 phases is returned The first phase must be marked as active (field active set to true) Now, as teacher, switch to the following phase (adding the missing required data in the first phase) Execute the same curl request and check that the phase active now is the second one in the curl response Now, execute the same curl request but using the teacher wstoken and check that in the second phase tasks field you see the same tasks listed that are listed in the web interface Now, execute the same curl request but appending userid=STUDENT_USER_ID and check that you retrieve the user plan of the specified user: you can compare the curl response of this request with the same response of the same request using the student wstoken (they should be the same).
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59268-master

      Description

      Return the planner information for the given user

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Ryan Wyllie
              Integrator:
              Dan Poltawski
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17