-
Bug
-
Resolution: Fixed
-
Minor
-
4.0
-
MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
It seems the external_format_text isn't applied as it should in the WebServices mod_assign_get_assignments and mod_assign_get_submission_status. The URL returned in the activity text is like:
https://SITEURL/webservice/pluginfile.php/15318/mod_assign/activityattachment/image.jpeg
And that URL doesn't work. In the activity attachments it's returned like this:
https://SITEURL/webservice/pluginfile.php/15318/mod_assign/activityattachment/0/image.jpeg
This last URL is the right one, the first one should also include the /0/.
How to reproduce:
- As an admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
- Create a new course.
- Create a new assignment activity, setting the following:
- The assignment should be open (in the Availability section).
- In the Activity instructions field, add an image.
- Enrol one user as student in the course
- Create a Token in the mobile app service for the previous user
- Click on Site administration ► Plugins ► Web services ► Manage tokens
- Open the console and execute this curl request, replacing wstoken with the token you created for the user, the SITE_URL with yours and COURSEID with the course id where the assignment is:
curl 'SITE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=COURSEID&moodlewssettingfilter=true&moodlewssettingfileurl=true&moodlewssettinglang=en&wsfunction=mod_assign_get_assignments&wstoken=WSTOKEN' --compressed | python -m "json.tool"
- Check that the URL included in the activity field is different than the one returned in activityattachments.