Hello,
One solution for Windows10+Excel. No script, no VB, no special plugin needed.
1) Assuming you have a folder with one file for each student.
The automatic ordering of these files by name must be the very same than the order of your students list by first name.
Let's say for the sake of example that 01.doc will be for the first student of your list (in alphabetic order by first name), 02.doc for the next one, so on...
Example:
01.doc must be send to student: Carl Jenkis
02.doc must be send to student :Dizzy Flores
03.doc must be send to student : Johhny Rico
04.doc must be send to student : Yvette Deladrier
2) How do you get the complete list of the names of your files inside your folder ?
Just Shift+Right Clic on the folder containing all your files and launch PowerShell in the contextual menu ; then enter this line:
dir -n > list.txt
You should get a txt file in your folder with the list of all your files' names (in the above example : 01.doc, 02.doc ; obviously if you have students' works scans (do scan them in alphabetic order by first name for further convenience) you may get other names according to your scanner naming files policy like SCAN_08_06_2019_13_05.pdf)
3) In the list.txt list remove list.txt itself (am I clear ?
) and open it in Excel ; copy/paste this list in the first column of an Excel sheet. You 'll build now your Excel sheet just like this:
- Column A: the files names list you've just pasted
- Column B: your students first names list
- Column C: your students last names list
- Column D: in the Moodle Assignment, first order your student by first names (just click on first name in column title), then download the grading worksheet : check what participant number has be assigned to the very first student of the list. Enter this number in Column D on the first line (the same line where are this student first and last name in column B and C). Then Ctrl+drag down to put automatically the right participant number to each and every other students.
- Column E: enter in first cell something like "_assignsubmission_file_documentname.file extension" ; in my example "_assignsubmission_file_Assignment of the Day.docx" and drag down this very same content on each lines of the column E.
- Column F: the tricky one In the top cell F1 enter this magic formula:
="ren"&" "&""""&A1&""""&" "&""""&B1&" "&C1&"_"&D1&E1&""""
Yes I know I know...
The thing is that here you build the perfect command (ren stands for rename) in order to rename later all your files regarding Moodle requirements.
You use concatenation (it's why all these & are here for) to build this command with your previous cells on the same line (current file name - 01.doc-, first and last student name, participant number, -assignsubmission" mention...)
You drag down this formula and must get something like this in each and every cell of column F:
ren "01.docx" "Carl Jenkins_4718_assignsubmission_file_Assignment of the Day.docx"
(thats to say: rename 01.docx into Carl....docx)
The strange four quotes in a row are just here in order to put the older file name (01.doc) and the new one (that's to say Carl Jenkins_4718_assignsubmission_file_Assignment of the Day.docx) between quotes precisly.
It may look like heavy work but of course you'll be able to reuse this very same Excel sheet for an another assignment with all your students first and last names already in it, and the "assignsubmission_file" column also and above all this magic formula (you'll just have to change the list of the files to be renamed, and the participants' numbers according to the Moodle assignment grading worksheet).
4) Select and copy all the column F content.
5) In PowerShell (Shift+Right Clic on the folder containing all your files and launch PowerShell in the contextual menu remember) just right click...and now all your files will be magically renamed as they should.
Just zip them and upload them as feedback files in the Moodle assignment. Congratulations you did it !
Best regards,
Dominique BODIN