This is the report for the BSc project “Java code in AIM” by Stefan Schaefer. It wassupervised by Dr Grant Keady and Dr Dirk Hermans.

Alice/AIM is a computer-aided assessment (CAA) package which delivers, over theWeb, mathematics questions to students, and marks them. A screen image is given onthe next page as an example. See also:

http://www.mat-nt2.bham.ac.uk:8080/index.html

This project had as its aims:

1.

To explore how AIM works, particularly the Java classes involved.

2.

To provide some further tools-

written in Java-

which can be used by theMathematics Department staff who use AIM in teaching.

An HTML save of this document, and the source code for the Java written during thisproject is on disk. It will be available, for the next year anyway, from University ofBirmingham Maths Web pages. This may be from a link at

http://www.mat-nt2.bham.ac.uk:8080/staff.html

At least until the end of June the pages will be available via

http://www.mat.bham.ac.uk/gkeady/Schaefer/index.html

Along with some other CAA packages, the mathematics in AIM is underpinned by amass-market Computer Algebra (CA) package. In the case of AIM, this is the Maplepackage:

http://www.maplesoft.com

The screen image shows what AIM system looks like to a student.

Staff perform some other functions in the system. A course administrator is able toaccess the records of students, set due dates and so on. An AIM author is able to write(in a simple mix of Maple and HTML) the “question files” which the AIM systemuses to generate the screens.

Alice/AIM is free and open source. Its usage in University Mathematics Departmentsaround the world is increasing. See the URLs given in the Section on AIM for moredetails.

4

2

Computer Aided Assessment in general

Present CAA programs-

and the only ones we treat-

deliver the materials across theWeb. They provide:



Individualised questions for each student



Automatic marking



Continuous availability to the students

CAA programs exist for subjects other than Mathematics. However, first yearundergraduate level manipulative mathematical tasks may lend themselves to thegenre better than some other subjects (like history, or English literature, etc.). Themathematical answers classify as “right” or “wrong”, and the tests for this are simple.

Here are some notes on the bulleted points above.

Individualised questions for each student:

To prevent cheating it is important to createsimilar but individualised questions for each student. This does not mean we have tocreate completely new questions for each student but merely to change values of some‘seed’ variables. In practise, if you look at the (AIM) code for a particular questionyou will see the creation of random values.

Automatic marking:

The program must be able to calculate the real solution for eachindividualised question. Also it must be able to compare this solution with the answergiven by the student. The CA underpinning the mathematics is important for boththese tasks.

Then

the student’s solution must be given a numeric grade, dependent on the weightof this question, the correctness and the history of (maybe wrong) attempts on the wayto a correct answer.

Continuous availability to the students:

This is achieved though thechoice of a web-based program. Thus, students can login everywhere and every time (with internetaccess).

There is one administrative detail worth noting here. Normally assessed work has adeadline. So the CAA program should also allow such deadlines to be

set andenforced. No marks should be allowed for answers submitted after the deadline.

The items above are relevant to the student users. However the CAA system has to beput into use by academic staff. Thus, the following is important.

Authoring-

Easyextension with new questions:

This is very important. If it were to be

nearly impossible to add new questions, such a CAA program would be so limited asto be useless. Thus there must be a way to add new questions, and preferably it shouldbe easy.

Administration:

Ideally (and in some other CAA systems in current use-

CalMaethand WebLearn being two examples) administrative matters like handling marks,

5

issuing passwords and so on should be independent of the subject. Questions inChemistry and so on would

be delivered in a CAA which felt similar. Ininterdisciplinary areas like Engineering, this really is helpful for the students. Forexample, WebCT is used in several departments in the University of Birmingham(and, of course, it is used in very many universities internationally). Ideally,experience with the administration of CAA should be able to be shared acrossuniversity departments, even if the authoring of questions remains tied to the packages(like Computer Algebra in the case of mathematics) appropriate to the department.

At present, AIM uses its own system for administration-

marks and passwords. Thishas advantages in connection with AIM being complete and open source, butdisadvantages in that costs in providing good code for the admin tasksis only spreadover a small part of the CAA-using community.

In principle, there should be no major problems in adapting AIM to run so that theadmin chores (mark keeping and so on) were to be done by WebCT, for example.

Graphic 2.1: AIM in use at the University of Birmingham

6

3

Further details on AIM

