Server directory structure and file syntax

Introduction

The directory structure may at first seem a bit complicated, and maybe it is. However we believed it important to clearly separate the different files used. In addition one also have to deal with the inherited separation of a Web directory and a CGI directory. Further there was a need for a separation between the Courses/Subjects, to facilitate creation and deletion of individual Courses/Subjects. This rest of this chapter will explain the directories and the files with in them.

Fig 1. Overview of the directory structure


The CGI Directory

The CGI (Common Gateway Interface) directory contains all the perl script. The scripts are called from the question pages and from the applets. The directory must therefore be public. This directory may have different names on different servers, most common is cgi or cgi-bin. The name of the CGI directory must be added as a parameter value in the HTML pages containing the applets.

The CGI directory must also contain a file named "fileroot". This file should contain the path to the whole structure in fig. 1. For example if Directory Structure above is located under C:\  on the hard disk, the first line of the file "fileroot" should be:  "C:\Directory Structure".

See CGI Scripts


The Courses Directory

This directory contains sub directories for the individual courses/subjects. In fig. 1, SubjectI and SubjectII are names of courses. These names are assigned by the teacher when he/she creates a new course using the CreateCourseApplet. For the CGI scripts to work properly it is important that the directory name is Courses and that it is located as shown in fig. 1.

Courses and its subdirectory Courses/Users ate the only directories needed to be created on the server when installing the system. It is sufficient to have the rights set for the web server as it is the only user to access the files in the Courses directory and its subdirectories directly. And the web is also what is actually set to be the "owner" of the files/directories created through a browser/script (on the server ceibo, but not on for example elmer).

The Courses/Users Directory

This directory contains a password file and files describing the access that each teacher have to the subject. The password file is named "password" and have a syntax looking like this:
 

The passwords should be assigned to each teacher by the administrator, who should be responsible of creation and editing of the file.

The other type of files in the directory Courses/Users/ are files with extension ".acc". These files contains information about which courses belongs to which teacher. There is one ".acc" file for each teacher and the name of the file follow this syntax: "UserName.acc". An empty access file must be created by the administrator when he gives a teacher his/her password. They are then extended by the CreateCourseApplet when the teachers creates new courses or when other teachers grants them access to their courses.
 

The Courses/"SubjectName"/PageData Directory:

The PageData directory contains files describing their corresponding QuestionPages. These files all have the extension ".data". The .data files describes the QuestionPages using the following syntax:
 

The nice thing about this is that all different QuestionPage types have the same file syntax, this greatly facilitates the retrieval and creation of pages as well as the integration of new QuestionPage types. The differences between the QuestionPage types are dealt by putting in extra information in the QuestionText lines. This of course without breaking the general syntax described above.

QuestionPage type specific file syntax

cross

alt written One less desirable feature with using the syntax described above is that the teacher is not allowed to use # and @ in his/her questions. This however is easy to change in future versions.
 
The Courses/"SubjectName"/StudentAnswer/ Directory:

The students answers are saved in the Courses/"SubjectName"/StudentAnswer/ directory. Each question page has a file containing the answers of all the students who have answered the page. The file has the same name as the QuestionPage but with the extension  ".answer".

The syntax of the file is as follows:

The students are sorted in the file with respect to increasing cedula numbers. I.e. a CedulaNo = 100 will appear before a CedulaNo = 101.

The "#@[" delimiter separates the answers given to subquestion I, subquestion II, etc. The choice of the somewhat awkward delimiter is due to the fact that the delimiter isn't allowed to be in student answers for question pages of type written. "#@[" is if not impossible at least highly unlikely to exist in a student answer. This is of course not the right way to deal with the delimiter problem but it was easy to implement.


The WWW Directory:

The WWW directory is the directory responsible for holding the HTML pages and applets used by the students and the teachers. Even though the html pages containing the applets e.g. MakePage.html resides directly under the directory WWW, the .jar files containing the Java code are located in the subdirectory called distans (WWW/distans/). Online user manuals are found in a subdirectory named Docs (WWW/Docs/).

The other directory is described below. One should note that the QuestionPages are put in a separate directory to allow the teachers to create directories for the actual learning material. A directory named for example LearningPages could be located directly under "SubjectName" making the path to the page look like this WWW/"SubjectName"/LearningPage.

The WWW/"SubjectName"/QuestionPages directory:

This directory contains the QuestionPages created by the teacher. The teacher should make links to these pages for the students to be able to find them.


The JS Directory:

The JS directory contains static files used by the makeCross.perl, makeAlt.perl and makeWritten.perl to create the QuestionPages. The contents in the three files cross.js, alt.js and written.js is the HTML/JavaScript code that is common for all QuestionPages of the corresponding type. The reason that separate files are used (and that not everything is put in the makeX.perl) is that it is easier to modify the .js files than the scripts and that it is quite a job letting scripts generate HTML/JavaScript code (so the more static code that can be used, the better).