-
Bug
-
Resolution: Fixed
-
Major
-
2.3.9, 2.4.2, 2.4.6, 2.5.2
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
When an assignment has team submissions enabled, the admin user can not view images in submitted as part of online text or download a file submitted.
Reproduction steps:
- Create an assignment and enable team submissions with online text.
- As a student make a submission to the assignment and include an image in the online text (via the TinyMCE editor).
- View the submission as an admin.
Expected results:
- Admin can view the image submitted as part of the online submission.
Actual results:
- Admin can not view the image submitted as part of the online submission.
This can also be reproduced using file submissions, which is how I originally found the issue. And while I haven't tested it is likely to affect submission comments as well because it uses the method where the issue is found.
I believe the issue caused by the is_enrolled() check made in the assign class can_view_group_submission() method. The is_enrolled() call returns false for the admin, which in turn causes can_view_group_submission() to return false as well. can_view_group_submission() is used by assignsubmission_onlinetext_pluginfile() and assignsubmission_file_pluginfile().
Possible solutions:
- Move the has_capability() check for 'mod/assign:grade' above the is_enrolled() check.
- Add a check for admins in the conditional with is_enrolled() (e.g. if (!$isadmin && !is_enrolled())
If either of these sound good (or if even you'd like to go another route), I'd be glad to supply a patch or pull request. Just let me know.
- Discovered while testing
-
MDL-42242 Debugging message in mod_assign when submitting an online text with an image (group submissions)
-
- Closed
-
- is a regression caused by
-
MDL-37710 Students cannot access their own submitted files in a teamsubmission assignment
-
- Closed
-
- is duplicated by
-
MDL-38321 Assignment submission files linked to every user in gradebook
-
- Closed
-