#!/bin/bash # J.Kobus 04/2020 ver. 1.00 # modifications: 02/11/2020 26/01/2022 31/01/2022 bn=$(basename $0) bold=`tput bold` underline=`tput smul` normal=`tput sgr0` pid=$$ # a teacher should set the following variables asheet= qsheet= #asheet=so-exam-1.txt #qsheet=http://jkob.fizyka.umk.pl/so-exam-1-qs.pdf #server=ameryk.fizyka.umk.pl server=localhost #wwwserver=http://grader.fizyka.umk.pl wwwserver=http://jkob.fizyka.umk.pl ############################################################################################# function help { cat <] start $(basename $0) -d $(basename $0) -g $(basename $0) -d -u [-s ] [-a ] \\ [-q ] [-r ] start $(basename $0) -g -u [-s ] [-a ] \\ [-q ] [-r ] start $(basename $0) clean|cont|install|show|ss|status|stop ${bold}DESCRIPTION${normal} ssctl Bash script can be used to record an exam. It takes, archives and displays snapshots of the whole screen at randomly generated intervals. If dirname or reponame is defined the snapshots are copied into the specified directory on a server together with the exam's answer sheet (if specified). In case reponame is defined the answer sheet is added to repository and then regularily committed and pushed. Programs animate, convert, import, mogrify from the ImageMagick suit are used to make and display screenshots and manipulate the frames. ${bold}COMMANDS${normal} clean remove all ss/*-${import}.${format} files clone clone the repository to the working directory resume|cont continue taking screenshots (and sending them to the repo) every $range seconds (on average) convert merge all *-$import.${format} files into the single ${import}.${format} one install copy $(basename $0) in /usr/local/bin/ and install additional packages (Fedora and Debian/Ubuntu distributions are supported) pause suspend taking snapshots but keep the ssh connection to the server show display the values of several variables: \$user, \$server, \$repo, etc ss begin automatic slideshow; fps variable should be used to adjust the rate of display. start begin taking screenshots every $range seconds (on average) stop stop taking screenshots ${bold}OPTIONS${normal} -a use this option to define the name of a file to be used by a student to write down answers to the questions provided. This text file will be copied (at the same time as screenshots) to the student's git directory, committed and pushed. -d "ssh -fN -o ControlPath=$controlPath -M @" is to be executed to establish a master connection which will facilitate the user to login into the server and access the specified directory and to upload screenshots to its ss subdirectory -D