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

New Web Service mod_data_view_database

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a couple of students, the course must have at least one section.
      2. Enable completion at site level and course level.
      3. Create a mod_database activity .
      4. Use as completion criteria "Student must view this activity to complete it"
      5. Log in as one of the students and visit the database activity
      6. Log in as teacher and check that the activity is marked as completed by the student and that the student action generated a new entry in the logs (course -> reports -> logs)
      7. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      8. Create a Token for the other student user (the one you didn't use yet)
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      9. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, databaseid (the database instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_view_database&wstoken=12a2a65aeea2a177055e233f9e303218' --compressed

      10. Confirm that
        • You can see new entries in the course log (database course module viewed) for that course and the user. The origin for the new log entries is "ws"
        • If you access via the web interface you will see the activity marked as completed, if you access the activity via the web interface with the student you will see log entries with origin "web" (database course module viewed)
          NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.
      Show
      Create a course with a couple of students, the course must have at least one section. Enable completion at site level and course level. Create a mod_database activity . Use as completion criteria "Student must view this activity to complete it" Log in as one of the students and visit the database activity Log in as teacher and check that the activity is marked as completed by the student and that the student action generated a new entry in the logs (course -> reports -> logs) As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the other student user (the one you didn't use yet) 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, databaseid (the database instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_view_database&wstoken=12a2a65aeea2a177055e233f9e303218' --compressed Confirm that You can see new entries in the course log (database course module viewed) for that course and the user. The origin for the new log entries is "ws" If you access via the web interface you will see the activity marked as completed, if you access the activity via the web interface with the student you will see log entries with origin "web" (database course module viewed) NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57915-master

      Description

      To mark view completed and launch the mod viewed event for the database.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Simey Lameze
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Jake Dallimore
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

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