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

Allow offline attempts via the Mobile app in the lesson module

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. In a course create a lesson with at least two content pages.
      2. Enable Availability -> Allow lesson to be attempted offline using the mobile app option
      3. Enrol one user as student in the course where the lesson is.
      4. Access to the lesson as student in the Moodle web interface, and open the first page of the lesson.
      5. Log out from the site.
      6. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      7. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, lessonid (the lesson instance value).

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=4&wsfunction=mod_lesson_finish_attempt&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      9. Now log in in Moodle web as student and open the lesson activity. Check that you see this message: You have worked on this attempt using a mobile device. Data was last saved to this site XYZ ago. Please check that you do not have any unsaved work.
      Show
      In a course create a lesson with at least two content pages. Enable Availability -> Allow lesson to be attempted offline using the mobile app option Enrol one user as student in the course where the lesson is. Access to the lesson as student in the Moodle web interface, and open the first page of the lesson. Log out from the site. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings 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, lessonid (the lesson instance value). curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=4&wsfunction=mod_lesson_finish_attempt&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now log in in Moodle web as student and open the lesson activity. Check that you see this message: You have worked on this attempt using a mobile device. Data was last saved to this site XYZ ago. Please check that you do not have any unsaved work.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57759-master

      Description

      This is very similar to what we did for the quiz module (MDL-53870) we should add new fields in the lesson module to:

      • Allow teachers a lesson to be attempted offline
      • Notify students when they are continuing an attempt that was previously done in the app

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/17