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

Assignment plugins should handle which configuration values return to Web Services

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a new course with an assignment, enable and fill all the possible Submission types and Feedback types settings
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=11&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=mod_assign_get_assignments&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      5. Confirm that the WS returns all the submission and feedback subplugin settings in a config field with the correct values (the same you entered in the web interface)
      6. If you disable any of the submission or feedback plugins, the settings shouldn't be returned by the curl request.
      Show
      Create a new course with an assignment, enable and fill all the possible Submission types and Feedback types settings As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=11&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=mod_assign_get_assignments&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Confirm that the WS returns all the submission and feedback subplugin settings in a config field with the correct values (the same you entered in the web interface) If you disable any of the submission or feedback plugins, the settings shouldn't be returned by the curl request.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55129-master

      Description

      Right now in the get_assignments WS all the settings for assignment plugins (submission and feedback) are returned, this is bad because:

      • It is returning settings for plugins that may not be enabled
      • It is returning settings that would be a security risk (a third party plugin including a password or credentials for connecting a remote site)
      • Some values are returned "raw" without further processing, for example, maxsubmissionsizebytes returns 0 when using the plugin default value instead a valid size
      • Assignment plugins right now implement an API for communication with the external API, see for example: get_external_parameters, it doesn't make sense have an API for the received parameters and not the returned data.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16