diff --git a/BddCorrect/Correcteur.php b/BddCorrect/Correcteur.php index 5eeb845..fd34bc3 100644 --- a/BddCorrect/Correcteur.php +++ b/BddCorrect/Correcteur.php @@ -36,12 +36,13 @@ foreach ($_POST['textbox'] as $textbox) { $err=-3; break; } - while( ($oracleRow = oci_fetch_array($UserQuery, OCI_NUM)) && $err == 0 ){ - $verif = 1; + while( ($oracleRow = oci_fetch_array($UserQuery, OCI_NUM)) && $err == 0 ){ $vraiReponseRow = oci_fetch_array($vraiReponse,OCI_NUM ); + $verif = 1; if(sizeof($oracleRow) == sizeof($vraiReponseRow)){ - for($i=0 ; $i< sizeof($vraiReponseRow)-1 ; $i++){ + + for($i=0 ; $i< sizeof($vraiReponseRow) ; $i++){ if($oracleRow[$i] != $vraiReponseRow[$i]){ $err = -1; break; @@ -53,7 +54,7 @@ foreach ($_POST['textbox'] as $textbox) { break; } } - if($err == 0 ){ + if($err == 0 && $verif==1){ echo "La réponse à la question " .$numQuestion. " est JUSTE ! \n"; $cmpt++; } diff --git a/BddCorrect/SqliteDb.php b/BddCorrect/SqliteDb.php index b0aa05e..616a48e 100644 --- a/BddCorrect/SqliteDb.php +++ b/BddCorrect/SqliteDb.php @@ -16,7 +16,7 @@ class SqliteDb extends SQLite3 $this->exec('CREATE TABLE Correct ( question STRING, reponse STRING, type STRING, fonctionCorrect STRING,testUser STRING)'); //Question 1 - /* $type = 'query'; + $type = 'query'; $fonctionCorrect = null; $testU = null; $reponse = 'SELECT count(*) FROM stats WHERE prenomnoms=\'Kevin Durant\' '; @@ -28,7 +28,7 @@ class SqliteDb extends SQLite3 $stmt->bindParam(4,$testU); $stmt->execute(); - //Question 2 + //Question 2 $type = 'query'; $fonctionCorrect = null; $testU = null; @@ -54,7 +54,7 @@ class SqliteDb extends SQLite3 $stmt->bindParam(4,$testU); $stmt->execute(); - //Question 5 + /* //Question 5 $type = 'query'; $fonctionCorrect = null; $testU = null; @@ -68,7 +68,7 @@ class SqliteDb extends SQLite3 $stmt->execute(); - //Question 6 + /* //Question 6 $this->joueurEtDateRandom($joueurRandom, $dateRandom); $type = 'fonction'; $fonctionCorrect = 'CREATE OR REPLACE FUNCTION fpointsmarques(date_match IN VARCHAR2, joueur IN VARCHAR2 ) RETURN NUMBER IS nbPoints NUMBER ; BEGIN SELECT points INTO nbPoints FROM stats WHERE datematch = date_match AND prenomnoms=joueur; RETURN nbPoints; END;' ; @@ -80,10 +80,10 @@ class SqliteDb extends SQLite3 $stmt->bindParam(2,$type); $stmt->bindParam(3,$fonctionCorrect); $stmt->bindParam(4,$testU); - $stmt->execute();*/ + $stmt->execute(); //Question 9 - $type = 'tablemodification'; + /*$type = 'tablemodification'; $fonctionCorrect = 'IDJOUEUR'; $testU = null; $reponse = 'SELECT column_name FROM all_TAB_COLUMNS WHERE table_name = \'TEST\' '; @@ -94,7 +94,7 @@ class SqliteDb extends SQLite3 $stmt->bindParam(3,$fonctionCorrect); $stmt->bindParam(4,$testU); - $stmt->execute(); + $stmt->execute();*/ } function createLogin(){ diff --git a/BddCorrect/controleur/Controleur.php b/BddCorrect/controleur/Controleur.php index b29f603..e02a87f 100644 --- a/BddCorrect/controleur/Controleur.php +++ b/BddCorrect/controleur/Controleur.php @@ -13,7 +13,8 @@ class Controleur { switch($action) { case NULL: - require ($rep.$vues['vueLogin']); + //require ($rep.$vues['vueLogin']); + $this->afficherQuestions(); break; case 'login' : diff --git a/BddCorrect/index.php b/BddCorrect/index.php index 2f316ad..788a0ef 100644 --- a/BddCorrect/index.php +++ b/BddCorrect/index.php @@ -11,6 +11,7 @@ and open the template in the editor. -
+