- Log in as a teacher and create a lesson with at least two content pages.
- In the lesson settings, set 'Allow lesson to be attempted offline using the mobile app' to Yes.
- Enrol one user as student in the course containing the lesson.
- Log in as the student and view the first page of the lesson, then log out.
- Log in as an admin and enable 'Mobile services' in the Site administration.
- Create a web services token for the student user in 'Manage tokens' in the Site administration.
- 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"
- You need to replace the wstoken, lessonid (the lesson instance value).
- Log in as a student again and access 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.
- is a QA test written for
-
MDL-57759 Allow offline attempts via the Mobile app in the lesson module
- Closed