Skip to content

Commit

Permalink
adding/modifying scripts to process A3 grading allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kylelang committed Nov 4, 2024
1 parent 80d55f2 commit 9cd75db
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
29 changes: 29 additions & 0 deletions bin/divide_grading.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

### Title: Divide TCSM Grading
### Author: Kyle M. Lang
### Created: 2024-11-04
### Modified: 2024-11-04

### Description:
# This script should divide the grading load among the teachers as defined in the
# JSON file specified in the first argument.

### Usage:
# ./divide_grading.sh ASSIGNMENT_ALLOCATION.json SUBMISSION_DIRECTORY

SUB_DIR=`echo $2 | sed -e 's/\\///'`

for TEACHER in `jq -r 'keys.[]' $1`; do
echo "Processing $TEACHER's assignment."

if [ ! -d $TEACHER ]; then
mkdir $TEACHER
fi

for ID in `jq -r .$TEACHER.[] $1`; do
if [ -d $SUB_DIR/$ID ]; then
cp -r $SUB_DIR/$ID $TEACHER/$ID
fi
done
done
33 changes: 21 additions & 12 deletions bin/process_assignments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,43 @@
### Title: Process TCSM Assignment Submissions
### Author: Kyle M. Lang
### Created: 2024-10-03
### Modified: 2024-10-03
### Modified: 2024-11-04

### Description:
# This script should automagically process the assignment downloads from BB
# 1. Unzip the download archive and move the download archive to ./tmp/
# 2. Replace all spaces in filenames with underscores
# 3. Remove all BB boilerplate from filenames and start each filename with gNN
# 4. Parse the file names to extract the group numbers and create a directory for each group
# 5. Move all a group's files to their directory
# 3. Remove all BB boilerplate from filenames and give the files consistent names
# 4. Parse the file names to extract the group numbers/student IDs and create a directory for each
# 5. Move all relevant files to the matching directory

### Usage:
# ./process_assignments.sh BB_DOWNLOAD_FILE.zip
# ./process_assignments.sh ASSIGNMENT_NUMBER BB_DOWNLOAD_FILE.zip

function lss () {
ls --ignore=*.sh -p | grep -v /$
}

unzip "$1"
unzip "$2"

mkdir tmp
mv "$1" tmp/
mv "$2" tmp/

rename.ul --all " " "_" ./*

if [ "$1" -eq "3" ]; then
s0='s/^Assignment_3_//'
else
s0='s/^.*Group_/g/'
fi

for x in `lss`; do
f=`echo $x | sed 's/^.*Group_/g/'`
# mv $x $f
d=`echo $f | sed 's/[[:punct:]].*$//'`
mkdir $d
f=`echo $x | sed -e $s0 -e 's/_.*\\././'`
d=`echo $f | sed 's/\\..*//'`

if [ ! -d "$d" ]; then
mkdir $d
fi

mv $x $d/$f
done;
done

0 comments on commit 9cd75db

Please sign in to comment.