There have been expository articles about AIM. At

http://allserv.rug.ac.be/~nvdbergh/aim/docs/

there is an overview of the AIM system and documentation for authoring questions.There are also, at the same web site, ps and pdf files of the paper by Kolokolnikov etal. listed in our references.

Neil Strickland has a new version of AIM (aim-tth), which uses tth (and another Javaclass file associated with it). However, much of the material he has written-

see thereference list-

is relevant to the form of AIM

which is used here at Birmingham. Inparticular there is a lot of documentation on the Maple functions at

http://pc007162.shef.ac.uk/aimsource

4

About the project

4.1

Getting Started

Before starting this project, I had had no contact with aim. I first had to

understand,how it works. This was not easy because there was essentially no documentationgiving a good overview of the program itself.

In this situation, the only way to progress was to rummage through the aim sourcestrying to understand how it works,and this is what I did. Since, at the beginning of theproject, I had no access to a web server, I started with the Maple.class. SimultaneouslyI started learning Maple.

My very first test program merely had Java calling out to maple and just sending theoutput as text strings to stdout. We considered the issues involved in writing, via Javaapplets, a web based viewer (program to run question files) but did nothing on this asthere are security obstacles (as, from applets, we couldn’t write files, couldn’t runother programs). So, during October-December, I wrote a viewer using the AWTclasses (see the viewer chapter).

4.2

Later Progress

When, in January 2002, we got access to a web server in the Learning DevelopmentUnit (LDU) and an update in the aim version, I started learning servlets. Afterunderstanding the Alice class I started writing the newer versions of the viewer. I alsomodified some of the AIM classes (see later chapters).

However I think that understanding how aim works, and, most importantly, fillinggaps in the documentation explaining it, was more important than writing this viewer.Because of this I wrote the next chapter, explaining how AIM works. After this, therewill be a detailed description of the viewer.

In the 7th

chapter, there willbe a description of the other changes and programs Iwrote.

7

5

Maple-

JAVA-

HTML-

AIM

As already mentioned, AIM is based on Maple and Java. It also uses HTML and itsown simple authoring language for the question files, which we will call ‘AIM-authoring-language’. (‘AIM-authoring-conventions’ might have been a betterdescription. One authors in a mix of HTML and maple.) Thus, in AIM, there isinteraction between three different languages, and two major items of software(tomcat web-server and maple). In this chapter I am going to explain how AIM worksand how the different parts interact with each other.

The first part, that every user sees, is the HTML part. All communications betweenthe user and AIM happen on a web page. When the students start aim, they go to theAIM index.html page. There they select their course and insert username andpassword. They then select a quiz and get a web page with all the questions, andappropriate answer areas.

The only part where they must be aware of maple is when theyinsert the answer.Their answers must be valid maple expressions.

But there is more than the HTML part. A Java and Java-servlet part communicatebetween HTML and Maple, and Maple, in turn, processes the AIM-question files.

We have used AIM under the Tomcat

server software.

The programmers (Norbert van der Bergh and Theodore Kolokolnikov) of AIM haveput the main work onto the maple code. This means that most of AIM’s work (fromthe writing of Web pages through to the administration of marks) is done by maple.The java part is only used to call the corresponding maple functions and to return theanswer to the user (via the HTML page to the browser).

There is a hierarchy in AIM: “courses” contain “quizzes”, and “quizzes” contain“questions”. It is a “quiz” which contains the Submit or Validate button, and whichinitiates the marking. A quizfile is simple, merely grouping the questions into thequiz. The AIM question-and-quiz author compiles them to “maple readable code”which are saved in the appropriate compiled maple, .m files.

Server

uses

User machine

Browser

Java servlet

Maple

precompiledQuestionfiles

Java

(Maple.java)

calls withparameters

returns

HTML page

calls with hiddenvalues

returns new page

Graphic 5.1

user files

8

5.1

The Maple-part

As already stated, the main work of AIM is done in the maple functions. They becomethe web input to the Java part. All the following functions are performed by Maple:

There are two main Maple functions, populate and teacher. The populate functiondeals with all user requests, like displaying quiz pages, controlling answers and so on(mainly called over the start page, index.html). On the other hand the teacher functiondeals with all teacher options, like creating new questions, new quizzes, adding usersand so on (mainly called via the staff.html page). Much of the Maple code used in thestaff functions is common with code in the student functions.

