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

New Web Service mod_feedback_get_responses_analysis

XMLWordPrintable

    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57821-master
    • Hide
      1. Create or use an existing feedback forced to separate groups with at least two questions in one unique page. It is recommend to use numeric, textfield or textarea questions. The feedback should be anonymous.
      2. Add several students to the course in two different groups.
      3. Override the teacher role so they don't have the accessallgroups capability in the course or in the new feedback activity
      4. Complete the feedback with at least 4 students (2 for each group).
      5. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      6. Create tokens for two teachers (in a different group each one).
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client with the first group teacher 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=16&wsfunction=mod_feedback_get_responses_analysis&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true' | python -m "json.tool"

      8. Confirm that the data returned by the WS match the information in the Show responses tab of the feedback when you are checking it as teacher in Moodle and you only see your student responses. Confirm that in the response you don't see userids (since it is anonymous)
      9. Execute the WS again using the other teacher token, and check that the information match to the one in Moodle.
      10. Repeat the steps above but using a non-anonymous feedback. In the student responeses you should see the user id.
      Show
      Create or use an existing feedback forced to separate groups with at least two questions in one unique page. It is recommend to use numeric, textfield or textarea questions. The feedback should be anonymous. Add several students to the course in two different groups. Override the teacher role so they don't have the accessallgroups capability in the course or in the new feedback activity Complete the feedback with at least 4 students (2 for each group). As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create tokens for two teachers (in a different group each one). Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the first group teacher 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=16&wsfunction=mod_feedback_get_responses_analysis&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true' | python -m "json.tool" Confirm that the data returned by the WS match the information in the Show responses tab of the feedback when you are checking it as teacher in Moodle and you only see your student responses. Confirm that in the response you don't see userids (since it is anonymous) Execute the WS again using the other teacher token, and check that the information match to the one in Moodle. Repeat the steps above but using a non-anonymous feedback. In the student responeses you should see the user id.

      Return the feedback user responses

            jleyva Juan Leyva
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Jun Pataleta Jun Pataleta
            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.