You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
666 B
32 lines
666 B
|
|
|
|
<?php
|
|
|
|
require_once('SqliteDb.php');
|
|
|
|
header('Content-type: text/plain');
|
|
|
|
$db = new SqliteDb();
|
|
$cmpt = 0;
|
|
$i = 0;
|
|
foreach ($_POST['textbox'] as $textbox) {
|
|
$i++;
|
|
//$reponseUser = $_POST[''];
|
|
$query = $db->prepare('SELECT reponse FROM Correct WHERE rowid= ? ');
|
|
$query->bindParam(1, $i);
|
|
$result = $query->execute();
|
|
while($row = $result->fetchArray()){
|
|
if ($row['reponse'] == $textbox) {
|
|
echo "La réponse à la question n° ".$i." est JUSTE\n";
|
|
$cmpt++;
|
|
}
|
|
else echo 'La réponse à la question n° '.$i." est FAUSSE\n\n";
|
|
}
|
|
|
|
|
|
}
|
|
echo 'Résultat ' . $cmpt . '/' . $i;
|
|
|
|
|
|
|