CREATECON

TOPIC CREATECON

CREATECON

ADDKEY CONTROL,UNDERGRADUATE,STUDENT Command:CREATECON SpecFile,SourceName[,ObjName,NewSpecFile] This command writes an IMP program that can be used to control a student subsystem. The command has been provided to help course supervisors make use of the mechanisms available to control their student system environment. Using these mechanisms the supervisor can control the commands and files accessable by the student, as well as providing an initialisation routine. In most cases the supervisor will not have to do any programming at all, he need simply call this command. However, where more complex control is required the program written by the command CREATECON can be used as a base for a more complex system.

The IMP program


The IMP program written by CREATECON contains the following entry points used by the student system : %externalroutine CSUPINIT %alias "S#CSUPINIT" ( %stringname Caller,Date,Time %integername Flag ) This routine first permits all the caller's files to the nominated supervisor and to all the tutors. It then checks to see if the terminal type is correct. If it is not then it calls 'terminaltype'. The routine then goes on to list the alertfile, if one is given, and finally it calls a command provided by the supervisor. %externalroutine ALLOWCONNECT %alias "S#ALLOWCONNECT" ( %stringname Caller,FileOwner,FileName, %integername Mode,Flag ) This routine restricts the files that the caller can access, regardless of whether or not they have read access to the files. The caller is only allowed to access the file if : - The file belongs to the caller or - The caller is a tutor or - The fileowner is on the list of allowed fileowners or - The filename is on the list of allowed filenames. %externalroutine ALLOWCOMMAND %alias "S#ALLOWCOMMAND" ( %stringname Caller,CommandName,Parameters, %integername Flag ) This routiine restricts the commands that the caller can access. The caller is only allowed to access the command if : - The caller is a tutor or - The commandname is on the list of allowed commands. It should be ensured that the object code for the IMP control source is inserted into an appropriate directory so that the system can access the above routines.

Altering the IMP program

There are two ways to alter or expand the IMP program written by CREATECON. The first is to simply edit the program produced by CREATECON. This is OK for one off alterations but rather cumbersome if this altered program is to be produced often. The second, and better, method is to edit the command routine itself to incorporate the changes. This is reasonable simple to do and details are given within the body of the program.

SpecFile


The name of the file that contains the specifications for the student control program, hence the student environment. The specifications in the file should take the following form - INITIALISECOMMAND = command ALERTFILE = file TUTORS = column containing user numbers of tutors. * marks the end of the list. Commands = column containing commands that the student is allowed to use. * marks the end of the list. Owners = column containing user numbers of file areas students can access. * marks the end of the list. Files = column containing filenames that student can access. * marks the end of the list. The specification file is case independant and spaces are ignored. It is also possible to list the specifications in any order. Note, however, that each keyword must appear, even if the assignment is null.

INITIALISECOMMAND =


INITIALISECOMMAND = commandname or INITIALISECOMMAND = This parameter specifies the name of a command to be called when the student logs on for a session. If the assignment is null then no command is called. The command to be called must be of the following form - %externalroutine COMMANDNAME %alias "C#COMMANDNAME" ( %stringname Caller,Date,Time, %integername Flag ) Where : 'Caller' is read by the routine and is the user number of the calling process. 'Date' is read by the routine and is the date in standard form. 'Time' is read by the routine and is the time in standard form. 'Flag' is returned by the routine. It should be given the value 0 if the caller is allowed to log on, 1 if he should be logged out.

ALERTFILE =

ALERTFILE = filename or ALERTFILE = This parameter specifies the character file that is listed to the student when he/she logs on for a session. This would typically contain course information for the student. If the assignment is null then no character file will be listed.

TUTORS =

TUTORS = userno1 userno2 ... ... * This column specifies which user nuumbers should be regarded as tutors. This means that these numbers will have normal unrestricted access to commands, files etc. Also, all the student files have read access permitted to this list of tutors. There is no limit to the number of user numbers in this list, but the '*' must always be present to mark the end of the list. If there are no tutors then the list would be empty. However, the '*' would still have to be present.

COMMANDS =

COMMANDS = commandname1 commandname2 ... ... * This column specifies which commands the student is allowed to access. This refers to user commands as well as the system commands. There is no limit to the number of commands in this list, but the '*' must always be present to mark the end of the list. If the student is not allowed to access any commands then the list would be empty. The '*' would, however, still have to be present.

OWNERS =

OWNERS = userno1 userno2 ... ... * This column specifies which file areas the student is allowed to access. Note that the student can not automatically access files in these areas, the file must also be permitted to the student. There is no limit to the number of user numbers in this list, but the '*' must always be present to mark the end of the list. If the student is not allowed to access any file areas, apart from his/her own, then the list would be empty. The '*' would, however, still have to be present.

FILES =

FILES = filename1 filename2 ... ... * This specifies which specific files a student is allowed to access. This can be used if it is not desirable to let the student access the whole file area in which the file is resident. Note that the student cannot automatically access these files, they must also be permitted to the student. There is no limit to the number of files in this list, but the '*' must always be present. If the student is not allowed to access any files, apart from his/her own, then the list would be empty. The '*' would, however, still have to be present.

An Example

An example SpecFile for a very restricted environment could look like this - INITIALISECOMMAND = SUPERINIT ALERTFILE = ERCC01:USERINFO TUTORS = * COMMANDS = LIST VECCE IMP ALERT * OWNERS = ERCC00 * FILES = ERCC01:DATAFILE ERCC01:CORRECTRESULTS *

SourceName


This is the name that will be given to the IMP program written by the call on CREATECON. It is this program that contains the routines for controlling the student environment. If a very complex control system is required then this program can be used as a base for the more complex control software.

ObjName


This optional parameter is the name to be given to the object code of the program written by CREATECON. If this parameter is not null then the program is compiled and the object code is given this name, if it is null then the program is not compiled. It is this object code that should be inserted into an appropriate directory ( the supervisor's SS#DIR ) so that the controlling software can be accessed by the system.

NewSpecFile


This optional parameter is the name to be given to a tidied up version of SpecFile. If this parameter is not null then a file with this name is created containing the SpecFile file in a standard format with all the lists sorted into alphabetical order. If the parameter is null then no file is created.