QuestionPages

Introduction

A QuestionPage is a HTML/JavaScript page with questions for students. The QuestionPages makes out the end goal of the whole package and all other modules in the package are in some way related to them. The package currently supports three different types of QuestionPages. The types are named cross, alternative and written after there built-in properties, figure 1, 2 and 3 demonstrates examples of the three types.

It does also exist one QuestionPage prototype called multi. The type multi is however not yet fully implemented in the system (see fig. 4). Each QuestionPage is made out of an unlimited number of subquestions, each subquestion should be answered by the student if the answers are to be sent to the server. If not, the QuestionPage will complain to the student.

Another feature of the QuestionPages is the feedback mode. There are two different types of feedback, auto and send. An auto QuestionPage gives a student direct feedback on his answers, by telling the student which subquestions that were correctly answered. A send QuestionPage on the other hand, calls the server and saves the answers on the server.


Fig.1 A Cross QuestionPages with four subquestions.
            Fig. 2 A Alternative QuestionPage with two subquestions, the first one having three alternatives, the second five.
 
               Fig. 3  A written QuestionPage with one subquestion.
Fig. 4 The new prototype QuestionPage called multi, exactly how it will be used is still under development

Code structure and functionality

The QuestionPages are HTML pages, but a large part of the functionality lies in embedded JavaScripts. A JavaScript stores subquestions in data structures. When a QuestionPage has been loaded into the browser a JavaScript method is called (startQuestion). This method writes the subquestions into the HTML page using the document.write command. The graphical components used to display the subquestions are different depending on the QuestionPage type. The cross type for example, use a table for displaying while the type written use text areas.

When a student clicks on the Terminado? button, a function called check is called. Checks make sure the student has filled in all the question fields with the right format on the answer e.g. a cross question must have an integer answer. If all the subquestions have been correctly filled in, the QuestionPage will either give the student information about which subquestions were correctly answered and which where not answered or send the answers to the server. What will happen depends if the QuestionPage is of type auto or send. Answers that should be sent to the server and not directly showed to the student have to be filled in, but the answers in an auto QuestionPage do not have to be filled in to give the result to the student.

For the type send the following apply.

Outside the JavaScript tags on the end of the page is a form. The form has five inputs of type hidden. The inputs are named a, b, c, d and e (see Table 1). When the student clicks on the Terminado? button, the values of these variables are set and sent to the cgi script distans.perl.

For more details about the code please see the source code of the QuestionPages.
 

a The student answers answer1#@[answer2
b The number of questions 2
c The students cedula no. 11112222
d The name of the QuestionPage anExampleQP
e
The name of the subject of the QuestionPage Mathematicas
Table 1. The variables sent to the server, the first column is the name of the variable, the second what information it has and the third is an example of a variable string