aim-project - University of Birmingham

fortunabrontideInternet and Web Development

Nov 13, 2013 (3 years and 8 months ago)

113 views



The Alice/AIM system of Computer Aided
Assessment in Mathematics:

AIM’s Java classes and my new Java tools.



By Stefan Schaefer



Mathematics Project

University of Birmingham, Apr 2002


2


1

Introduction

................................
................................
................................
................................
......

3

2

Com
puter Aided Assessment in general

................................
................................
...........................

4

3

Further details on AIM

................................
................................
................................
.....................

6

4

About the project

................................
................................
................................
..............................

6

4.1

Getting Started

................................
................................
................................
..........................

6

4.2

Later Progress

................................
................................
................................
...........................

6

5

Maple
-

JAVA
-

HTML
-

AIM

................................
................................
................................
.........

7

5.1

The Maple
-
part

................................
................................
................................
.........................

8

5.1.1

The populate function

................................
................................
................................
.......

8

5.1.2

The teacher function

................................
................................
................................
.........

9

5.2

The JAVA
-
part

................................
................................
................................
.........................

9

5.2.1

Maple.java

................................
................................
................................
........................

9

5.2.2

Alice.java

................................
................................
................................
..........................

9

5.2.3

AliceServer.java
................................
................................
................................
..............

10

5.3

The HTML
-
part

................................
................................
................................
......................

10

5.4

The AIM
-
authoring
-
language
-
pa
rt

................................
................................
..........................

12

6

The question viewers

................................
................................
................................
......................

13

6.1

The first version

................................
................................
................................
......................

13

6.2

The new version

................................
................................
................................
......................

14

6.2.1

How does it work?

................................
................................
................................
..........

14

6.2.2

How

to install the question viewer?

................................
................................
................

15

6.2.3

How to use the question viewer?

................................
................................
....................

16

6.2.4

A useful augmentation of the viewer’s functionality

................................
.......................

17

6.2.5

How to use the additional fu
nction?

................................
................................
...............

19

7

Other programs

................................
................................
................................
...............................

21

7.1

Changes in the Alice.java and Maple.java

................................
................................
..............

21

7.1.1

Alice.java

................................
................................
................................
........................

21

7.1.2

Maple.java

................................
................................
................................
......................

21

7.1.3

aim.init

................................
................................
................................
............................

21

7.2

The log converter

................................
................................
................................
....................

22

7.2.1

How to use my log converter?

................................
................................
........................

22

8

Future projects

................................
................................
................................
................................

24

9

Conclusions

................................
................................
................................
................................
....

24

10

References

................................
................................
................................
................................
......

25




3

1

Introduction


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


Alice/AIM is a computer
-
aided assessment (CAA) pa
ckage which delivers, over the
Web, mathematics questions to students, and marks them. A screen image is given on
the 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, p
articularly the Java classes involved.

2.

To provide some further tools
-

written in Java
-

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


An HTML save of this document, and the source code for the Java written during this
pro
ject is on disk. It will be available, for the next year anyway, from University of
Birmingham 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 a
mass
-
market Computer Algebra (CA) package. In the case of AIM, this is the Maple
package:

http://www.maplesoft.com


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


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


Alice/AIM is free and open source. Its usage in University Mathematics Departments
around the world is increasing. See the URLs given in the Section on AIM for more
details.


4


2

Com
puter Aided Assessment in general

Present CAA programs
-

and the only ones we treat
-

deliver the materials across the
Web. They provide:



Individualised questions for each student



Automatic marking



Continuous availability to the students


CAA programs e
xist for subjects other than Mathematics. However, first year
undergraduate level manipulative mathematical tasks may lend themselves to the
genre better than some other subjects (like history, or English literature, etc.). The
mathematical answers classif
y 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 create
similar but individualised questions for each student. Th
is does not mean we have to
create 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 question
you will see the creation of random values.

Automatic ma
rking:

The program must be able to calculate the real solution for each
individualised question. Also it must be able to compare this solution with the answer
given by the student. The CA underpinning the mathematics is important for both
these tasks.

Then

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

Continuous availability to the students:

This is achieved though the
choice of a web
-
based program. Thus, students can login everywhere and every time (with internet
access).

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

