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

New Web Service mod_workshop_get_access_information

    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 (do not setup the workshop, just create it with default values)
      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 and teacher 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=14&wsfunction=mod_workshop_get_workshop_access_information&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      6. Now check that the following returned fields: 'canpeerassess', 'cansubmit', 'canview', 'canviewauthornames', 'canviewauthorpublished', 'canviewpublishedsubmissions', 'canexportsubmissions', 'assessingexamplesallowed' are set to true and the rest to false
      7. Execute the same curl request but using the teacher wstoken and check that all the returned fiels are set to true except 'assessingallowed', 'canpeerassess', 'cansubmit', assessingallowed, creatingsubmissionallowed, modifyingsubmissionallowed
      8. Now, as teacher or admin, prohibit some of the workshop capabilities for the studet user and check that the first curl request (the one that uses the student wstoken) returns the capabilities according the changes you did.
      Show
      Create a course with a workshop (do not setup the workshop, just create it with default values) 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 and teacher 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=14&wsfunction=mod_workshop_get_workshop_access_information&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that the following returned fields: 'canpeerassess', 'cansubmit', 'canview', 'canviewauthornames', 'canviewauthorpublished', 'canviewpublishedsubmissions', 'canexportsubmissions', 'assessingexamplesallowed' are set to true and the rest to false Execute the same curl request but using the teacher wstoken and check that all the returned fiels are set to true except 'assessingallowed', 'canpeerassess', 'cansubmit', assessingallowed, creatingsubmissionallowed, modifyingsubmissionallowed Now, as teacher or admin, prohibit some of the workshop capabilities for the studet user and check that the first curl request (the one that uses the student wstoken) returns the capabilities according the changes you did.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59240-master

      Description

      To retrieve the current user status in a given workshop before starting or continuing it. With this information, the app will be able to print the appropriate information regarding the workshop status. It will also return the user capabilities (whether he can submit, per-assess, switch phases, etc..)
      This function will also return the different subplugins used for allocation, assesstment form and for final grading (the app will support only core ones)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Ryan Wyllie
                Integrator:
                Dan Poltawski
                Tester:
                Marina Glancy
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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