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

Separate folder for each student's work in "Download all assignments as a zip"

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: DEV backlog
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      1. create a course with an "advanced upload" assignment
      2. have student test account(s) upload several files each
      3. as the teacher click on the "Download all assignments as a zip" & save the .ZIP somewhere
      4. check and see each student's files are correctly located in a subfolder within the .ZIP

      Show
      1. create a course with an "advanced upload" assignment 2. have student test account(s) upload several files each 3. as the teacher click on the "Download all assignments as a zip" & save the .ZIP somewhere 4. check and see each student's files are correctly located in a subfolder within the .ZIP
    • Workaround:
      Hide

      None, really

      (Maybe one could create a script to re-arrange the .ZIP once one has downloaded it? )

      Show
      None, really (Maybe one could create a script to re-arrange the .ZIP once one has downloaded it? )
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      Currently the mod/assignment provides a link to "Download all assignments as a zip", which is great except that all the students' work shows up in the same directory. Instead of using a modified filename to separate students' work it would be better (IMHO ) to put each student's work into a separate folder (named with the student's first & last name), and then keep the original file name (and extension) for each file.

      This can be accomplished by changing line 1118 in mod/assignment/type/upload/assignment.class.php

      $fileforzipname = clean_filename($a_user->lastname.' '. $a_user->firstname ) . "/" . clean_filename($fileoriginal . $fileext);

      (this is in the download_submissions() function, in the foreach ($files as $file) loop).

      I've put my changes on github at https://github.com/MikeTheGreat/moodle/tree/MDL-29343-SubfoldersForDownload (based on MOODLE_21_STABLE)

      NOTE: The above change will unconditionally download as "Lastname Firstname" / "OriginalFilename.ext" - I'm not sure how to allow the user to easily choose between "Lastname Firstname" and "Firstname Lastname"

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              salvetore Michael de Raadt added a comment -

              Thanks for suggesting that and providing a solution.

              Show
              salvetore Michael de Raadt added a comment - Thanks for suggesting that and providing a solution.
              Hide
              gaudreaj Jean-Philippe Gaudreau added a comment - - edited

              Thanks for diff in github! We implemented it in our Moodle and it works just fine! I agree with you, it's better to zip the assignments this way. It'll surely be easier for the teacher to find the assignments and it's not breaking filenames (renaming files that could break references).

              Here's a little improvement so you can keep the the subfolders in the assignments when using "Advanced uploading of files":
              https://github.com/StudiumDevel/moodle/commit/969b855bfde2c624832f1fab3ff5342450eb1d1d

              Applying modification also fix a bug.
              See : http://tracker.moodle.org/browse/MDL-30432

              Show
              gaudreaj Jean-Philippe Gaudreau added a comment - - edited Thanks for diff in github! We implemented it in our Moodle and it works just fine! I agree with you, it's better to zip the assignments this way. It'll surely be easier for the teacher to find the assignments and it's not breaking filenames (renaming files that could break references). Here's a little improvement so you can keep the the subfolders in the assignments when using "Advanced uploading of files": https://github.com/StudiumDevel/moodle/commit/969b855bfde2c624832f1fab3ff5342450eb1d1d Applying modification also fix a bug. See : http://tracker.moodle.org/browse/MDL-30432
              Hide
              damyon Damyon Wiese added a comment -

              Moved this to the new assignment module as it still applies.

              This could be an option, however it was a deliberate decision not to do this when we implemented this. The feeling was that dealing with files in folders is confusing when you have a lot of submissions to mark. (especially if the filenames look similar).

              Show
              damyon Damyon Wiese added a comment - Moved this to the new assignment module as it still applies. This could be an option, however it was a deliberate decision not to do this when we implemented this. The feeling was that dealing with files in folders is confusing when you have a lot of submissions to mark. (especially if the filenames look similar).
              Hide
              dimztimz Dimitrij Mijoski added a comment -

              There are two issues similar to this related to the filenames. Two of them are closed this is open, so I will comment here too.

              Would it be possible the student ID to be part of the name, of the folder in this case.

              Show
              dimztimz Dimitrij Mijoski added a comment - There are two issues similar to this related to the filenames. Two of them are closed this is open, so I will comment here too. Would it be possible the student ID to be part of the name, of the folder in this case.

                People

                • Votes:
                  16 Vote for this issue
                  Watchers:
                  14 Start watching this issue

                  Dates

                  • Created:
                    Updated: