maybe some could give me some help with my issue: students upload their java codes via MS Teams assignments that I want to review (and compare with each other) locally.
It is possible for me as a teacher to do a bulk download of all submissions. Extracting the zip reveals the following structure:
- root
- student1name
- project1
- version1
- file1.java
- maybe also other files like file1.class, myfirstcodepastedinword.doc, screenshotofcode.jpg...
- version2 //optional
- file1.java
- subdir // optional
- otherfile.class
- nextsubdir
- lastfile.txt ...
- version1
- project2
- version1 ...
- project1
- student2name
- project1
- version1
- nextClass.java .. and so on...
- version1
- project1
- student1name
What I am looking for is a litte batch that collects all project-sepecific submissions together in one directory (for being able to do simple comparisons). For identification, the student's name and all leading subdirectories must be added to the new file name.
So, after calling "collectSubmissions.bat", the result should be a new dir called "Submissions" containing all files as follows:
- project1
- student1name-version1-file1.java
- student1name-version1-file1.class (could by omitted, but too much effort, I will simply ignore this manually)
- student1name-version1-myfirstcodeinword.doc
- student1name-version1-screenshotofcode.jpg
- student1name-version2-file1.java
- student1name-version2-subdir-otherfile1.class
- student1name-version2-subdir-nextsubdir-lastfile.txt
- ...
- student2name-version1-file1.java
- ...
- project2
- student1name-version1-nextClass.java ....
I did some research and tried different approaches (starting How can I recursively copy files of a specific pattern into a single flat folder on Windows?) and found one pretty close to my needs here:
How do I copy files with adding folder name to destination file name?
But only the closest parent directory name is used here. But in my case, there can be multiple nested folders, so I am hoping that someone could give me some advice how to do that.
Thank you so much in advance for your help!