correction de bugs dans Correction.php

master
Mehdi 5 years ago
parent cad8d58ad0
commit 8f285a816f

@ -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++;
}

@ -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(){

@ -13,7 +13,8 @@ class Controleur {
switch($action) {
case NULL:
require ($rep.$vues['vueLogin']);
//require ($rep.$vues['vueLogin']);
$this->afficherQuestions();
break;
case 'login' :

@ -11,6 +11,7 @@ and open the template in the editor.
</head>
<body>
<?php //chargement config
//phpinfo();
require_once(__DIR__.'/config/config.php');
//chargement autoloader pour autochargement des classes

Binary file not shown.

@ -54,7 +54,7 @@
</div>
</section>
<section id="TP3" class="bg-light">
<!-- <section id="TP3" class="bg-light">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
@ -97,7 +97,7 @@
</div>
</div>
</div>
</section>
</section>-->
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">

Loading…
Cancel
Save