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

New Web Service mod_feedback_get_last_completed

    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 or use an existing feedback (configured to not be anonymous) with at least two questions in one unique page.
      2. Complete the feedback with one student account.
      3. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token for the student user.
        • 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=12&wsfunction=mod_feedback_get_last_completed&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      1. Confirm that you receive an structure that match the completion record for the user in the database (feedback_completed table)
      2. Using a WS Token for a student that didn't complete the feedback, execute the curl request, you should get a not_completed_yet exception
      3. Create a new feedback configured to be anonymous
      4. Take the feedback again with a student user account
      5. Execute the curl request using the new student user WS token and feedback id and check that you receive an "anonymous" exception
      6. If you execute again the curl request using a wstoken of a user who didn't complete the feedback you will get the same exception "anonymous"
      Show
      Create or use an existing feedback (configured to not be anonymous) with at least two questions in one unique page. Complete the feedback with one student account. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for the student user. 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=12&wsfunction=mod_feedback_get_last_completed&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that you receive an structure that match the completion record for the user in the database (feedback_completed table) Using a WS Token for a student that didn't complete the feedback, execute the curl request, you should get a not_completed_yet exception Create a new feedback configured to be anonymous Take the feedback again with a student user account Execute the curl request using the new student user WS token and feedback id and check that you receive an "anonymous" exception If you execute again the curl request using a wstoken of a user who didn't complete the feedback you will get the same exception "anonymous"
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57813-master

      Description

      Return the last feedback completed by the user (empty for anonymous)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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