-
Bug
-
Resolution: Fixed
-
Major
-
4.1 regressions, 4.1.1, 4.1.2, 4.2
Prior to MDL-64231 (so, Moodle 4.0 and older), teachers could download all submissions as a zip and then use this same zip structure to upload feedback files for students. The import process relied on getting a certain format for the student folders within the zip. When using this process for a non-group assignment, it worked nicely; all submission files in the student folders were detected and ignored when importing the feedback. Teachers could just add a feedback file in the student folder, rezip and upload - everything working nicely.
Using this same process for group assignments (students submit in groups = yes) was also possible, although it didn't detect and skip the submission files. However, it was technically possible to reuse the download zip as the structure for the import zip. Teachers could just delete the submission file and attach a feedback file (one for each group member) and then rezip and upload. It was perhaps tedious but it was supported in some fashion.
MDL-64231 broke this for both:
- Individual submissions, because it removed the trailing underscore in the zip folder names. This is being dealt with in
MDL-76309) and; - Group submissions, because it completed changed the folder structure for group assignment downloads)
Now, when groups submissions are downloaded, instead of using the assignment participant id (which comes from assign_user_mapping table) in the folder name (e.g. the 23 in 'Group1-Oskar Lopez_23_assignsubmission_file_'), the download uses the group id instead (e.g. Group1_9_assignsubmission_file). The import code doesn't know about this format and so feedback upload effectively isn't supported any more. Worse still, if the group id just so happens to match the id of an assignment participant (group.id == assign_user_mapping.id), then the import process will thing that file belongs to the participant and attach the group feedback file there. This is erroneous and can result in group feedback files ending up attached to the wrong users. You can see the relevant code here: https://github.com/moodle/moodle/blob/b2c8d4ab7bacf4061d18072f1ef98d6ef1ade644/mod/assign/feedback/file/importziplib.php#L77
To simulate the id matching bug:
- Create a course, enrolling 4 students
- Create Group1, assigning s1 and s2 to it
- Create a group assignment with feedback files enabled
- Create submission for s1
- Create submission for s3
- Download all submissions
- Unzip
- Note the folder names, these will be something like 'Group1_9_assignsubmission_file' and 'Default group_assignsubmission_file'
- Check the assign_user_mapping table, grabbing the id for user s3 or s4 (either of the users not in Group1). E.g.:
select id from mdl_assign_user_mapping where userid = XX; // replace XX with id of s3 or s4.
- Change the id in the Group1_.... filename to the id you fetched above
- Rezip archive
- From the 'view all submissions' page, from the "Grading action" select, choose "Upload multiple feedback files in a zip"
- Select the zip you just created
- Continue with the import
- Observe that the feedback file included in the Group1 folder is now attached to user s3 or s4 (whichever you picked earlier)
I think both of the above need fixing.
- Discovered while testing
-
MDL-76309 Submissions download as ZIP not compatible with upload of feedback files
- Closed
- is a regression caused by
-
MDL-64231 Improve Group assignment submission exporting
- Closed
- Testing discovered
-
MDL-78139 Various unhandled exceptions in assignment multiple feedback files upload
- Open