| 
<?php
$idQCM = 3;                         // Identifier, number of the questionnaire (3 -> qcm3.txt)
 require("QCM.php");                 // Insertion of the class
 
 // This following informations about the student are written but they can have been read in a database
 // This array is optional. (askfor=supplied)
 $student[] = 146;                   // ID of the student. Not yet used
 $student[] = "FAUQUE";              // Last name of the student
 $student[] = "Pierre";              // First name of the student
 $student[] = "M.";                  // Sex of the student (M. Mme Mlle). Can be unused
 $student[] = "[email protected]";   // Mail of the student
 $test = new qcm($idQCM,$student);   // Instanciation of the test. Student informations are supplied
 
 // No array is supplied to the class, but informations asked (askfor=name,mail)
 // $test = new qcm($idQCM);         // Instanciation of the test. Student informations are asked to him
 ?>
 <html>
 
 <head>
 <title><? echo $test->title; ?></title>
 <link rel="stylesheet" href="test.css" type="text/css">
 </head>
 
 <body>
 <?php
 if (!$_POST['submit']) {
 
 echo "<form method='post' name='test' action='" . $_SERVER['PHP_SELF'] . "'>\n";
 $test->display();               // Display the test
 echo "</form>\n";
 
 // ------------------------------------------------------
 // These lines can be commented or deleted.
 // They have been written to show attributes before correction
 // echo "<hr>";
 // $test->showVars();           // Show the properties of the class (for debugging)
 // ------------------------------------------------------
 
 } else {
 
 $test->correction();            // Correct of the test
 
 // ------------------------------------------------------
 // These lines can be commented or deleted.
 // They have been written to show how the class works
 // echo "<hr>";
 // $test->showResponses();      // Show on the web to the student his responses
 // $test->showGoodResponses();  // Show on the web to the student the correction
 // ------------------------------------------------------
 
 }
 // $test->showVars();                // Show the properties of the class (for debugging)
 ?>
 </body>
 
 </html>
 |