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

New Web Service mod_feedback_process_page

XMLWordPrintable

    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57818-master
    • 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.

      Processes a jump between pages.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.