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.
78 lines
1.5 KiB
78 lines
1.5 KiB
<?php
|
|
|
|
session_start();
|
|
require_once('../BDD/SqliteDb.php');
|
|
require_once('../BDD/OracleDb.php');
|
|
$db = new SqliteDb('o');
|
|
|
|
$oracleDb = new OracleDb();
|
|
$conn = $oracleDb->getConn();
|
|
$numReponseRow = array();
|
|
|
|
|
|
/*echo $_GET['rep1'];
|
|
echo $_GET['rep2'];
|
|
echo $_GET['rep3'];*/
|
|
|
|
|
|
$query = $db->prepare('SELECT numReponse FROM QcmCorrection WHERE numQuestion=?');
|
|
$query->bindParam(1, $_GET['numQuestion']);
|
|
$result = $query->execute();
|
|
|
|
while($r = $result->fetchArray() ){
|
|
$numReponseRow[] = $r['numReponse'];
|
|
}
|
|
|
|
|
|
$err = 0;
|
|
|
|
//reponse 1
|
|
if(in_array(1, $numReponseRow) ) {
|
|
if($_GET['rep1']!='true'){
|
|
$err++;
|
|
}
|
|
}
|
|
else if($_GET['rep1']=='true'){
|
|
$err++;
|
|
}
|
|
|
|
//reponse 2
|
|
if(in_array(2, $numReponseRow) ) {
|
|
if($_GET['rep2']!='true'){
|
|
$err++;
|
|
}
|
|
}
|
|
else if($_GET['rep2']=='true'){
|
|
$err++;
|
|
}
|
|
|
|
//reponse 2
|
|
if(in_array(3, $numReponseRow) ) {
|
|
if($_GET['rep3']!='true'){
|
|
$err++;
|
|
}
|
|
}
|
|
else if($_GET['rep3']=='true'){
|
|
$err++;
|
|
}
|
|
|
|
if($err == 0){
|
|
echo 'Bonne réponse !';
|
|
}
|
|
else echo 'Mauvaise réponse.';
|
|
/*$reponseQuery = $db->prepare('SELECT reponse FROM QcmReponse WHERE numReponse=? AND numQuestion=?');
|
|
$reponseQuery->bindParam(1, $numReponseRow['numReponse']);
|
|
$reponseQuery->bindParam(2, $_GET['numQuestion']);
|
|
$reponseResult = $reponseQuery->execute();
|
|
$reponseRow = $reponseResult->fetchArray();
|
|
|
|
|
|
|
|
if($_GET['textbox'] == $reponseRow['reponse']){
|
|
echo 'Bonne réponse !';
|
|
}
|
|
else echo $reponseRow['reponse'].'Mauvaise Réponse.';*/
|
|
|
|
|
|
|