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

New WebService mod_scorm_get_scorm_access_information

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a new SCORM activity in a new course
      3. Enrol two users in the course, one as student and the other one as editing teacher.
      4. Create a Token in the mobile app service for the two users
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Open the console an execute this new curl request, replacing wstoken with the student token, the site url with yours. The scormid is the scorm instance id (the id of the scorm in the mod_scorm table in the database)

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_scorm_get_scorm_access_information&wstoken=3af67232a7596ceb658df4db329e5ad6&scormid=2' | python -m "json.tool"

      6. Now check in the curl response that the following returned fields are set to true: cansavetrack, canskipview and canviewscores
      7. Execute again the same curl request but this time using the teacher token.
      8. Check that in the curl response all the returned fields are set to true except the following: candeleteownresponses and canskipview
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a new SCORM activity in a new course Enrol two users in the course, one as student and the other one as editing teacher. Create a Token in the mobile app service for the two users Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console an execute this new curl request, replacing wstoken with the student token, the site url with yours. The scormid is the scorm instance id (the id of the scorm in the mod_scorm table in the database) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_scorm_get_scorm_access_information&wstoken=3af67232a7596ceb658df4db329e5ad6&scormid=2' | python -m "json.tool" Now check in the curl response that the following returned fields are set to true: cansavetrack, canskipview and canviewscores Execute again the same curl request but this time using the teacher token. Check that in the curl response all the returned fields are set to true except the following: candeleteownresponses and canskipview
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-64252-master

      Description

      We need this WebService to return the capabilities affecting the current user in order to calculate if the user is able to see some information controlled by capabilities (a particular case is the score information).

      See  MOBILE-1355 for more information.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 25 minutes
                  25m