@ -15,7 +15,7 @@ $conn = $n->getConn();
$_SESSION['fi'] = array();
$_SESSION['fi'] = array();
$cmpt = 0;
$cmpt = 0;
$numDemo = 0;
$numQuestion = 0;
header("Cache-Control: no cache");
header("Cache-Control: no cache");
@ -23,15 +23,15 @@ header("Cache-Control: no cache");
/*$numQuestion++;
/*$numQuestion++;
$ic = "$numQuestion";*/
$ic = "$numQuestion";*/
$numDemo = $_GET['numQuestion'];
$numQuestion = $_GET['numQuestion'];
$numChapitre = $_GET['numTp'];
$numTp = $_GET['numTp'];
$_SESSION['fi'][$numDemo ] = $textbox;
$_SESSION['fi'][$numQuestion ] = $textbox;
$UserQuery = oci_parse($conn, $textbox);
$UserQuery = oci_parse($conn, $textbox);
$reponseUser = oci_execute($UserQuery);
$reponseUser = oci_execute($UserQuery);
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
$typeQuery->bindParam(1, $numDemo );
$typeQuery->bindParam(1, $numQuestion );
$typeQuery->bindParam(2, $numChapitre );
$typeQuery->bindParam(2, $numTp );
$resultType = $typeQuery->execute();
$resultType = $typeQuery->execute();
$typeRow = $resultType->fetchArray();
$typeRow = $resultType->fetchArray();
$err = 0;
$err = 0;
@ -43,8 +43,8 @@ header("Cache-Control: no cache");
// < editor-fold desc = "vérification avec la vraie BDD" >
// < editor-fold desc = "vérification avec la vraie BDD" >
$sqliteQuery = $db->prepare('SELECT reponse FROM Correct WHERE numquestion= ? AND numTp= ? ');
$sqliteQuery = $db->prepare('SELECT reponse FROM Correct WHERE numquestion= ? AND numTp= ? ');
$sqliteQuery->bindParam(1, $numDemo );
$sqliteQuery->bindParam(1, $numQuestion );
$sqliteQuery->bindParam(2, $numChapitre );
$sqliteQuery->bindParam(2, $numTp );
$result = $sqliteQuery->execute();
$result = $sqliteQuery->execute();
$sqliteRow = $result->fetchArray();
$sqliteRow = $result->fetchArray();
@ -77,8 +77,8 @@ header("Cache-Control: no cache");
// < / editor-fold >
// < / editor-fold >
$aleatoireQuery = $db->prepare('SELECT aleatoire FROM Correct WHERE numQuestion = ? AND numTp= ?');
$aleatoireQuery = $db->prepare('SELECT aleatoire FROM Correct WHERE numQuestion = ? AND numTp= ?');
$aleatoireQuery->bindParam(1, $numDemo );
$aleatoireQuery->bindParam(1, $numQuestion );
$aleatoireQuery->bindParam(2, $numChapitre );
$aleatoireQuery->bindParam(2, $numTp );
$resultAleatoire = $aleatoireQuery->execute();
$resultAleatoire = $aleatoireQuery->execute();
$aleatoireRow = $resultAleatoire->fetchArray();
$aleatoireRow = $resultAleatoire->fetchArray();
if($aleatoireRow['aleatoire'] == 'o'){
if($aleatoireRow['aleatoire'] == 'o'){
@ -135,26 +135,26 @@ header("Cache-Control: no cache");
}
}
// < editor-fold desc = "Résultat" >
// < editor-fold desc = "Résultat" >
if($err == 0 & & $verif==1){
if($err == 0 & & $verif==1){
echo "< strong > La réponse à la question " .$numDemo . " est JUSTE ! \n< / strong > ";
echo "< strong > La réponse à la question " .$numQuestion . " est JUSTE ! \n< / strong > ";
$cmpt++;
$cmpt++;
}
}
else echo "< strong > La réponse à la question " .$numDemo . " est FAUSSE ! \n< / strong > ";
else echo "< strong > La réponse à la question " .$numQuestion . " est FAUSSE ! \n< / strong > ";
//< / editor-fold >
//< / editor-fold >
}
}
//si la question attend une modification
//si la question attend une modification
else if($typeRow['type'] == 'tablemodification'){
else if($typeRow['type'] == 'tablemodification'){
$sqliteQuery = $db->prepare('SELECT reponse FROM Correct WHERE numquestion= ? AND numTp= ? ');
$sqliteQuery = $db->prepare('SELECT reponse FROM Correct WHERE numquestion= ? AND numTp= ? ');
$sqliteQuery->bindParam(1, $numDemo );
$sqliteQuery->bindParam(1, $numQuestion );
$sqliteQuery->bindParam(2, $numChapitre );
$sqliteQuery->bindParam(2, $numTp );
$result = $sqliteQuery->execute();
$result = $sqliteQuery->execute();
$sqliteRow = $result->fetchArray();
$sqliteRow = $result->fetchArray();
$vraiReponse = oci_parse($conn, $sqliteRow['reponse']);
$vraiReponse = oci_parse($conn, $sqliteRow['reponse']);
$enAttente = oci_execute($vraiReponse);
$enAttente = oci_execute($vraiReponse);
$sqliteQuery = $db->prepare('SELECT fonctioncorrect FROM Correct WHERE numquestion= ? AND numTp= ?');
$sqliteQuery = $db->prepare('SELECT fonctioncorrect FROM Correct WHERE numquestion= ? AND numTp= ?');
$sqliteQuery->bindParam(1, $numDemo );
$sqliteQuery->bindParam(1, $numQuestion );
$sqliteQuery->bindParam(2, $numChapitre );
$sqliteQuery->bindParam(2, $numTp );
$result = $sqliteQuery->execute();
$result = $sqliteQuery->execute();
$sqliteRow = $result->fetchArray();
$sqliteRow = $result->fetchArray();
@ -172,18 +172,18 @@ header("Cache-Control: no cache");
}
}
if($err == 0 ){
if($err == 0 ){
echo "La réponse à la question " .$numDemo . " est JUSTE ! \n";
echo "La réponse à la question " .$numQuestion . " est JUSTE ! \n";
$cmpt++;
$cmpt++;
}
}
else echo "La réponse à la question " .$numDemo . " est FAUSSE ! \n";
else echo "La réponse à la question " .$numQuestion . " est FAUSSE ! \n";
}
}
//si la question attend un CREATE FUNCTION
//si la question attend un CREATE FUNCTION
else{
else{
$fonctionQuery = $db->prepare('SELECT * FROM FunctionCorrect WHERE numquestion= ? AND numTp= ? ');
$fonctionQuery = $db->prepare('SELECT * FROM FunctionCorrect WHERE numquestion= ? AND numTp= ? ');
$fonctionQuery->bindParam(1, $numDemo );
$fonctionQuery->bindParam(1, $numQuestion );
$fonctionQuery->bindParam(2, $numChapitre );
$fonctionQuery->bindParam(2, $numTp );
$result = $fonctionQuery->execute();
$result = $fonctionQuery->execute();
$fonctionRow = $result->fetchArray();
$fonctionRow = $result->fetchArray();
@ -278,10 +278,10 @@ header("Cache-Control: no cache");
// < / editor-fold >
// < / editor-fold >
if($err == 0 & & $verif==1 ){
if($err == 0 & & $verif==1 ){
echo "La réponse à la question " .$numDemo . " est JUSTE ! \n";
echo "La réponse à la question " .$numQuestion . " est JUSTE ! \n";
$cmpt++;
$cmpt++;
}
}
else echo "La réponse à la question " .$numDemo . " est FAUSSE ! \n";
else echo "La réponse à la question " .$numQuestion . " est FAUSSE ! \n";
}
}