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

Add fileurl to mod_assign_get_submissions webservice response parameters

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide

      Testing:

      Use this client: https://gist.github.com/jleyva/c28b4b622a87b93c6d6d
      The curl.php file is here: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/curl.php

      You need a token related to a service, for get a token you need to create a new service, add a shortname to that service (in the database), and add the mod_assign_get_submissions to that service

      To get a token:
      yourmoodle.com/login/token.php?service=ServiceShortname&username=XX&password=YYY

      You should get the token using a teacher account

      1 Create a new course
      2 As the same teacher you used for creating the token, create a new assign (require at least one file on submission) as a student, submit a file
      3 Edit the client.php for adding your custom token and Moodle URL, also the parameters (assignments ids, the id is the mod_assign instance)
      4 Open the script in a browser
      5 Check that you receive all assignment submissions, check that the filepath and fileurls are correctly displayed
      6 Copy the fileurl, append to that url ?token=THE_TOKEN_YOU_GOT_PREVIOUSLY the file should be downloaded

      Show
      Testing: Use this client: https://gist.github.com/jleyva/c28b4b622a87b93c6d6d The curl.php file is here: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/curl.php You need a token related to a service, for get a token you need to create a new service, add a shortname to that service (in the database), and add the mod_assign_get_submissions to that service To get a token: yourmoodle.com/login/token.php?service=ServiceShortname&username=XX&password=YYY You should get the token using a teacher account 1 Create a new course 2 As the same teacher you used for creating the token, create a new assign (require at least one file on submission) as a student, submit a file 3 Edit the client.php for adding your custom token and Moodle URL, also the parameters (assignments ids, the id is the mod_assign instance) 4 Open the script in a browser 5 Check that you receive all assignment submissions, check that the filepath and fileurls are correctly displayed 6 Copy the fileurl, append to that url ?token=THE_TOKEN_YOU_GOT_PREVIOUSLY the file should be downloaded
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      We need the fileurl to be able to download a file, currently, only the filepath is returned in the Webservice.

      Note: this is for the Moodle Mobile app so teachers can download submissions in their tablet/phone

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Damyon Wiese
            Integrator:
            Marina Glancy
            Tester:
            Andrew Davis
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/May/14