Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.


1060 - How can I track a users performance on a test?

by - Joseph Ganci

I am developing a traning piece for a local company, with version 5.2, and they would like test questions and the correct answer printed out along with the test scores on the final test. I am currently saving to a .txt file on the A: drive and can get the question number, but not the question itself. Also can get the correct incorect response, which is acceptable, but then they would like the correct answer printed as well.
Any help would be greatly appriciated.

To do this, it's best to use linear lists and property lists.

Initialize a list called questions, like this:

questions := []

On each question, set the question number. If each question is in its own framework page, you can set a user variable (maybe call it qnum) to the framework page number, like so:

qnum := CurrentPageNum

If your questions are set up differently, you may need to set up the qnum variable literally:

qnum := 1

(for question 1, qnum := 2 for question 2, etc.)

It's best not to use the literal value because you may take out or insert a question later. Anyway, the important thing is that qnum is set to a unique number on each question. Then, in each question you can set up each location in the list called questions as a property list:

questions[qnum] := [:]
questions[qnum][#question] := "This is the text for question 1"
questions[qnum][#correct] := "This is the correct answer for question 1"

In fact, you can set up all your questions the same way as above in one Calc at the beginning of your file, making it easier to update.

When the student answer the question, set the answer given the same way in each response:

question[qnum][#answergiven] := "The student answer"

Using this approach means that in the end you can move through the list quickly and save the results to a text file:

results := ""
repeat with i := 1 to ListCount(questions)
results := results ^ "Question " ^ qnum ^ ": " ^ questions[i][#question] ^ return
results := results ^ "Correct answer: " ^ questions[i][#correct] ^ return
results := results ^ "Answer given: " ^ questions[i][#answergiven] ^ return ^ return
end repeat
WriteExtFile("a:\\results.txt", results)

Hope this helps. A lot more can be said about this, such as this makes it easy to have all your questions work with one or two interaction models so that you don't need separate code for each question.

There are 0 reviews
Add your review