The Flash question type allows you to use a flash movie, or any other client side technology like a Java applet, as a question. All question logic is done on the client side. The flash movie can save several types of data to closed- question and perform database queries that are specified in the XML. Database queries are explained below. General available data is:
If after doing a set of interactions the state is considered to be a correct answer, then the state should still be considered to be a correct answer after leaving the question and coming back later.
Once the state is considered "correct", a post should be done with a non-zero value for the "correct" parameter. From this point on, the value of the "onceCorrect" parameter will be positive, to indicate that the student has reached a correct state at least once, even if the current state is no longer considered correct.
It is advisable to allow the student to continue exploring the interaction even after finding a correct answer. This allows the student to check feedback on possible incorrect actions and improves learning.
The page containing this question will respond to the following get/post variables:
In the XML database queries can be specified that can be executed by the client side object. Lets look at an example:
<database server="localhost" username="tester" password="secret" database="test"> <query string="REPLACE INTO test (userid, data) VALUES (%d, '%s')"> <param type="uid"/> <param type="remote" name="data"/> </query> <query string="SELECT * FROM test"/> </database>
This snippet defines 2 queries, one to insert/update a record, and one to list all records. The first query, to insert/update, has two parameters. In the SQL of the query these parameters have a placeholder: %d for the first and %s for the second. The first parameter has a type of uid, meaning that the first % placeholder will be replaced with the uid of the logged in user. The second parameter is of type remote, meaning that the second % place- holder will be replaced with the content of a POST variable. The name of the variable to use is specified in the "name" attribute of the parameter.
Available placeholders are: %s for strings, %d for decimal numbers, %f for floating-point numbers and %% for the % sign itself.
Available param types are: uid for the user-id of the logged in user, uname for the user-name of the logged in user and remote for POST vars.