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

New Web Service mod_assign_view_assign

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a student, the course must have at least one section.
      2. Enable completion at site level and course level.
      3. Create a mod_assign activity using as completion criteria "Student must view this activity to complete it"
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, assignid (the assign instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=2&wsfunction=mod_assign_view_assign&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed

      7. Confirm that
        • If you access via the web interface you will see the activity marked as completed
          NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.
      Show
      Create a course with a student, the course must have at least one section. Enable completion at site level and course level. Create a mod_assign activity using as completion criteria "Student must view this activity to complete it" As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user . You need to replace the wstoken, assignid (the assign instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=2&wsfunction=mod_assign_view_assign&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that If you access via the web interface you will see the activity marked as completed NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55162-master

      Description

      This Web Service is just for launching $completion->set_module_viewed

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Mark Nelson
              Integrator:
              David Monllaó
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              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:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16