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

Assignment activity "Download all submissions" action includes files a student removed from online submission text

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test prereqs:

      1. 3 students and 1 teacher enrolled in a course.
      2. 2 groups:
        • Group A containing student 1
        • Group B containing student 2
        • Student 3 is NOT in a group.
      3. 1 Grouping, containing both Group A and B.
      4. 5 image files on your local fs for testing uploads.
      5. An assignment (A1) with:
        • Online text submissions enabled
        • GroupMode set to 'separate groups'
        • Feedback files = true
        • Student submit in groups = yes, and set grouping to the grouping you created.
      6. An assignment (A2) with:
        • Online text submissions enabled
        • GroupMode set to 'separate groups'
        • Feedback files = true
        • Students submit in groups = no

      Test onlinetext file links work after downloading

      For assignment 1:

      1. As student 1, create a submission and upload image 1 and image 4 in the online text area. Submit this.
      2. As student 2, create a submission and upload image 2 and image 5 in the online text area. Submit this.
      3. As student 3, create a submission and upload image 3 in the online text area. Submit this.
      4. As the teacher, on the view all submission page, make sure the checkbox 'Download submissions in folders' is ticked (bottom of page).
      5. Make sure the separate groups select is set to 'All participants'
      6. Select 'Download all submissions' from the grading action select.
      7. Confirm that the filename does not contain any double hyphens (--), nor does it contain the group name.
      8. Extract the resulting zip file and confirm that:
        • You see a folder for each student submission
        • Each student is prefixed with 'Group A', 'Group B' or 'Default group' respectively. Student 3 is listed as 'Default group' because they are not in the grouping - this is normal.
        • Inside each student submission folder you see the 2 corresponding image files and an 'onlinetext.html' file.
        • The image file names are not prefixed with anything.
      9. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works).
      10. Now, uncheck the checkbox 'Download submissions in folders'
      11. Select 'Download all submissions' from the grading action select
      12. Extract the resulting zip file and confirm that:
        • All submission files are prefixed with 'Group A', 'Group B' or 'Default group' respectively.

      For assignment 2:

      1. Repeat the above download steps with 'Download submissions in folders' enabled. Extract the file. This time confirm that:
        • No group prefix is present on the student folder nor on the submission files.
      2. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works).
      3. Repeat the above download steps with 'Download submissions in folders' disabled. Extract the file. This time confirm that:
        • No group prefix is present on any of the the submission files.
      4. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works).

      Test removal of orphaned files from the user drafts file area

      In Assignment 1:

      1. As student 1, edit your submission and delete image 4 from the online text area. Submit this.
      2. Edit the submission again, click 'manage files' and Confirm that you only see image 1 listed and a text warning about automatic file removal.
      3. As student 2, edit your submission and delete image 5 from the online text area. Submit this.
      4. Edit the submission again, click 'manage files' and Confirm that you only see image 2 listed and a text warning about automatic file removal.
      5. As the teacher, on the view all submission page, make sure the checkbox 'Download submissions in folders' is ticked.
      6. Select both students and choose 'Download selected submissions'
      7. Extract the resulting zip file and confirm that:
        • Only one image is included for each of student 1 and student 2's submissions (image 1 and image 2 respectively).
      8. Open the onlinetext.html file for each student and confirm the image is correctly displayed
      9. Repeat the above with 'Download submission in folders' disabled and confirm that only one image per student submission is present and that the html file displays the image correctly.

      Glossary entry files regression test

      1. Create a glossary and upload a few files into the text area in a new entry. Don't save anything.
      2. Delete one of the files from the editor text and click 'Manage files'
      3. Confirm that:
        • You see the file you just removed listed under 'unused files' and;
        • You don't see the text warning about the file being automatically removed.
      4. Save the entry and edit it again.
      5. Click 'Manage files' in the editor and confirm that:
        • You see both files still listed in the top section and;
        • You see one file in the unused files section (i.e. it wasn't removed on save)
      Show
      Test prereqs: 3 students and 1 teacher enrolled in a course. 2 groups: Group A containing student 1 Group B containing student 2 Student 3 is NOT in a group. 1 Grouping, containing both Group A and B. 5 image files on your local fs for testing uploads. An assignment (A1) with: Online text submissions enabled GroupMode set to 'separate groups' Feedback files = true Student submit in groups = yes, and set grouping to the grouping you created. An assignment (A2) with: Online text submissions enabled GroupMode set to 'separate groups' Feedback files = true Students submit in groups = no Test onlinetext file links work after downloading For assignment 1: As student 1, create a submission and upload image 1 and image 4 in the online text area. Submit this. As student 2, create a submission and upload image 2 and image 5 in the online text area. Submit this. As student 3, create a submission and upload image 3 in the online text area. Submit this. As the teacher, on the view all submission page, make sure the checkbox 'Download submissions in folders' is ticked (bottom of page). Make sure the separate groups select is set to 'All participants' Select 'Download all submissions' from the grading action select. Confirm that the filename does not contain any double hyphens (--), nor does it contain the group name. Extract the resulting zip file and confirm that : You see a folder for each student submission Each student is prefixed with 'Group A', 'Group B' or 'Default group' respectively. Student 3 is listed as 'Default group' because they are not in the grouping - this is normal. Inside each student submission folder you see the 2 corresponding image files and an 'onlinetext.html' file. The image file names are not prefixed with anything. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works). Now, uncheck the checkbox 'Download submissions in folders' Select 'Download all submissions' from the grading action select Extract the resulting zip file and confirm that : All submission files are prefixed with 'Group A', 'Group B' or 'Default group' respectively. For assignment 2: Repeat the above download steps with 'Download submissions in folders' enabled. Extract the file. This time confirm that: No group prefix is present on the student folder nor on the submission files. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works). Repeat the above download steps with 'Download submissions in folders' disabled. Extract the file. This time confirm that: No group prefix is present on any of the the submission files. Open the onlinetext.html file for each student and confirm the images are displayed (i.e. confirm the link works). Test removal of orphaned files from the user drafts file area In Assignment 1: As student 1, edit your submission and delete image 4 from the online text area. Submit this. Edit the submission again, click 'manage files' and Confirm that you only see image 1 listed and a text warning about automatic file removal. As student 2, edit your submission and delete image 5 from the online text area. Submit this. Edit the submission again, click 'manage files' and Confirm that you only see image 2 listed and a text warning about automatic file removal. As the teacher, on the view all submission page, make sure the checkbox 'Download submissions in folders' is ticked. Select both students and choose 'Download selected submissions' Extract the resulting zip file and confirm that : Only one image is included for each of student 1 and student 2's submissions (image 1 and image 2 respectively). Open the onlinetext.html file for each student and confirm the image is correctly displayed Repeat the above with 'Download submission in folders' disabled and confirm that only one image per student submission is present and that the html file displays the image correctly. Glossary entry files regression test Create a glossary and upload a few files into the text area in a new entry. Don't save anything. Delete one of the files from the editor text and click 'Manage files' Confirm that : You see the file you just removed listed under 'unused files' and; You don't see the text warning about the file being automatically removed. Save the entry and edit it again. Click 'Manage files' in the editor and confirm that : You see both files still listed in the top section and; You see one file in the unused files section (i.e. it wasn't removed on save)
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_26_STABLE, MOODLE_32_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36985-master
    • Sprint:
      3.4 Sprint 4

      Description

      When a student saves a submission with a file in the online text (an image for example) and then subsequently edits the submission to remove that file from the online text, the file is still in the zip file that is produced with the "Download all submissions" action.

      Reproduction steps:

      1. Set up an assignment with "Online text" submission enabled
      2. As a student edit a submission against the assignment and insert an image in the "Online text" editor
      3. Save the submission
      4. Edit the submission again and remove the image from "Online text" editor
      5. Save the submission
      6. As a teacher/admin use the "Download all submissions" action
      7. Open the downloaded zip archive

      Expected Result: The deleted image will not appear in the download
      Actual Result: The deleted image appears in the download

        Attachments

        1. 1filemanager.png
          1filemanager.png
          14 kB
        2. 2addfile.png
          2addfile.png
          27 kB
        3. screenshot-1.png
          screenshot-1.png
          47 kB
        4. Screen Shot 2017-08-18 at 10.29.54 am.png
          Screen Shot 2017-08-18 at 10.29.54 am.png
          107 kB

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17