-
Functional Test
-
Minor
-
Moodle 3.3
-
None
For testing this issue:
- You need to have access to console on your system
- Curl and python should be installed on your system.
- Have basic understanding of Json
Prerequisite
- Login as admin
- Enable web services (Site administration ▶︎ Advanced features)
- Enable Rest protocol (Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage protocols)
- Enable mobile web service (Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Mobile)
- 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.
Test
- Login as teacher
- Navigate to Activity examples course
- Edit "Online Text Assignment" activity
- Set "Allow submissions from" to more then a year from now.
- Uncheck "Always show description"
- Attach few file in description.
- Edit "Assignment with file submissions"
- Set "Allow submissions from" to some date in past
- Uncheck "Always show description"
- Attach few file in description
- Edit "Assignment with file submissions"
- Set "Allow submissions from" to some date in past
- Check "Always show description"
- Attach few file in description
- Run following command on your console (Please remember to replace course id and the token parameters to correct values)
curl 'https://qa.moodle.net/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=2&wsfunction=mod_assign_get_assignments&wstoken=d49d1fac7125d9fd515c374be8d37c34' | python -m json.tool
- Confirm you receive a list of courses with four assignments.
- One of the assignments should not display intro, introattachments and introformat (the one you configured to not display always the description and start date 1 year in future)
- The other assignments displays description (intro) and a list of attached files (introattachments)