#!/bin/bash # marm_sql -- gives a command-line interface to various useful Marmoset tasks # such as submission download, mark download, and submission testing # Original version by Huma Zafar for CS 136 # Modified by Sylvie Davies for CS 241 (Fall 2012) # Best viewed with a terminal width of 120 columns ### WARNING: This version of the script has not been tested with courses ### other than CS 241. Before using one of the functions, read through it ### to see if there is anything you need to change. export HOME=/u/$(whoami)/ CONFIGURE= DOWNLOAD= LATE= MARKS= DEFAULT_STUDENTS_FILE_LOCATION=/tmp/$(termcode)"_students" STUDENTS=$DEFAULT_STUDENTS_FILE_LOCATION TEST= CURRTERM=$(termcode -l) # -l gives the term format that Marmoset uses COURSENAME=$(whoami | tr '[a-z]' '[A-Z]') COURSE_PK=$(echo "select course_pk from courses where \ semester='$CURRTERM' and \ coursename='$COURSENAME';" | mysql -N --raw) ############# # Functions # ############# # Display either a long or short usage message depending on if the -h option was given usage() { if (( $LONGUSAGE )); then cat <