- You need to have access to console on your system
- Curl and python should be installed on your system.
- Have basic understanding of Json
- Login as admin
- Enable web services (Site administration ▶︎ Advanced features)
- Enable Rest protocol (Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage protocols)
- Add an external service (Site administration ▶︎ Plugins ▶︎ Web services ▶︎ External services)
- Add function with core_course_get_contents
- Create a token for student (Sam student) (Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage tokens)
- Save token and use it to replace d49d1fac7125d9fd515c374be8d37c34 in the web service below.
- Replace courseid = 3 with Id of "Activity examples" course on QA.
- Run following command on your console
- Ensure you receive a list of course modules including all the activities in "Activity examples" course on qa.moodle.net
- Now replace the --data value to tests the different options:
- You should see course topics list but not activity modules
- You should see the course topics list, including activities and resources. The resources must have an empty contents attribute
- In this case you will be a single section with resources without contents