Skip to content
Snippets Groups Projects
mark1.sh 1.08 KiB
Newer Older
William Waites's avatar
William Waites committed
#!/bin/bash

CS=/home/xgb21195/teaching/cs101
TOK=`cat ~/.gitlab`

mark1 () {
    date 1>&2
    echo "Marking Assignment 1 for ${dsname}" 1>&2
    echo "Marking Assignment 1"; echo
    marks=0
    nfiles=`find . -type f | sed '/^\.\/\./d' | wc -l`
    find . -type f | sed '/^\.\/\./d' | while read f; do
        touch ${marking}/assignment-1.files
        if grep -q 'I am the psychotherapist.  Please, describe your problems.' "$f"; then
            touch ${marking}/assignment-1.emacs
        fi
    done
    if test -f ${marking}/assignment-1.files; then
        echo "    Found some files... 20/20 marks"
        marks=20
    else
        echo "    Found no files... 0/20 marks"
    fi
    if test -f ${marking}/assignment-1.emacs; then
        echo "    Found an interaction with the Emacs doctor... 10/10 marks"
        marks=$(($marks + 10))
    else
        echo "    Found no interaction with the Emacs doctor... 0/10 marks"
    fi
    echo
    echo "${marks}/30 marks in total"
    echo "${marks} marks" 1>&2
}

dsname="$1"
student="${CS}/students/${dsname}"
marking="${CS}/marking/${dsname}"

mark1