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

New Web Service mod_scorm_insert_scorm_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 an enrolled student.
      2. Create a sample scorm activity, you can upload the singlescobasic.zip found here https://github.com/moodle/moodle/tree/master/mod/scorm/tests/packages.
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the the student user .
        • You need to replace the wstoken, and scoid value (you can get the scoid from the scorm_scoes table) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scoid=4&attempt=1&wsfunction=mod_scorm_insert_scorm_tracks&tracks%5B0%5D%5Belement%5D=cmi.core.lesson_status&tracks%5B0%5D%5Bvalue%5D=completed&tracks%5B1%5D%5Belement%5D=cmi.core.score.raw&tracks%5B1%5D%5Bvalue%5D=80&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

      6. Confirm that
        • You receive as response an array containing all scoes_track ids
        • As admin or teacher, if you open the activity in Moodle and then go to the "Reports" tab you will see that the user has an attempt with a score of 80
        • If you change the SCORM settings, using a timeclose lower that the current time, you will see an exception as the WS response
      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 an enrolled student. Create a sample scorm activity, you can upload the singlescobasic.zip found here https://github.com/moodle/moodle/tree/master/mod/scorm/tests/packages . Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token 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 the student user . You need to replace the wstoken, and scoid value (you can get the scoid from the scorm_scoes table) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scoid=4&attempt=1&wsfunction=mod_scorm_insert_scorm_tracks&tracks%5B0%5D%5Belement%5D=cmi.core.lesson_status&tracks%5B0%5D%5Bvalue%5D=completed&tracks%5B1%5D%5Belement%5D=cmi.core.score.raw&tracks%5B1%5D%5Bvalue%5D=80&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 scoes_track ids As admin or teacher, if you open the activity in Moodle and then go to the "Reports" tab you will see that the user has an attempt with a score of 80 If you change the SCORM settings, using a timeclose lower that the current time, you will see an exception as the WS response
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50353-master

      Description

      Parameters:scoid, userid, attempt, array of element, value
      Inserts track information about a SCO
      Returns: track id values and warnings

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                John Okely
                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, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

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