Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77591

Assignment feedback files upload is broken in 4.1+ for group assignments

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77591-401
    • MDL-77591-master
    • Hide
      1. Create a course and enroll 3 students
      2. Create Group 1 with s1 and s2
      3. Create Group 2 with s3
      4. Create an assignment with feedback files and group submission enabled
      5. As s1, submit a file `submission1.txt` with some text in it
      6. As s3, submit a file `submission2.txt` with some text in it
      7. Download all submissions
      8. Unzip
      9. Write some feedback into Group 1's `submission1.txt`
      10. Create `feedback2.txt` in Group 2's subfolder and write some feedback into it
      11. Rezip the folders
      12. From the "Grading action" select, choose "Upload multiple feedback files in a zip"
      13. Select the just created zip file and click "Import feedback file(s)"
      14. Verify that the confirmation message lists 
        • New feedback file "/submission1.txt" for student(s) "s1, s2"
        • New feedback file "/feedback2.txt" for student(s) "s3"
      1. Click confirm and continue
      2. Verify that the submission overview now lists `submission1.txt` for s1 and s2 and `feedback2.txt` for s3 as feedback files
      Show
      Create a course and enroll 3 students Create Group 1 with s1 and s2 Create Group 2 with s3 Create an assignment with feedback files and group submission enabled As s1, submit a file `submission1.txt` with some text in it As s3, submit a file `submission2.txt` with some text in it Download all submissions Unzip Write some feedback into Group 1's `submission1.txt` Create `feedback2.txt` in Group 2's subfolder and write some feedback into it Rezip the folders From the "Grading action" select, choose "Upload multiple feedback files in a zip" Select the just created zip file and click "Import feedback file(s)" Verify  that the confirmation message lists  New feedback file "/submission1.txt" for student(s) "s1, s2" New feedback file "/feedback2.txt" for student(s) "s3" Click confirm and continue Verify  that the submission overview now lists `submission1.txt` for s1 and s2 and `feedback2.txt` for s3 as feedback files

      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:

      1. Create a course, enrolling 4 students
      2. Create Group1, assigning s1 and s2 to it
      3. Create a group assignment with feedback files enabled
      4. Create submission for s1
      5. Create submission for s3
      6. Download all submissions
      7. Unzip
      8. Note the folder names, these will be something like 'Group1_9_assignsubmission_file' and 'Default group_assignsubmission_file'
      9. 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.

      10. Change the id in the Group1_.... filename to the id you fetched above
      11. Rezip archive
      12. From the 'view all submissions' page, from the "Grading action" select, choose "Upload multiple feedback files in a zip"
      13. Select the zip you just created
      14. Continue with the import
      15. 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.

            justusdieckmann Justus Dieckmann
            jaked Jake Dallimore
            Jordi Pujol-Ahulló Jordi Pujol-Ahulló
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            29 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 45 minutes
                3h 45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.