Coursework Definition File

This file defines sufficient details of a coursework so that a ExerTran application can be built for the coursework. The basic structure of a definition file is held in the "cw_def.tmpl" file in the teplates directory, "src/templates", see . The file defines a set of name-value or keyword-value relations which are used for keyword substitution of the name by the value in ".tmpl" template files and in initParameter files, so that there is no need to edit files by hand in order to customise a coursework or ExerTran system.

The contents of the "cw_def.tmpl" file is shown in Figure 1. When a coursework is built with "ant", a copy of this file is created in the coursework directory with its name constructed from the coursework name extended with ".def", e.g. "D2.def", see . This file needs then to be edited with appropriate details to customise the coursework. In the figure, any of the strings after the "=" symbol can be modified and those strings between "@" symbols nust be changed as these strings are merely place holders and/or comments on what should go there.


        
install=v5install
tomcatDir=@path to TOMCAT_DIR@
systemName=ElecTran
dbServer=mysql
dbClass=MysqlInterface
dbDriver=org.gjt.mm.mysql.Driver
dbHost=@database_host_name@
dbPort=@database_port_number@
dbName=@name of database@
dbUsersTable=@name of database table with usernames passwords and roles@
dbQuestionsTable=@name of database table with question list@
dbMarksTable=@name of database table with marks@
tomcatUser=@name of read-only user for https login checking@
tomcatUserPassWord=@password of read-only user for https login checking@
anonymousLogins=@true or false depending on if anonymous logins are allowed@
maxNumberAnonymousLogins=@number of simultaneous anonymous logins@
systemManagerEMail=@e-mail address of manager@
SMTPaddress=smtp.cs.ucl.ac.uk
mailFromAddress=@e-mail address of lecturer@
dbLoginName=@user name with write permission on database tables@
dbPassword=@password for user with write permission on database tables@
dictionaryFile=/usr/dict/words
dictionaryWordCount=25143
        
      

Figure 1. The Question Document DTD

The substitution methodology used is the "filter" one from "Ant", where the text in a file to be substituted is tagged by @ symbols, e.g. "@TOMCATUSER@". When a file that has substitutions made to it is moverd from its "src" directory to the Tomcate application directory, the substitions are made through the use of Ant "Filter Sets". The filter set, "primeFilters" in the Aby "build.xml" file, is generated from the coursework definition file: the words substituted in the text are the capitalised versions of the names on the lefthand side of the "=" in the definition file, e.g. "TOMCATUSER" for "tomcatUser", "DBSERVER" for "dbServer". Thus, the statement "dbClass=MysqlInterface" in hte definition file would see all oocurences of "@DBCLASS@" in template files (".tmpl" files, and initParameter files) replace by the "MysqlInterface". The individual keywords defined in the definition file are as follows:-

install

This defines what sort of installation "ant" is to perform. Currently "v5install" is the only value allowed here.

tomcatDir

This defines the full directory path to the Tomcat install directory.

systemName

The system name: currently expected to be ExerTran.

dbServer

The name of the database system used: currently only "mysql" is supported, but it should be possible to use "Oracle" or any other fully featured database.

dbClass

The name of a Java Object that defines the interface to the database defined by "dbServer". This object inherits from "DBConnection.java", which defines the methods to be provided by this object. The coursework system interacts with the abstract methods defined by "DBConnection.java".

dbDriver

The name of the package that defines the java interface to the database defined by "dbServer".

dbHost

The name of the host that is ruuning the instance of the database accessed by the coursework, e.g. "sonic.cs.ucl.ac.uk"

dbPort

The port number on which the host machine running the database listens for requests from the coursework.

dbName

The name of the database within the database server used accessed by the coursework.

dbUsersTable

The name of the users table within the database that holds user names, passwords, and roles.

dbQuestionsTable

The name of the table within the database that holds the question list, defining the questions and topics that make up a coursework.

dbMarksTable

The name of the marks table within the database that holds marks awarded.

tomcatUser

The name of a user account on the database server that has sufficient privilege to read the users table, so that user names and passwords can be checked when a session is set up with the coursework.

tomcatUserPassWord

The password of the user account on the database server defined by "tomcatUser".

anonymousLogins

Set "true" or "false" as anonymous logins to the coursework are allowed or disallowed. Anonymous logins can see an answer the questions, but marks are not stored to the database.

maxNumberAnonymousLogins

The number of simultaneous anonymous logins that allowed when "anonymousLogins" is set "true".

systemManagerEMail

The address of the system manager for user e-mails to be sent to.

SMTPaddress

The address of the SMTP server for mail to be sent via, e.g. smtp.cs.ucl.ac.uk.

mailFromAddress

The e-mail address to be used ad the "From" used n e-mails sent out by the system, e.g. user name and password e-mails.

dbLoginName

The name of a user with write permission to the database so that changes can be made to the database tables.

dbPassword

The password for the "dbLoginName" user.

dictionaryFile

The name of a file with a large number of words which can be used to generate user passwords. The password generator takes 2 words at random from the dictionary and joins together subsets of the selected words. On some Unix machines, "/usr/dict" contains a suitable large number of words.

dictionaryWordCount

The number of words in the "dictionaryFile": this really used be calculated by the program. On a Unix system, the "wc" command can be used to get this value for a file.