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

Implement the check_updates callback in the feedback module

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3
    • Component/s: Feedback
    • Labels:
    • Testing Instructions:
      Hide
      1. Calculate your current timestamp (www.unixtimestamp.com)
      2. Create a feedback activity with at least two pages (one question in each page)
      3. Create a feedback activity with just one page and one question
      4. As student, complete the feedback that has one page, and start the feedback with two pages (without completing it, you will have to reply the questions in the first page and click next page).
      5. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      6. Create a Token in the mobile app service for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseid, the since parameter (with the timestamp you calculated), the tocheck[0][id] with the feedback cmdi and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=17&tocheck[0][contextlevel]=module&tocheck[0][id]=367&tocheck[0][since]=1479575320&wsfunction=core_course_check_updates&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      8. Check that you receive the following updates for the module set to true: attemptsunfinished and attemptsfinished
      Show
      Calculate your current timestamp (www.unixtimestamp.com) Create a feedback activity with at least two pages (one question in each page) Create a feedback activity with just one page and one question As student, complete the feedback that has one page, and start the feedback with two pages (without completing it, you will have to reply the questions in the first page and click next page). As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, courseid, the since parameter (with the timestamp you calculated), the tocheck [0] [id] with the feedback cmdi and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=17&tocheck [0] [contextlevel] =module&tocheck [0] [id] =367&tocheck [0] [since] =1479575320&wsfunction=core_course_check_updates&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Check that you receive the following updates for the module set to true: attemptsunfinished and attemptsfinished
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57823-master

      Description

      We need this callback so the mobile app is able to check for updates in the feedback module in order to update the download/update status of the activity in the course.

        Attachments

          Activity

            People

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

              Dates

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