set and
enforced. 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 be
put into use by academic staff. Thus, the following is important.

Authoring
-

Easy
extension 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 as
to be useless. Thus there must be a way to add new questions, and preferably it should
be easy.


Admini
stration:

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

CalMaeth
and WebLearn being two examples) administrative matters like handling marks,

5

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

be delivered in a CAA which felt similar. In
interdisciplinary areas like Engineering, this really is helpful for the students. For
example, WebCT is used in several departments in the University of Birmingham
(and, of course, it is used in very many univ
ersities internationally). Ideally,
experience with the administration of CAA should be able to be shared across
university departments, even if the authoring of questions remains tied to the packages
(like Computer Algebra in the case of mathematics) appr
opriate to the department.

At present, AIM uses its own system for administration
-

marks and passwords. This
has advantages in connection with AIM being complete and open source, but
disadvantages in that costs in providing good code for the admin tasks
is only spread
over a small part of the CAA
-
using community.

In principle, there should be no major problems in adapting AIM to run so that the
admin 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


Ther
e 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 Kolokolni
kov et
al. listed in our references.

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

see the
reference list
-

is relevant to the form of AIM

which is used here at Birmingham. In
particular 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 documentation
giving a good overview of the program itself.

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

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

4.2

Later Progress

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

However I think that understanding how aim works, and, most importantly, fi
lling
gaps 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, there
will be a detailed description of the viewer.

In the 7
th

chapter, there will
be a description of the other changes and programs I
wrote.


7

5

Maple
-

JAVA
-

HTML
-

AIM


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

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

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

But there is more than the HTML part. A Java and Java
-
servlet part communicate
between 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 have
put the main work onto the maple code. This means that most of AIM’s work (from
the writing of Web pages through to the administration of marks) is done by mapl
e.
The java part is only used to call the corresponding maple functions and to return the
answer 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” w
hich contains the Submit or Validate button, and which
initiates the marking. A quizfile is simple, merely grouping the questions into the
quiz. The AIM question
-
and
-
quiz author compiles them to “maple readable code”
which are saved in the appropriate comp
iled maple, .m files.









Server

uses


User machine


Browser

Java servlet


Maple

precompiled
Question
files

Java

(Maple.java)

calls with
parameters

returns

HTML page

calls with hidden
values

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 become
the web input to the Java part. All the following functions are performed by Maple:

Maple reads the password files, compares
with the user password.

Maple reads old answers in (if needed).

Maple generates the new pages (quiz page, quiz page with solutions, quiz selection
pages, teacher pages, …) and print it.

Maple calculates the marks as needed.


There are two main Maple func
tions, populate and teacher. The populate function
deals 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 function
deals with all teacher option
s, like creating new questions, new quizzes, adding users
and so on (mainly called via the staff.html page). Much of the Maple code used in the
staff functions is common with code in the student functions.

To know which page is needed next, depending on wh
ich 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 The
HTML
-
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’ and
stops. For example, if there was no password inserted (and no guest access) it prints a
new 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 p
ages. It prints the start of the form
with the first values. This are Quizsubject, timestamp, cmd, QuizName (if
needed), 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 selec
tion of all quizzes, and returns.

5.

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

6.

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

7.

It reads the question filenames.

8.

It per
forms 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 the
new 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 pages
called staff.html or teacher_page.html.

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


5.2

The JAVA
-
part

The Java part has two main classe
s, the maple.class and the Alice.class. The maple
class is to communicate with Maple, i.e. starts maple in the background, pushes
commands to it, and returns the maple answer. The Alice class is a servlet. It shows
the HTML pages and handles all extended H
TML 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 the
answer. There are three methods.

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

e.g. in Windows: this.process = Runtime.getRuntime().exec(“
cmaple
-
q
”);

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

5.2.2

Alice.java

This is the servlet. It handles all interactions with the HTML pages. Whenever a
button is pressed, this class is called. Then it reads all hid
den variables from the page,
all input lines (if needed). It transforms these parameters to valid maple inputs (using
AliceServer class) and then pushes this to maple (using the maple class). For more
information regarding the parameters on the HTML pages
see chapter 5.3 The HTML
-
part.


10

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

5.2.3

AliceServer.java

