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

New Web Service mod_scorm_get_scorm_sco_tracks

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9, 3.0
    • Fix Version/s: 3.0
    • Component/s: SCORM, Web Services
    • Labels:
    • Testing Instructions:
      Hide

      Note: Version numbers are bumped because a new web service is added into the Mobile app service and also in a module.

      1. Create a course with a teacher and a student.
      2. Create a sample scorm activity, you should use the singlescobasic.zip found here https://github.com/moodle/moodle/tree/master/mod/scorm/tests/packages.
      3. As the student, access the scorm package and start a couple of attempts (don't forget to select the start new attempt option).
      4. Enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the teacher and the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a couple of CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, scoid (scorm_scoes table id), userid and the URL of your moodle instance. Do two requests using attempt=1 and attempt=2

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scoid=2&userid=3&attempt=1&wsfunction=mod_scorm_get_scorm_sco_tracks&wstoken=ffbe3a3002f235bf9d01fd9369e10b66'

          Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output

      7. Confirm that
        • You receive as response an array containing all the sco data for the specified attempt
        • You should compare the data you received with the SCORM data report that you can see as a teacher in the report tab of mod/scorm/view.php (click in the attempt number and then in track details) you will see some SCORM variables like cmi.core.lesson_status
        • Try to retrieve the track information for other existing userid, you should see a required_capability_exception
        • Using the teacher token execute the same curl command, the output should be the same
      Show
      Note: Version numbers are bumped because a new web service is added into the Mobile app service and also in a module. Create a course with a teacher and a student. Create a sample scorm activity, you should use the singlescobasic.zip found here https://github.com/moodle/moodle/tree/master/mod/scorm/tests/packages . As the student, access the scorm package and start a couple of attempts (don't forget to select the start new attempt option). Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the teacher and the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the student user . You need to replace the wstoken, scoid (scorm_scoes table id), userid and the URL of your moodle instance. Do two requests using attempt=1 and attempt=2 curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scoid=2&userid=3&attempt=1&wsfunction=mod_scorm_get_scorm_sco_tracks&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output Confirm that You receive as response an array containing all the sco data for the specified attempt You should compare the data you received with the SCORM data report that you can see as a teacher in the report tab of mod/scorm/view.php (click in the attempt number and then in track details) you will see some SCORM variables like cmi.core.lesson_status Try to retrieve the track information for other existing userid, you should see a required_capability_exception Using the teacher token execute the same curl command, the output should be the same
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50557-master

      Description

      Wrapper function for:

      scorm_get_tracks($scoid, $userid, $attempt='')

      Parameters: $scoid, $userid, $attempt (default 0)
      Returns, sco track elements for the given user

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                16/Nov/15