To know which page is needed next, depending on which page a button was pressed,maple prints many hidden parameters in the HTML files. With the help of them Maple

decides what to do. For more information about these parameters, see chapter 5.3 TheHTML-part.

In the next part I’ll explain in more detail,how these two main functions work.

5.1.1

The populate function

`aim/public/populate`

This function handles all non-administration operations. It starts building up the page.At every step it checks some variables and either continues or prints some ‘errors’ andstops. For example, if there was no password inserted (and no guest access) it prints anew password check and stops.

Here are all steps of this function:

1.

It transforms all parameters to valid maple values.

2.

It creates the head and first lines of the html pages. It prints the start of the formwith the first values. This are Quizsubject, timestamp, cmd, QuizName (ifneeded), StudentID (if needed).

3.

If the password was wrong, it prints an error indication and returns.

4.

If no quiz is selected, it offers a selection of all quizzes, and returns.

5.

If no StudentID is given, it prints textareas for StudentID and password andreturns.

6.

It loads the student quiz file (old records), if needed. And it also initialises somevariables.

7.

It reads the question filenames.

8.

It performs some error checks. In some courses guest access is disallowed.Showing solutions is only available after the appropriate deadline.

9

9.

It generates the quiz.

10.

It outputs the quiz. Simultaneously it re-computes the marks (if needed).

11.

Finally, it saves thenew answers / marks, if needed.

5.1.2

The teacher function

`aim/public/teacher`

This function handles all teachers’ operations, i.e. all options available from the pagescalled staff.html or teacher_page.html.

It first transforms all parameters into valid maplevalues. Then it has a big IF / ELIFblock, where it checks the action parameter. For each parameter it does theappropriate steps. If you want to add a new parts, just add a new ELIF with your ownparameter.

5.2

The JAVA-part

The Java part has two main classes, the maple.class and the Alice.class. The mapleclass is to communicate with Maple, i.e. starts maple in the background, pushescommands to it, and returns the maple answer. The Alice class is a servlet. It showsthe HTML pages and handles all extended HTML commands, like using buttons,reading the answer strings, and so on.

5.2.1

Maple.java

This function starts a maple program, is able to parse strings to it and reads theanswer. There are three methods.

The first is the constructor. It starts a maple programin the background. This uses the-q parameter (q for quiet) so that there is no unneeded response. The start string has tobe changed depending on the operating system and the search paths.

The exec method has three parameters. The first is the string which is executed inmaple, the second is a PrintWriter, in which the maple answer is printed. The thirdone is a boolean parameter (if not specified, false). If this parameter is true, thefunction transforms the output, so that it looks better as HTML. (e.g. x[1] becomesx<sub>1</sub>).

5.2.2

Alice.java

This is the servlet. It handles all interactions with the HTML pages. Whenever abutton is pressed, this class is called. Then it reads all hidden variables from the page,all input lines (if needed). It transforms these parameters to valid maple inputs (usingAliceServer class) and then pushes this to maple (using the maple class). For moreinformation regarding the parameters on the HTML pagessee chapter 5.3 The HTML-part.

10

After this, the maple functions calculate the new HTML page and print it out. This isgiven back to the servlet, which is then returned to the browser of the user, whichdisplays the new page.

5.2.3

AliceServer.java

This small class is used by the Alice servlet. It has some important functions whichare linked to the operating system. So, if you change the operating system, you onlyneed to change this class. It is useful to have matters arranged like this as it is mucheasier tocompile a new Java class than a servlet class.

writes the log file. The subject is thecourse / teacher name (i.e. the subdirectory in the aim directory) and s is the sting,added to the log.

