ClassQue Master Server

This diescribes how to set up and use the ClassQue master server.

The master server is a server program that can be used to control or gain access to ibformation from a number of courses that use ClassQue. Currently, only one feather of the master server is supported, the resuming of previous classes. This allows a user of the simulator to access state logs that are kept on the server. The master server should be set up on the same host as the ClassQue server.

Setting up the Master Server

The master server should be running all of the time, but it is a good idea to restart it periodically. Here is a Linux script that can be used to start the server. It looks to see if the server is already running, and if it is, it kills the old one before start a new one. Only one instance can be running at a time.
#!/bin/sh
cd /home/classque/master-server
DATE=`/bin/date +"%Y_%m_%d_%H_%M_%S"`
FN=logs/mylog_$DATE
info=`ps -ef | grep java | grep classquemasterserver.jar`
id=`echo $info | awk '{print $2 }'`
if test "$id"
   then
      echo "Killing process $id" >> $FN 2>&1
      kill $id
      sleep 5
fi
umask 077
java -jar classquemasterserver.jar cqmsconfig.txt >> $FN 2>&1 &
Replace the cd line with the direcory that contains the master server. The file cqmsconfig.txt contains configuration information for the server. The format is described below.

The above script can be start from as a cron job. For example, if the script is named run-master-server, the cron entry:
0 2 * * * /home/classque/master-server/run-master-server
runs the script at 2 am each day.

The configuration File

The configuration file consists of lines, each containing a key word and a parameter. The first two lines describe the port number used by the server and the master server password. These are followed by any number of sets of lines describing the courses using ClassQue. A course description begins with a line containing the keyword course and is followed by lines containing the keywords directory, config, and logdir. Below is a sample configuration file containing information about 2 courses:
port 12345
password abcdefg
course  CS 1001
directory ../cs1001-spring2011
config run/cqserverconfig.txt
logdir logs
logdir logs/processed
course  CS 2001
directory ../cs2001-spring2011
config run/cqserverconfig.txt
logdir logs
logdir logs/processed

Resuming a session from the simulator

From the Teacher Stats window, choose Windows -> Playback -> Resume from server. This will pull up a window with fields to enter the server name, the port number and a password. If you use the master server password stored in the master server configuration file described above, you have access to all ClassQue courses. If you enter a teacher password, you get access to those courses using that teacher password.

Three menu item appear at the top of the window.

Once a list of log files is displayed, push the correponding Resume button, This pulls up a window giving information about the log file. Push the Start Resume to start processing the file. A progress bar shows the progress. In most cases the entire log file will be processed in well under a minute.

When the resume has completed, the Teacher Stats window should correpsond to the one displatyed at the end of the class. No students will be signed in. You can use the student list Windows -> Student List and add a student to show that students's window.