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

Several bug fixes in the new feedback web services

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a mod_feedback activity with at least 2 multi choice question types in two separate pages. In the last page add as last item a page break.
      2. Add a time access restriction, for example, a future date.
      3. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token for one student user in the course where the feedback is
        • 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 user .
        • You need to replace the wstoken, feedbackid (the feedback instance value) and the URL of your moodle instance

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

      6. Confirm that
        • You receive a list with all the questions that you have created in the feedback, including the pagebreak.
      7. Now (to test the next 2 fixes), remove the feedback time restriction.
      8. Execute the following curl request and check that you don't get any error in the response.

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedbackid=14&wsfunction=mod_feedback_process_page&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&page=1

      9. Finally, to test the last bug, execute the following curl request (replace multichoice_id with multichoice_THE_QUESTION_ID, for example, multichoice_12)

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedback=4&wsfunction=mod_feedback_process_page&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&page=0&responses[0][name]=multichoice_id[0]&responses[0][value]=1’ | python -m "json.tool"

      Show
      Create a mod_feedback activity with at least 2 multi choice question types in two separate pages. In the last page add as last item a page break. Add a time access restriction, for example, a future date. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for one student user in the course where the feedback is Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user . You need to replace the wstoken, feedbackid (the feedback instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedbackid=14&wsfunction=mod_feedback_get_items&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that You receive a list with all the questions that you have created in the feedback, including the pagebreak. Now (to test the next 2 fixes), remove the feedback time restriction. Execute the following curl request and check that you don't get any error in the response. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedbackid=14&wsfunction=mod_feedback_process_page&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&page=1 Finally, to test the last bug, execute the following curl request (replace multichoice_id with multichoice_THE_QUESTION_ID, for example, multichoice_12) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedback=4&wsfunction=mod_feedback_process_page&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&page=0&responses [0] [name] =multichoice_id [0] &responses [0] [value] =1’ | python -m "json.tool"
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58412-master

      Description

      During implementation and testing we have detected some issues in Web Services already integrated that needs fixing.

      There are several commits every one describing the issue fixed.

        Attachments

          Activity

            People

            • Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Jake Dallimore
              Tester:
              Pau Ferrer
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Juan Leyva, Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

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