The Problem
During the summer of 2020, I worked as an algorithm and data-structures (C++) TA for Langara College. Part of my work consisted of marking 40 student submitted C++ assignments at a time, all with different submission formats and styles. I needed an automated way to quickly download, sort, format, and compile these projects to reduce the amount of time spent marking.
My Solution
Langara's lab submission system will allow a one-click download of a single .zip file containing all of the student submissions. I wrote a POSIX-compliant shell script to automatically unzip this file, and recursively unpack all sub-packages.
Once the files are unzipped, my script automatically cleans up all submissions, deleting non-required files, restructuring directory structures, formatting and finally linting lintable source files. The submissions are inserted into sorted student sub-directories, and named using a more robust filtered name schema based on the student.
The script supports a number of config settings and flags, which can be read about by using ./lab-format.sh --help
. The --cpp
flag will automatically detect and compile C++ projects, using a custom student makefile if provided, or a user-set compile command as a fallback.