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

New Web Service mod_scorm_get_scorm_scoes

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0
    • 2.9, 3.0
    • SCORM, Web Services
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-50351-master
    • 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 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 teacher and 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, scormid (instance id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scormid=2&organization=&wsfunction=mod_scorm_get_scorm_scoes&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 the scoes data (match with the data in the scorm_scoes table), in this case 2 scoes
        • If you add a value to the organization parameter (in this case golf_sample_default_org) you receive just information for one sco (the one that belongs to that organization)
        • If you change the SCORM settings, using a timeclose lower that the current time, you will receive warnings as response and 0 scoes data
        • With a teacher token you can see all the scorm scoes even when the timeopen is bigger than the current time
        • If you try to retrieve attempts for a nonexistent scorm you get and invalidrecord error
      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 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 teacher and 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, scormid (instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'scormid=2&organization=&wsfunction=mod_scorm_get_scorm_scoes&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 scoes data (match with the data in the scorm_scoes table), in this case 2 scoes If you add a value to the organization parameter (in this case golf_sample_default_org) you receive just information for one sco (the one that belongs to that organization) If you change the SCORM settings, using a timeclose lower that the current time, you will receive warnings as response and 0 scoes data With a teacher token you can see all the scorm scoes even when the timeopen is bigger than the current time If you try to retrieve attempts for a nonexistent scorm you get and invalidrecord error

      Parameters: scormid
      Returns a list of scoes inside the specified scorm

            jleyva Juan Leyva
            jleyva Juan Leyva
            Ankit Agarwal Ankit Agarwal
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.