Attached to this post is an example of a simple text based question bank.
The Example is split into two parts:
The first part, allow a user to create the question bank.
The second allow the questions stored by the first program to be used as a test.
How the First Program works:
The first publication is a simple one-page publication.
There are 5 text input objects, when data is entered into the objects it is saved into a set of variables
When the “Next Question” button is pressed this data is added to a set of arrays:
Once this is done the values of the text object variables are reset to Null. The variable qcount is increased by 1 and the page is reset ready for further data to be added. The variable qcount is used to increment the array values.
When the user has added all the question they need they then hit the finish button.
The Finish button has a script that writes the data to an encrypted file.
The first stage is to write the number of questions entered to the file.
This is then followed by the data from the arrays.
How the Second Program works:
The second program is similar to the first publication ,but is working in reverse.
Page 1 has a script to read all the data back from the encrypted file.
It first read, the first object from the file, this is the number of question in the question bank.
A loop is then set to read the data back from the file into a set of arrays.
Once all the data is read back a variable called loaded is set to 1. A variable change trigger picks this up and allow the publication to move forward to the questions.
There are 4 questions pages which are called at random this is so the question answers are always random. This prevents cheating.
When a page loads it displays the data from the array on screen for the student to read.
If a student selects the correct answer the variable score has 1 added to it. The button action also check to see how many questions have been answered if all the question have been answered then the score page is displayed showing how many questions were answered and what the score correct was.
Regard
Brenden Knifton
