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

New Web Service mod_feedback_process_page

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3
    • Component/s: Feedback, Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a mod_feedback activity with at least 2 questions (do not use label and info) in two separate pages. You can use numeric or textfields that are easy to include and manage.
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one student user in the course where the feedback is
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. 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. Each responses structure must match your first page items, the responses[x][name] is the name of the input in the form, the responses[x][value] is the value. If you have two questions in the first page you need to add 2 responses structures.

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

      5. Confirm that
        • You receive a response the field jumpto set to 1 (next page), completed is set to false
        • If you go to Moodle web and access with the same student account you will see the values you entered in the curl request in the first page of the feedback.
      6. Now, repeat the same curl request but using page=1, adding $goprevious=1 and changing the responses structures with the ones in the second page
      7. Confirm that you receive a response the field jumpto set to 0 (previous page) and completed is set to false
      8. Then, execute again the first curl request (the one you did first)
      9. And now, execute again the second curl request but removing the goprevious
      10. Check that as response you see that completed is set to true
      11. If you go as teacher to the feedback in Moodle you should see the responses made by the user.
      Show
      Create a mod_feedback activity with at least 2 questions (do not use label and info) in two separate pages. You can use numeric or textfields that are easy to include and manage. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile 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. Each responses structure must match your first page items, the responses [x] [name] is the name of the input in the form, the responses [x] [value] is the value. If you have two questions in the first page you need to add 2 responses structures. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'feedbackid=4&wsfunction=mod_feedback_process_page&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&page=0&responses [0] [name] =numeric_id&responses [0] [value] =1&responses [1] [name] =textfield_id&responses [1] [value] =a’ | python -m "json.tool" Confirm that You receive a response the field jumpto set to 1 (next page), completed is set to false If you go to Moodle web and access with the same student account you will see the values you entered in the curl request in the first page of the feedback. Now, repeat the same curl request but using page=1, adding $goprevious=1 and changing the responses structures with the ones in the second page Confirm that you receive a response the field jumpto set to 0 (previous page) and completed is set to false Then, execute again the first curl request (the one you did first) And now, execute again the second curl request but removing the goprevious Check that as response you see that completed is set to true If you go as teacher to the feedback in Moodle you should see the responses made by the user.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57818-master

      Description

      Processes a jump between pages.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

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