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

get_scorm_sco_tracks should return a waning if the specified attemtp does not exists

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.2
    • Fix Version/s: 3.0
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide
      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=200

          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
        • For the first request (valid attempt number) you don't see warnings and you see the attempt data correctly returned
        • For the second request, with the invalid attempt number, you see a warning "notattempted" including the invalid attempt number
      Show
      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=200 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 For the first request (valid attempt number) you don't see warnings and you see the attempt data correctly returned For the second request, with the invalid attempt number, you see a warning "notattempted" including the invalid attempt number
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51567-master

      Description

      See latest comments in MDL-50352 for more information

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

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