This small cl
ass is used by the Alice servlet. It has some important functions which
are linked to the operating system. So, if you change the operating system, you only
need to change this class. It is useful to have matters arranged like this as it is much
easier to
compile a new Java class than a servlet class.

The main functions are
public static String getDir()

and public synchronized
static void log(String subject, String s)
. The getDir functions returns the AIM
directory (for example “c:
\
aim”), the log function

writes the log file. The subject is the
course / 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 maple
expressions. For example one functi
on replaces all backslashes in a string specifying a
directory by two (because, if Java prints this string to Maple, one backslash would be
a special character, but not a backslash). Another function transforms parameters to
valid maple list, by adding ` a
nd related processing.

5.3

The HTML
-
part

There are two main entrance pages. The index.html and the staff.html. Via the index
page, all students can reach the question files, the staff page is only for the teachers, to
author and to administer the quizzes. Thes
e two pages are saved in HTML format. All
quiz 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 ass
umed to be
populate.

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

In fact, the function `aim/public/cmd` is called, with all the other variables as
parameters. For example:
`aim/public/populate`('`StudentID`'=[`1`],'`QuizName`'=[`quiz1`],'`timestamp`'=[`1
0000000`],'`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 the
Quiz. All Quizzes are saved in a path
A_ followed by the quizname, in the
directory 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 the
course
-

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

file of the same
name in the directory “_AIM_StudentProfiles” in the course directory, where the
passwords 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.

In
this file, maple saves the last answer of this “id” (student, or guest, or …). Also
it saves a bad_trial. This are all wrong answers, given so far. They are used to
calculate 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 the
browser.



WebInput:

