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

Implement the check_updates callback in the workshop module

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide
      1. Calculate the current timestamp https://www.unixtimestamp.com/
      2. Create a course with a workshop
      3. Enrol a couple users as student (student2 and student1) and one user as teacher
      4. Edit the workshop assessment form creating only two evaluable comments
      5. As teacher, move the workshop to the submission phase (doing all the required configuration steps indicated by the activity)
      6. As the two students, do a submission (total of 2 submissions, one per sstudent).
      7. As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa.
      8. As student2 do the assessment of the student1 and vice versa
      9. Now, as teacher, switch to the Grading evaluation phase for assigning the final grades and then switch to the Closed phase
      10. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      11. Create a Token in the mobile app service for the student1 and the teacher:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      12. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken (with the token for Student 1), courseid, the since parameter (with the timestamp you calculated), the tocheck[0][id] with the workshop cmid 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]=CALCULATED_TIME_STAMP&wsfunction=core_course_check_updates&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      13. Check that you receive updates for the submissions and assessments (assessments->updated eq to true and submissions->updated eq to true) including the ids of the submission and the assessment the student1 did (assessments->items and submissions->items contain the item ids)
      14. Execute the curl request again but using as wstoken the teacher one and check that you also receive updates for submissions and assessments (in this case the fields containing the updates will be userassessments and usersubmissions)
      15. Now, calculate the current timestamp
      16. Execute again the curl requests (one each, using both teacher and student tokens) but replacing the timestamp with the new calculated one and check that you don't receive any update
      Show
      Calculate the current timestamp https://www.unixtimestamp.com/ Create a course with a workshop Enrol a couple users as student (student2 and student1) and one user as teacher Edit the workshop assessment form creating only two evaluable comments As teacher, move the workshop to the submission phase (doing all the required configuration steps indicated by the activity) As the two students, do a submission (total of 2 submissions, one per sstudent). As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa. As student2 do the assessment of the student1 and vice versa Now, as teacher, switch to the Grading evaluation phase for assigning the final grades and then switch to the Closed phase Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for the student1 and the teacher: 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 (with the token for Student 1), courseid, the since parameter (with the timestamp you calculated), the tocheck [0] [id] with the workshop cmid 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] =CALCULATED_TIME_STAMP&wsfunction=core_course_check_updates&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Check that you receive updates for the submissions and assessments (assessments->updated eq to true and submissions->updated eq to true) including the ids of the submission and the assessment the student1 did (assessments->items and submissions->items contain the item ids) Execute the curl request again but using as wstoken the teacher one and check that you also receive updates for submissions and assessments (in this case the fields containing the updates will be userassessments and usersubmissions) Now, calculate the current timestamp Execute again the curl requests (one each, using both teacher and student tokens) but replacing the timestamp with the new calculated one and check that you don't receive any update
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59254-master

      Description

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

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            David Mudrák (@mudrd8mz)
            Integrator:
            Jake Dallimore
            Tester:
            Mark Nelson
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17