There are also some more functions transforming the strings to valid mapleexpressions. For example one function replaces all backslashes in a string specifying adirectory by two (because, if Java prints this string to Maple, one backslash would bea special character, but not a backslash). Another function transforms parameters tovalid maple list, by adding ` and related processing.

5.3

The HTML-part

There are two main entrance pages. The index.html and the staff.html. Via the indexpage, all students can reach the question files, the staff page is only for the teachers, toauthor and to administer the quizzes. These two pages are saved in HTML format. Allquiz pages are created by maple and returned via the java servlets.

Here is a list of the important (hidden) variables of the HTML pages:



cmd:

This value specifies the maple function to call. If not set, it is assumed to bepopulate.

At the moment there are only two main functions called, populate and teacher. Ifthe maple code becomes changed (e.g. split in more functions), this parameter hasto changed. Also adding new functions / pages is easy by changing this variable.

In fact, the function `aim/public/cmd` is called, with all the other variables asparameters. For example:`aim/public/populate`('`StudentID`'=[`1`],'`QuizName`'=[`quiz1`],'`timestamp`'=[`10000000`],'`QuizSubject`'=[`cours1`],'`pwd2`'=[``],'`pwd`'=[`password1`]);

This call would create a quiz page with the quiz “quiz1” in the directory“/aim/cours1” for the Student with the ID “1” and the password “password1”.



QuizSubject:

This value specifies the course, i.e. the directory with all data. It is the

general topic (i.e. the name of the link on the index page) but also the directory/aim/QuizSubject

subject_dir = AIM_HOME/QuizSubject/

11



QuizName:

The name of the Quiz. This is also the parameter for the path of theQuiz. All Quizzes are saved in a pathA_ followed by the quizname, in thedirectory of the course.

quiz_ans_dir = AIM_HOME/QuizSubject/A_QuizName



StudentID:

The student id / name. These ID’s are registered by the teacher for thecourse-

or not, if the quiz is public. For each ID aim creates a

file of the samename in the directory “_AIM_StudentProfiles” in the course directory, where thepasswords are stored. Further more there is an other file, named like the id, with an.m extensions, for each quiz. They are saved in the quiz directory.

Inthis file, maple saves the last answer of this “id” (student, or guest, or …). Alsoit saves a bad_trial. This are all wrong answers, given so far. They are used tocalculate the mark. (only this file is used for marking, not the AlicServer.log).

quiz_ans_dir/StudentID.m



pwd:

The password.



pwd2:

Is used for new passwords-

the contents of the second password area.



timestamp / seed:

is used to prevent cheating like using the back button of thebrowser.



WebInput:

The values of this parameter are all inputs of

the Questionfiles. TheWebInput is formatted as Maple lists of lists. The complete input is inside of []brackets. Also each question, and in each question also each subquestion. Forexample the input of a one question quiz would look like this: [[[`Input`]]]



submit:

This value specifies which button was pressed. Is used to determine if the‘Validate’ or ‘Validate and show solutions’ button was pressed.

In additional, these variables are used for the teacher function:



action:



`log` / `log2`: Displays lines from the log file.



`delete_quiz` / `delete_quiz2`: Deletes quizzes.



`delete_question` / `delete_question2`: Deletes questions.



`modify_init` / `modify_init2`: Modifies the init file.



`modify_question` / `modify_question2` / `modify_question22`: Createsthequestion files. Since there are three pages there are three differentparameters. The modify_question2 and modify_question22 are creating thequestion.m files and linking them into aim. So they both have to beperformed in order to insert pages automatically. (This might be donethrough Java. See viewer chapter for more information.)



`modify_quiz` / `modify_quiz2` / `modify_quiz22`: The same as forquestion creation, but for quizzes.

Since there exist other sources about this topic, I will only briefly explain

the Aim-language through an example. The authoring which created the question shown in thescreen image at Graphic 6.1 is as follows:

h> coeff1_:=rand(1..5)();coeff2_:=rand(1..15)()/rand(1..7)();

h> set1_:={sin(coeff2_*x),cos(coeff2_*x)};

h> f1_:=coeff1_*set1_[rand(1..2)()];

h> sol1_:=2*Pi/coeff2_;

t> Find the Fundamental period of the following periodic function

p> f1_

t> <b>Remember</b> that your answer must be given in radians and NOTdegrees, and should be expressed in terms of Pi (e.g. 5*Pi/13).

s> [(ans)->`aim/Testzero`(ans-sol1_),sol1_]

The main flags are t, h and s, where:



t> This prints the text to the user.



h> This is the flag for hidden variables. They are used to calculate the quizand solution in Maple. The user can’t see them.



s> This is the

solution flag. They are given as a Maple list of two elements.The first one is a test function. It is used to test whether the given answer iscorrect, or not. The second list element is the teacher solution.



p> This is for Maple prints.

13

6

The question viewers

The aim here was to create a tool for checking the question files. This is useful sincethere are several steps to load a question file into aim. You have to compile them firstand after this, load them into a quiz. (But since it is not a good way to

directly loadthem into a running course, you need to create a new one, or in any event use a‘scratch’ course.) Allowing for testing and recompilation, there are many steps. And,for each step, you have to insert the teacher password again.

So it was sensible to write the new viewer program.

My first attempt was separate from AIM, and from any Web server. However, thisfirst attempt was not a practical tool, as we discuss soon.

In a later version I rewrote the program so that it uses the aim functions to

create allquiz pages. This has some advantages and some disadvantages. The main advantage isthat the pages always look like the user would see them. Also it is always on the sameversion level as aim, i.e. if it runs in the viewer it runs also in aim. On the other hand,it has the disadvantage that it always needs aim, i.e. that it must run on a server whereaim is also running. Also the question files must be on this server.

6.1

The first version

The first version (Oct-Nov 2001) of this program was Java based. This means, thatJava decomposes the question files. A Maple class file, almost the same as thatactually used in AIM was used too. The maple codes in the AIM-question file werepassed to maple: maple generated the random numbers to define the question,computed and marked the answers. There was a Java main, and use of the AWT(“Abstract Windowing Toolkit”) classes.

Originally it was planned to rewrite and extend this to a web based application. Anexample class file (MyFirst.java) is available in the AIM distribution to help with this.However, it would, as an authoring tool, never have developed to be as effective asmy later version described in the next subsection.

(Dr Keady also had stand-alone “question checkers”. These merely run the AIMquestionfiles through a Perl program which produces code which can be read straightinto Maple. The output in Maple doesn’t show the text, and is somewhat ugly. TheJava AWT classes at least are aesthetically preferable.)

The first version was really an exercise,illustrative in a simple way, of how the Mapleclass works. It was, however, also an exercise while we awaited a Web server to usefor more detailed exploration and development of AIM. A Web server with AIM foruse in this project was made available through the Learning Development Unit (LDU)of the University of Birmingham. We were able to begin using it in January 2002.

14

6.2

The new version

The new version of the question viewer is different. It uses all the aim classes to createthe question. Or, to be moreprecise, it lets aim create the question page.

6.2.1

How does it work?

During the normal use of aim, java converts the parameters from the web input andcalls maple (aim) with them. These functions create the HTML, which java reads andpasses back to the browser. So there is no direct connection between aim and the user.There is always Java between.

So I used Java to simulate the web input of an user. In other words, I call maple withthe same parameters as if it were called in the normal way. This is the main principleof the viewer.

However, it is not that easy. Of course, the first problem is to understand how theparameters work because you have to manipulate them. For example the filenames,path or the passwords must be changeable.

On the other hand, you have also to attend to the details of file management. The usershould be able to open files and save them. And, of course, to edit them. This was notas easy as it sounds, since the servlet can’t save information (like the file name) fromone call to the other in variables. It would be possible, but very difficult. It would needa kind of database. Hence I’m saving the filename now on the HTML page, in thesave-text area.

There was also an other problem. Through the two windows (frames), it was notpossibleto have only one text area for the file name. Because the open button and thesave button were in different forms. So they could not use the field of the other one.However it was needed to specify the save filename. So I created two separated areas.

These

are the main functions of the viewer:



init: This is the initialisation function of the servlet. It is called only once at theserver start. It reads the Maple call from the aim.init file.



doGet: This function returns the viewer page on a get-call. I.e. it

is called when theservlet is started using a link (instead of using a button, which would be a post-call).



doPost: This function is called when using a post-call. It calls the correspondingfunction, depending on the button used. So, for example, if youuse the openbutton this function calls the onOpen function.



onOpen: Handles the open button. This means, this function creates a new pagesimilarly to the start page, but with the contents of the file in the text area.



onRun: Runs the question specified by the main text area. For this, it first savesthe question (viewertmp in viewer-path). Than it uses AIM functions to create them file, the quiz and then running the quiz.



getMapleAnswer: This functions executes the parameter in Maple and returns theanswer as String. Needs also as parameter an initialised Maple class.

15



createOptions: Uses the AIM functions to create the option file. First parameter isa Maple class, second the course name and third the password.



createQuestion: Uses the AIM functions to compile a question. First parameter isa Maple class, second the course name, third the password and fourth thefilename.



createQuiz: Uses the AIM functions to compile a quiz. First parameter is a Mapleclass, second the course name, third the password, fourth the filename (of thecompiled question file) and fifth the quiz name. This function can only createquizzes with one question.



saveFile, readFile: Functions for accessing files.



onOpenAll, onTestAll, onDoAll: These functions are for the additional function ofthe viewer (see 6.2.4 A useful augmentation of the viewer’s functionality). Onprinciple they work as onRun / onOpen, but for more then one file.

6.2.2

How to install the question viewer?

To install the question viewer there are three things to do.



Create a directory viewer in the aim directory in the server.



Copy the viewer.class in the WEB-INFO/servlets directory of the webpagedirectory (on the server).



Copy the viewer.html to the webpage directory.

The directory has different uses. All necessary information is saved here.

To use the aim functions to view the question, the viewer has first to create a quizwith it. For this it creates a new teacher password with all other standard options.Then it creates a quiz and binds this question in. After this it can display the question.

To create a teacher password, and a quiz with question or questions, aim needs adirectory to save some information, like quiz and question names. It saves there thelog file and the answer files for each user.

Since the vieweruses the same question name for each question, all the log files aresaved in the same file. This means, the history will not only have all the last attemptsfor this question but also for all other questions used. To delete the old history it isneeded to

delete the corresponding file. But this is not a problem. All files in theviewer directory can be deleted every time. As soon as run is pressed again they willbe created again.

The viewer.html is only used to create the two independent parts of the html

part. Inthe upper frame there is always the viewer page.

As soon as run is pressed, the quiz page, how the user would see it, is displayed in thelower frame. The author can next test that everything on this page works. So you caninsert solutions and test via the usual (Validate, etc.) buttons. Since the page is split,this has no effect on the viewer page. So you can run a question file, test it, and editthe question file at the same time.

16

The viewer.class is the program itself. It displays the viewer

page as the user sees it. Italso loads and saves files if needed. To run the question it uses different aim functionsto create the option file, the quiz and to bind the compiled question in the quiz. Afterthis it calls the aim/public/populate functionto "run" this page. This means thisfunction creates the page how the user would see it. Of course, it creates also thebutton on the page how they would be in normal use. This means that by using thebuttons the "normal" aim process is running and the new

pages are created,independent of the question viewer. For this reasons the page is split.

6.2.3

How to use the question viewer?

While programming the question viewer I tried to make the user interface as simple aspossible. So I think it isn't very difficultto use the viewer.

The steps are as follows.

1.

Start the question viewer. For this you have to open the viewer.html. This is donethe same way like starting the aim main page (index.thml) or the staff page(staff.html) but replacing the file to viewer.html (alice_url/viewer.html).

2.

Now you see the viewer page. In the upper part there is a small text area and theopen button. To open a file just enter the name of the question file and press theopen button (note that the question file must be on the server, aspointed outearlier). If the file name was correct, the file contend should be displayed in themain text area, otherwise there stand the text "could not open file "filename" ".

The main text area is used to display the file contents. Here you can also edit thequestion file and save it back later. Of course you can also write a new questionfile here and save it later. By using the open button, the contents of this will bedeleted. By using the save button, all text in this are will be saved to the specifiedfile. By using the run button, the content of this will be used to run. This will bedone regardless of if it has been saved, or not. The file names in the open and savetext area have no influence on the run function.

Below this text area there is a small text area next to the save button. The contentof the main text area will be saved in the file name specified here, if save ispressed. If used the open button the content of this area will be changed to thefilename opened.

3.

The run button runs the content of the main text area and displays it in the lowerhalf of the page.

17

6.2.4

A useful augmentation of the viewer’s functionality

This latest version has an additional function. It can create many one question quizzesautomatically. This is used to createsample quizzes from all question files. Sostudents can train without marking.

Through the year, staff in Birmingham University’s Mathematics Department havecreated many question files (following the questions of Exercise Sheets used in earlieryears forhuman-tutor-marked questions). Not all of them were used. In order to helpthe students preparing for the exam it was decided to make many quizzes, each ofthem from one of these question files. However, we also wish to check the questionfiles before the

quiz generation.

So I created a new function for the question viewer, which shows many question filesat once, and then creates quizzes from them. In doing this there are some differentproblems. The first is, you need to know where all the question files

are, which one toload. The second one is, in order to bind the quizzes in the correct courses, the teacher(course) name and the password is needed. Also there should be a possibility to notcompile all questions in the directory.

To know about the question files, the question viewer reads an index file. In this filethere should be listed all question files with full path, e.g./aim/cours1/week1/question1

/aim/cours1/week1/question2

Each question is given on its own line. The viewer reads in all these

questions, anddisplays all, in order and clearly separated. If one (or more) of these files does notGraphic 6.1: Example of the viewer.

18

exist, the viewer also opens a new window. So you can insert a question and save itwith this filename.

On the top of the viewer page there are two textareas for the teacher (course) nameand the password. You need to insert them. The viewer needs this to perform the aimcommands. The viewer creates the quizzes in this directory. So, for example,/aim/cours1/week1/question1 would create a quiz in the cours1, calledweek1/question1 (creates a question1.quiz saved in the week1 subdirectory).

There are also checkboxes for each of these questions (next to the question names).Only questions which are marked will be saved back and used for quiz creation.

In additional, the viewer creates a HTML file. It is either called like the (first)subdirectory of the question files, or viewer.html. In this page there are buttons to allcreated quizzes. So you only need to move this file to the webpages directory, andtheywill give access to all the quizzes.

Graphic 6.2: Example of the additional viewer function.

19

6.2.5

How to use the additional function?

At first you need to create an index file for all the question names. The best way is tocreate one for each subdirectory. Then the viewer can extract the correct contentsname. Then start the viewer with this link:

aimurl/servlet/viewer?typ=special&index=indexfilename

where indexfilename is the full name (with complete path) of the index file (forexample:

The viewer now creates a new page. At the top there is a text area and a password areafor the teacher (course) name and password (don’t forget to insert this). Then there areall questions listed. Always first a checkbox with the filename and then a text areawith the file contents.

At the end of the page there are two buttons: doAll and testAll. testAll creates a quizusing the normal viewer function. It saves all marked questions in one file in theviewer path, creates a quiz out of them and runs it. This is as usual. Hence you can test

whether all marked questions work correctly, or not. And you may may correct them,if necessary.

Note that there might be a problem with variable names. Since all questions are savedin one question file there could be variables names which are used in differentquestions. But this is only a problem of the test function and has no effect on the finalresult.

Graphic 6.3: Example of additional function after using testAll.

20

The result of this test will open in a new window. Note that it always will open in thesame new window. Thus, if you use the button a second time, you have to change tothis second window in order to see the result.

To get both in one window, like the usual viewer, you need a start html (likeviewer.html). This should create a page with two frames called topFrame anddownFrame. Then it should load the viewer in the topFrame (with the link above).Now the downFrame will be used for the answers instate of a new window.

After the user has selected all questions to do, and is sure that that there are no moreerrors,

he press the doAll button. Now all marked questions will be saved. After this,the viewer creates a quiz for each question using the teacher name (course name) andpassword (do don’t forget to enter them). The quizname is the filename without allbefore the third slash (or backslash-

java handles them independent from theoperation system. So you can use forward slashs for paths in windows, too) .

Simultaneously, the viewer creates a HTML page with links to each of the quizzes.This file is named as the subdirectories of the questions, or has a predefined name(viewer.html). See the output for more information concerning the file name.

During the computation, the viewer prints all actions to the output window. Thestandard output for a successful quiz creation is “file saved.” With successful creationis meant that no errors has occurred from the java part of the program. So there stillmight have occurred an error during the aim program. The viewer doesn’t check this.All files not saved / compiled will be called with “skipped.” At the end the filenameof the HTML file is printed.

If any unexpected error occurred, the viewer should print this here and continues withthe next question.

After all the quizzes are created successfully, you only need to copy the createdHTML file to webpages directory (i.e. where all other HTML files are stored, beingvisible via internet).

21

7

Other programs

7.1

Changes in the Alice.java and Maple.java

7.1.1

Alice.java

For portability reasons, this class uses an initialisation file now. When the servlet isstarted (the first time) it loads the aim.init file. In there it reads the parameterMapleName and uses this for calling Maple.

Therefore you need only change the Maple name here instead of in the maple class(during the installation).

Moreover I changed the logging. Now, it also saves the button name in the log file(AliceServer.log). This is needed to check the first usage of displaying the teacherssolution (using the ‘validate and show solution’ button)

7.1.2

Maple.java

In the Maple.java I changed the initialisation. Now it is possible to call the constructorwith a String as parameter. This string specifies the Maple call. This are normally‘cmaple–q’ or ‘maple–q’, depending on the operating system.

This change is needed for the new Aliceclass. However, it will still work with olderversions.

7.1.3

aim.init

This initialisation file is used by the changed Alice class and by the viewer. Its contentis the maple call. In the last version the string (normally “cmaple–q” for Windowsand “maple–q” for Unix) was part of the Maple class. I changed it so that Alice andviewer read it from the file. This happens only during the initialisation. So, after achange you have to reboot the server.

This file should be updated within the installation. The parameter for the Maple pathis MaplePath, so you have to insert this line: MaplePath=cmaple–q (orcorresponding)

Here is an example of the file:

#Aim init file

#Wed Mar 13 11:41:31 GMT 2002

MaplePath="/program files/maple 7/bin.wnt/cmaple"-q

The file must be saved in the jswdk directory.

22

7.2

The log converter

The Alice system creates an independent log, called AliceServer.log. This log iscreated for each course and is saved in the corresponding course directory. AIM itselfdoes not uses this log at all. It is

only for course administration.

Each time a solution button is pressed (‘Validate’ or ‘Validate and show solution’) alog entry is written.

There is much different information saved in the log. Each line is a separate call toaim. In each line this information is saved:



Users IP:

The IP used. From this you can check where the questions wereanswered. This is very useful if you use aim for an exam. You can check if theuser solved the questions from the exam room or from somewhere else



Name of pressed button:

The name of the button to check at which time the ‘showsolutions’ button was pressed first. I have added this to the Alice servlet.



Time of attempt:

The day and the time of the attempt. Useful to check whether itwas in time or not.



Quiz name:

Is needed, of course.



User name:

Is needed, of course.



WebInput:

Here are all inputs saved. They are formed as valid Maple expressions,i.e. as lists of lists. Also saved are bad trials (i.e. possibly-wrong answers of theearlier attempts) are in this list.

Occasionally it is needed to look at some contents of the log file.

Since these log files are very big, some tools are needed to look at them. For exampleexcel is useful, since it can separate the columns by characters. Unfortunately youcan’t use spaces to separate these columns because there are many spaces in theWebInput. So the result is not really readable.

So, in January 2002, I wrote this program, which transforms this log files into uniformseparated ones. By default, it separates the columns with ‘@’,but this can be changed.There is also a possibility to select only all log entries of one course.

(In October 2001, Dr Keady wrote a Perl program that performs similar tasks.However, it process the log file to use separators so that the output can be readdirectly into Maple. For fewer than 100 rows, such output can be read directly into aMaple Spreadsheet. However, the limitation of 100 rows in Maple Spreadsheetsrenders Maple Spreadsheets unusable for this task. Excel, as used in my system, isneededto overcome this limitation.)

7.2.1

How to use my log converter?

At first, you need a Java Virtual Machine on your computer, i.e. a runnable Javaversion.

If you start the converter, you have to specify four parameters:

23

1.

Name of the log file. It is normally AliceServer.log .

2.

The name of the target file. In this file, the result will be saved. (Note that it is notpossible to save in the same file specified as input)

3.

(This parameter is optional) With this parameter, you can name a quiz. Only logentries of this course will be saved in the converted log.

4.

(This parameter is optional. Only viable if parameter 3 is set) If you need otherseparators, you can set them here.

So, a possible call would be:

Java log2space AliceServer.log converted.log quiz1 |

This would convert the AliceServer.log file, saving the result in converted.log. Itwould save only all ‘quiz1’ logs and would use ‘|’ for the separation of columns.

24

8

Future projects

Basically, too much of AIM is written in Maple! The administration tasks could bedonein some more general system (e.g. WebCT). The authoring need not be asintegrated with the system used to deliver the questions. The system could be movedcloser to the server, using JSP pages, for example, rather than having Maple write itsown HTML. This

last aspect would enable more of a plug-and-play arrangementwhereby different Computer Algebra systems could be used depending on what wereto be available at each university or school site. At universities there are several CAsystems widely used-

Mathematica and Maple being those that sell most, but Aldor,MuPAD , REDUCE and Macsyma would be equally usable in this sort of application.One can also argue that the Mathematica and Maple packages contain so much moreComputer Algebra than is needed that their use here is that of using a hugesledgehammer to crack a very small Computer Algebra nut.