The values of this parameter are all inputs of

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



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 lin
es 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`: Creates
the
question files. Since there are three pages there are three different
parameters. The modify_question2 and modify_question22 are creating the
question.m files and linking them into aim. So they both have to be
performed in order to insert pages automat
ically. (This might be done
through Java. See viewer chapter for more information.)



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



`other` / `other2`:



`compile`:


12



`studentinfo` / `studentinfo2` / `stude
ntinfo22`: For the student options.



`report` / `report2`: For the report.



extra:

used for different extra values, depending on the page (action).


5.4

The AIM
-
authoring
-
language
-
part

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 the
screen 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 NOT
degrees, 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 quiz
and 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 is
correct, or not. The second list element is the teacher solution.



p> This is for Maple prints.


13

6

The question vi
ewers

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

directly load
them 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 sen
sible to write the new viewer program.

My first attempt was separate from AIM, and from any Web server. However, this
first 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 all
quiz pages. This has some advantages and some disadvantages. The main advantage is
that the pages always look like the user would see them. Also it is always on the same
version level as aim, i.e. if it runs in the viewer it runs also in aim. O
n the other hand,
it has the disadvantage that it always needs aim, i.e. that it must run on a server where
aim 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 bas
ed. This means, that
Java decomposes the question files. A Maple class file, almost the same as that
actually used in AIM was used too. The maple codes in the AIM
-
question file were
passed 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. An
example class file (MyFirst.java) is available in the A
IM distribution to help with this.
However, it would, as an authoring tool, never have developed to be as effective as
my later version described in the next subsection.

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

The first version was really an exercise,
illustrative in a simple way, of how the Maple
class works. It was, however, also an exercise while we awaited a Web server to use
for more detailed exploration and development of AIM. A Web server with AIM for
use in this project was made available throug
h 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 create
the question. Or, to be more
precise, 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 and
calls maple (aim) with them. These functions create the HTML, which java reads and
passes 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 with
the same parameters as if it were called in the normal way. This is the main p
rinciple
of the viewer.

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

On the other hand, you ha
ve also to attend to the details of file management. The user
should be able to open files and save them. And, of course, to edit them. This was not
as easy as it sounds, since the servlet can’t save information (like the file name) from
one call to the ot
her in variables. It would be possible, but very difficult. It would need
a kind of database. Hence I’m saving the filename now on the HTML page, in the
save
-
text area.

There was also an other problem. Through the two windows (frames), it was not
possible
to have only one text area for the file name. Because the open button and the
save 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 the
server 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 the
servlet 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 corresponding
function, depending on the button used. So, for example, if you
use the open
button this function calls the onOpen function.



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



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



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


15



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



createQuestion: Uses the AIM functions to c
ompile a question. First parameter is
a Maple class, second the course name, third the password and fourth the
filename.



createQuiz: Uses the AIM functions to compile a quiz. First parameter is a Maple
class, second the course name, third the password, fou
rth the filename (of the
compiled question file) and fifth the quiz name. This function can only create
quizzes with one question.



saveFile, readFile: Functions for accessing files.



onOpenAll, onTestAll, onDoAll: These functions are for the additional func
tion of
the viewer (see 6.2.4 A useful augmentation of the viewer’s functionality). On
principle 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.



Creat
e a directory viewer in the aim directory in the server.



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



Copy the viewer.html to the webpage directory.


The directory has different uses. All necessary info
rmation is saved here.

To use the aim functions to view the question, the viewer has first to create a quiz
with 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 i
t can display the question.

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

Since the viewer
uses the same question name for each question, all the log files are
saved in the same file. This means, the history will not only have all the last attempts
for this question but also for all other questions used. To delete the old history it is
needed to

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

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

part. In
the 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 the
lower frame. The author can next test that everything on this page works. So you can
insert solutions and te
st 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 edit
the question file at the same time.


16


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

page as the user sees it. It
also loads and saves files if needed. To run the question it uses different aim functions
to create the option file, the quiz and to bind the compiled question in the quiz. After
this it calls the aim/public/populate function
to "run" this page. This means this
function creates the page how the user would see it. Of course, it creates also the
button on the page how they would be in normal use. This means that by using the
buttons 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 as
possible. So I think it isn't very difficult
to use the viewer.

The steps are as follows.

1.

Start the question viewer. For this you have to open the viewer.html. This is done
the 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 the
open button. To open a file just enter the name of the question file and press the
open button (note that the question file must be on the server, as
pointed out
earlier). If the file name was correct, the file contend should be displayed in the
main 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 edi
t the
question file and save it back later. Of course you can also write a new question
file here and save it later. By using the open button, the contents of this will be
deleted. By using the save button, all text in this are will be saved to the specifi
ed
file. By using the run button, the content of this will be used to run. This will be
done regardless of if it has been saved, or not. The file names in the open and save
text area have no influence on the run function.

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

3.

The run button runs the con
tent of the main text area and displays it in the lower
half 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 quizzes
automatically. This is used to create
sample quizzes from all question files. So
students can train without marking.

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

quiz generation.

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

are, which one to
load. 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 not
compile all questions in the directory.

To know about the ques
tion files, the question viewer reads an index file. In this file
there 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, and
displays all, in order and clearly separated. If one (or more) of these files does not
Graphic 6.1: Example of the viewer.


18

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

On the top of the viewer page there are two text
areas for the teacher (course) name
and the password. You need to insert them. The viewer needs this to perform the aim
commands. The viewer creates the quizzes in this directory. So, for example,
/aim/cours1/week1/question1 would create a quiz in the cour
s1, called
week1/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 add
itional, 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 all
created quizzes. So you only need to move this file to the webpages directory, and
they
will give access to all the quizzes.






Graphic 6.2: Example of the additional vie
wer 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 to
create one for each subdirectory. Then the viewer can extract the correct contents
name. 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 (for
example:


http://localhost/servlet/viewer?typ=special&index=/aim/cours1/weekl
/index).

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

At the end of the page there are two buttons: doAll and testAll. testAll creates a quiz
using the normal viewer function. It saves all marked questions in one file in the
viewer path, creates a quiz out of them and run
s 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 saved
in one question file there cou
ld be variables names which are used in different
questions. But this is only a problem of the test function and has no effect on the final
result.

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 the
same new window. Thu
s, if you use the button a second time, you have to change to
this second window in order to see the result.

To get both in one window, like the usual viewer, you need a start html (like
viewer.html). This should create a page with two frames called topFra
me and
downFrame. 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 more
errors,

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) and
password (do don’t forget to enter them). The quizname is the filename without all
before t
he third slash (or backslash
-

java handles them independent from the
operation 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 s
ubdirectories 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. The
standard output for a successful quiz crea
tion is “file saved.” With successful creation
is meant that no errors has occurred from the java part of the program. So there still
might have occurred an error during the aim program. The viewer doesn’t check this.
All files not saved / compiled will b
e called with “skipped.” At the end the filename
of the HTML file is printed.

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

After all the quizzes are created successfully, you only need to copy th
e created
HTML file to webpages directory (i.e. where all other HTML files are stored, being
visible 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. Whe
n the servlet is
started (the first time) it loads the aim.init file. In there it reads the parameter
MapleName and uses this for calling Maple.

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


Mo
reover 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 teachers
solution (using the ‘validate and show solution’ button)

7.1.2

Maple.java

In the Maple.java I c
hanged the initialisation. Now it is possible to call the constructor
with 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 Alice
class. However, it will still work with older
versions.

7.1.3

aim.init

This initialisation file is used by the changed Alice class and by the viewer. Its content
is the maple call. In the last version the string (normally “cmaple

q” for Windows
and “maple

q” f
or Unix) was part of the Maple class. I changed it so that Alice and
viewer read it from the file. This happens only during the initialisation. So, after a
change you have to reboot the server.

This file should be updated within the installation. The param
eter for the Maple path
is MaplePath, so you have to insert this line: MaplePath=cmaple

q (or
corresponding)

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 b
e saved in the jswdk directory.


22

7.2

The log converter

The Alice system creates an independent log, called AliceServer.log. This log is
created for each course and is saved in the corresponding course directory. AIM itself
does 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’) a
log entry is written.

There is much different information saved in the log. Each line is a separate call to
aim. In each line this inform
ation is saved:



Users IP:

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



Name of pressed butto
n:

The name of the button to check at which time the ‘show
solutions’ 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 it
was in time or not.



Quiz name:

Is neede
d, 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 the
earlier attempts) are in this list.

Occasi
onally 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 example
excel is useful, since it can separate the columns by characters. Unfortunately you
can’t use spaces to sep
arate these columns because there are many spaces in the
WebInput. So the result is not really readable.

So, in January 2002, I wrote this program, which transforms this log files into uniform
separated 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 re
ad
directly into Maple. For fewer than 100 rows, such output can be read directly into a
Maple Spreadsheet. However, the limitation of 100 rows in Maple Spreadsheets
renders Maple Spreadsheets unusable for this task. Excel, as used in my system, is
needed
to 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 Java
version.

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


23

1.

Name of the log file. It is normally Alice
Server.log .

2.

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

3.

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

4.

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

So, a possible call would be:

Java log2space AliceServer.log converted.log quiz1 |

This would conve
rt the AliceServer.log file, saving the result in converted.log. It
would 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 be
done
in some more general system (e.g. WebCT). The authoring need not be as
integrated with the system used to deliver the questions. The system could be moved
closer to the server, using JSP pages, for example, rather than having Maple write its
own HTML. This

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

Math
ematica 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 more
Computer Algebra than is needed that th
eir use here is that of using a huge
sledgehammer to crack a very small Computer Algebra nut.


There is room for much more work.

9

Conclusions

The projects aims of chapter 1 have been realized as follows.



This manuscript fills some of the gaps in AIM’s docu
mentation.



Dr. Keady has already successfully used my latest viewer class to build one
-
question quizzes.



Dr. Hernabsm as the main AIM administrator, proposed, and will use in the next
academic year, the log
-
converter program.

As mentioned in chapter 8, mor
e remains to be done.


25

10

References




Alice Interactive Mathematics (AIM)

S. Klai, T. Kolokolnikov, N. Van den Bergh "Using Maple and the Web to grade
mathematics tests". In the
Proceedings of the International Workshop on
Advanced Learning Technologies

4
-
6 D
ecember 2000, Palmerston North, New
Zealand.

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


N. Strickland “Alice Interactive Mathematics”. Feb 2002 Learning and Teaching
Support Network Newslet
ter, pp27
-
30.

http://dani.shef.ac.uk/aimsource/aimarticle.html

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




Java Specification

http://java.sun.com/j2se/1.4/docs/api/index.html



Dustin R.Callaway “Java Inside Servlets” (Addison
-
Wesley: second edition
2001).



M.B. Monagan, K.O. Geddes, K.M. Heal, G. Labahn, S.M. Vorkoetter, J.
McCarron

“Maple 6 Programming Guide” (Waterloo Maple Inc. 2000)