From e01b6493f701c47c70e093842f755d996cfd113a Mon Sep 17 00:00:00 2001 From: Mehdi Date: Fri, 7 Aug 2020 14:27:08 +0200 Subject: [PATCH] =?UTF-8?q?accueil-bug=20suppression=20r=C3=A9solu-=20ajou?= =?UTF-8?q?t=20de=20Tp=20dynamique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BddCorrect/BDD/OracleDb.php | 2 +- BddCorrect/DAL/QuestionsGateway.php | 28 ++- BddCorrect/Traitement/AjoutQuestion.php | 6 +- BddCorrect/Traitement/Suppression.php | 121 ++++++++-- BddCorrect/Traitement/test2.db | Bin 40960 -> 40960 bytes BddCorrect/config/config.php | 4 + BddCorrect/controleur/Controleur.php | 29 ++- BddCorrect/css/.bash_history | 13 ++ BddCorrect/css/VueAccueil.css | 40 ++++ BddCorrect/css/VueDemonstration.css | 34 +++ BddCorrect/css/VuePrincipale.css | 77 ++++++- BddCorrect/modeles/Modele.php | 3 +- .../nbproject/private/private.properties | 1 + BddCorrect/nbproject/private/private.xml | 12 +- BddCorrect/vues/VueAccueil.php | 59 +++++ BddCorrect/vues/VueAdmin.php | 31 ++- BddCorrect/vues/VueDemonstration.php | 209 +++++++++--------- BddCorrect/vues/VuePrincipale.php | 88 ++++---- 18 files changed, 558 insertions(+), 199 deletions(-) create mode 100644 BddCorrect/css/.bash_history create mode 100644 BddCorrect/css/VueAccueil.css create mode 100644 BddCorrect/css/VueDemonstration.css create mode 100644 BddCorrect/vues/VueAccueil.php diff --git a/BddCorrect/BDD/OracleDb.php b/BddCorrect/BDD/OracleDb.php index 8afaffa..2e2ff79 100644 --- a/BddCorrect/BDD/OracleDb.php +++ b/BddCorrect/BDD/OracleDb.php @@ -14,7 +14,7 @@ class OracleDb { function __construct() { //$this->conn = oci_connect('u_prems', '123456', 'localhost/orcl'); $this->conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov'); - $this->createRandomTables(); + //$this->createRandomTables(); } function createRandomTables() { diff --git a/BddCorrect/DAL/QuestionsGateway.php b/BddCorrect/DAL/QuestionsGateway.php index d5698f7..360261c 100644 --- a/BddCorrect/DAL/QuestionsGateway.php +++ b/BddCorrect/DAL/QuestionsGateway.php @@ -1,5 +1,7 @@ db->prepare($query); $result = $query->execute(); - //$resultats = $this->db->query('SELECT found_rows()'); - while($q = $result->fetchArray()){ - $i= $i+1; - $tabQuestions[] = new Question($q['numTp'],$q['numquestion'],$q['question'],$q['reponse']); + //$nbTpRow = $result->fetchArray(SQLITE3_NUM); + $i = 0; + while ($tp = $result->fetchArray(SQLITE3_NUM)){ + $questionQuery = 'SELECT numTp,numquestion,question,reponse FROM Correct WHERE numTp = ? UNION SELECT numTp,numquestion,question,reponse FROM FunctionCorrect WHERE numTp = ? '; + $questionQuery = $this->db->prepare($questionQuery); + $questionQuery->bindParam(1, $tp[0]); + $questionQuery->bindParam(2, $tp[0]); + $questionResult = $questionQuery->execute(); + while($q = $questionResult->fetchArray()){ + $tabQuestions[] = new Question($q['numTp'],$q['numquestion'],$q['question'],$q['reponse']); + } + $tabTp['tp'.$tp[0]] = $tabQuestions ; + unset($tabQuestions); + $tabQuestions = array(); } - return $tabQuestions; + + //die("
".print_r($tabTp)."ERREUR : Veuillez remplir tous les champs ';
@@ -15,8 +15,8 @@ else if(!is_numeric($_GET['tp']))
     echo 'ERREUR : une valeur non numérique à été détectée dans le champ \'Numéro de question :\' ';
 else if(!is_numeric($_GET['num']))
     echo 'ERREUR : une valeur non numérique à été détectée dans le champ \'TP n° :\' ';
-
-
+else if(!is_numeric($_GET['points']))
+    echo 'ERREUR : une valeur non numérique à été détectée dans le champ \'Barème:\' ';
 else {  
     if(isset($_GET['modif'])){
         if ($_GET["type"] == 'fonction')
diff --git a/BddCorrect/Traitement/Suppression.php b/BddCorrect/Traitement/Suppression.php
index 4f476f2..2ab3913 100644
--- a/BddCorrect/Traitement/Suppression.php
+++ b/BddCorrect/Traitement/Suppression.php
@@ -3,28 +3,113 @@
 
 require_once('../BDD/SqliteDb.php');
 $db = new SqliteDb('o');
+        
+$numQuestionSuiv = $_GET['numQuestion']+1;
+
+
+
+
+$sqliteQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion=? AND numTp = ?');
+$sqliteQuery->bindParam(1, $_GET['numQuestion']);
+$sqliteQuery->bindParam(2, $_GET['numTp']);
+$result = $sqliteQuery->execute();
+$typeRow = $result->fetchArray();
 
+$sqliteQuery = $db->prepare('DELETE FROM Type WHERE numquestion= ? AND numTp=? ');
+$sqliteQuery->bindParam(1, $_GET['numQuestion']);
+$sqliteQuery->bindParam(2, $_GET['numTp']);
+$result = $sqliteQuery->execute();
 
-        $sqliteQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion=? AND numTp = ?');
-        $sqliteQuery->bindParam(1, $_GET['numQuestion']);
-        $sqliteQuery->bindParam(2, $_GET['numTp']);
+
+if($typeRow['type'] == 'query'){   
+    $sqliteQuery = $db->prepare('SELECT count(*) FROM (SELECT numQuestion FROM Correct WHERE numTp=? UNION SELECT numQuestion FROM FunctionCorrect WHERE numTp=?)');
+    $sqliteQuery->bindParam(1, $_GET['numTp']);
+    $sqliteQuery->bindParam(2, $_GET['numTp']);
+    $result = $sqliteQuery->execute();
+    $nbQuestionsRow =   $result->fetchArray();
+    
+    $sqliteQuery = $db->prepare('DELETE FROM Correct WHERE numquestion= ? AND numTp=? ');
+    $sqliteQuery->bindParam(1, $_GET['numQuestion']);
+    $sqliteQuery->bindParam(2, $_GET['numTp']);
+    $result = $sqliteQuery->execute();
+    
+    
+    for( $iSuiv = $numQuestionSuiv, $j=$_GET['numQuestion'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
+        
+        $typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
+        $typeQuery->bindParam(1, $iSuiv);
+        $typeQuery->bindParam(2, $_GET['numTp']);
+        $resultType = $typeQuery->execute();
+        $typeRow = $resultType->fetchArray();
+
+        if($typeRow['type'] == 'query'){
+            $table = 'Correct';
+            $type = 'query';
+        }
+        else{
+            $table = 'FunctionCorrect';
+            $type = 'functionCorrect';
+        }
+    
+        $sqliteQuery = $db->prepare('UPDATE '.$table.' SET numQuestion=? WHERE numQuestion=? AND numTp=? ');
+        $sqliteQuery->bindParam(1, $j);
+        $sqliteQuery->bindParam(2, $iSuiv);
+        $sqliteQuery->bindParam(3, $_GET['numTp']);
         $result = $sqliteQuery->execute();
-        $typeRow = $result->fetchArray();
         
-        if($typeRow['type'] == 'query'){     
-            $sqliteQuery = $db->prepare('DELETE FROM Correct WHERE numquestion= ? AND numTp=? ');
-            $sqliteQuery->bindParam(1, $_GET['numQuestion']);
-            $sqliteQuery->bindParam(2, $_GET['numTp']);
-            $result = $sqliteQuery->execute();
+        $sqliteQuery = $db->prepare('UPDATE Type SET numQuestion=? WHERE numQuestion=? AND numTp=? ');
+        $sqliteQuery->bindParam(1, $j);
+        $sqliteQuery->bindParam(2, $iSuiv);
+        $sqliteQuery->bindParam(3, $_GET['numTp']);
+        $result = $sqliteQuery->execute();
+    }
+}
+else {
+    
+    $sqliteQuery = $db->prepare('SELECT count(*) FROM (SELECT numQuestion FROM Correct WHERE numTp=? UNION SELECT numQuestion FROM FunctionCorrect WHERE numTp=?)');
+    $sqliteQuery->bindParam(1, $_GET['numTp']);
+    $sqliteQuery->bindParam(2, $_GET['numTp']);
+    $result = $sqliteQuery->execute();
+    $nbQuestionsRow =   $result->fetchArray();
+    
+    $sqliteQueryF = $db->prepare('DELETE FROM FunctionCorrect WHERE numquestion= ? AND numTp=?');
+    $sqliteQueryF->bindParam(1, $_GET['numQuestion']);
+    $sqliteQueryF->bindParam(2, $_GET['numTp']);
+    $result = $sqliteQueryF->execute();   
+    
+
+    
+    for( $iSuiv = $numQuestionSuiv, $j=$_GET['numQuestion'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
+        
+        $typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
+        $typeQuery->bindParam(1, $numQuestionSuiv);
+        $typeQuery->bindParam(2, $_GET['numTp']);
+        $resultType = $typeQuery->execute();
+        $typeRow = $resultType->fetchArray();
+
+        
+        if($typeRow['type'] == 'query'){
+            $table = 'Correct';
+            $type = 'query';
         }
-        else {
-            $sqliteQueryF = $db->prepare('DELETE FROM FunctionCorrect WHERE numquestion= ? AND numTp=?');
-            $sqliteQueryF->bindParam(1, $_GET['numQuestion']);
-            $sqliteQueryF->bindParam(2, $_GET['numTp']);
-            $result = $sqliteQueryF->execute();   
+        else{
+            $table = 'FunctionCorrect';
+            $type = 'functionCorrect';
         }
+    
+        $sqliteQuery = $db->prepare('UPDATE '.$table.' SET numQuestion=? WHERE numQuestion=? AND numTp=? ');
+        $sqliteQuery->bindParam(1, $j);
+        $sqliteQuery->bindParam(2, $iSuiv);
+        $sqliteQuery->bindParam(3, $_GET['numTp']);
+        $result = $sqliteQuery->execute();
         
-        $sqliteQuery = $db->prepare('DELETE FROM Type WHERE numquestion= ? AND numTp=? ');
-        $sqliteQuery->bindParam(1, $_GET['numQuestion']);
-        $sqliteQuery->bindParam(2, $_GET['numTp']);
-        $result = $sqliteQuery->execute();
\ No newline at end of file
+        $sqliteQuery = $db->prepare('UPDATE Type SET numQuestion=? WHERE numQuestion=? AND numTp=? ');
+        $sqliteQuery->bindParam(1, $j);
+        $sqliteQuery->bindParam(2, $iSuiv);
+        $sqliteQuery->bindParam(3, $_GET['numTp']);
+        $result = $sqliteQuery->execute();
+    }
+}
+
+
+
diff --git a/BddCorrect/Traitement/test2.db b/BddCorrect/Traitement/test2.db
index 6f7c6eeeb14d2ec792c56b6cf2f803faed50657e..35d23d9ccfceeca1edba716e24d5673da00e658a 100644
GIT binary patch
delta 1303
zcmZ{jUuYCZ9LINN=Qg)HyEAt;m)lG2!=0xFnm58|J$fkKVR$^=udjan!__A{=f7~
zTpjU0vk&3wkpIN~7FUPs=biCA-4VK?@fkMg9I=yhh5iHM2K|9vpdZpnI!t%d&D610
ztv{?Q)>qaC^>}Q|^yh|Fy;N&dU>zYO2KKyyAE4a8{{Eft`eHIFbX~`~)N_w!qr(;L
z-UNQ2eZL4oT7XNo!1Xx}yCjMAqyvW?NLySIU3s*JaYUXjA@8lW9I#X@DiFpf$T!`S
zCbwLByUfPdWz+sfeX7fBY+W|I32!vM`3WtdB|xqN$&e6gOWA7+?eJs)ByIVXaIdzu
z?7A5bWI^TpP$pSI2#BqgT2YW>T3gnZr>8;YCdei0XAZqv
zD&-6Hp9=#0KV2)vVm$`GsPQ#^pRe#=`H%b}pXZRSMlz<9(V1;uJLdpn2o{O`}=}0FWuwphamxPE0Nke2=1eq=krdg(ZC(05HEGn>C
zh>2V*fn~@!dN8Lo0&_ZWq;-F+>YgEF50n%x~Z2N{?Qr6O&``r0xGm+P(j0`PgcM
zP(v8X!^fvCbzGmg*&tSvXzi!HEq9tEWf~%)Jb9KFcoI6iu~f7P5UwAKH&Ufqn!1MP
zUTtgWNy89CB{Js68>)yHLRV^R?X_?<31SGW#E$nuEv_5E4Tb#{K_YUee)+=t{^Y#(
E9L@ze3IG5A

delta 628
zcmZ{hPiPZC6vlUE|KRSMowv!RRC=lirqbllQqWu3=taR6w4g;>3^8I!%*MDudTG0B
zjzTLVVxh7iBJ?OLJ@??nL%~Bu=%o~doDI2n(pmAa6dV|a-}m?)-+QyMPdE1I)>z(T
zilSKZ{yTL0Woeq4?Bo5f7L7FV!g?nT;XDmj#V>eEBVD{ZPlA)3l*=frbJCA3}O}{zOOQYwdMLs0;
zXl>8@2o;D3r-d=
z3p@*U7FZS_3sx4)6lBiPYh;pY54){eu;RC__?=F@7T|$$PRhn9c|@0{NvfZc!AN^i
zLwwsT*?gd=JW%i{4{#s{taE}wjn}x`dT7$Hd`s?F?F%QqF22VXMHsJhrW&p(zcQ_O
F-XG4cozDOO

diff --git a/BddCorrect/config/config.php b/BddCorrect/config/config.php
index 505e406..2022814 100644
--- a/BddCorrect/config/config.php
+++ b/BddCorrect/config/config.php
@@ -11,6 +11,10 @@ $vues['vueSupression']='vues/VueSupression.php';
 $vues['vueNbQuestions']='vues/VueNbQuestions.php';
 $vues['vueDemonstration']='vues/VueDemonstration.php';
 $vues['vueQCM']='vues/VueQCM.php';
+$vues['vueAccueil']='vues/VueAccueil.php';
+$vues['vueAdmin']='vues/VueAdmin.php';
+
+
 $vues['vueBoo']='css/bootstrap.min.css';
 $css['vuePrincipale']='css/VuePrincipale.php';
 $css['bootstrap']='css/bootstrap.min.css';
\ No newline at end of file
diff --git a/BddCorrect/controleur/Controleur.php b/BddCorrect/controleur/Controleur.php
index 30df799..e81b82e 100644
--- a/BddCorrect/controleur/Controleur.php
+++ b/BddCorrect/controleur/Controleur.php
@@ -12,10 +12,22 @@ class Controleur {
           echo $action;
           switch($action) {
           
-            case NULL:
+            case NULL :
                     //require ($rep.$vues['vueLogin']);
-                $this->afficherQuestions(); 
-                    break;
+                //$this->afficherQuestions(); 
+                require ($rep.$vues['vueAccueil']);
+                break;
+            
+            case 'Retour au menu principal' :
+                    //require ($rep.$vues['vueLogin']);
+                //$this->afficherQuestions(); 
+                require ($rep.$vues['vueAccueil']);
+                break;
+            
+            case 'Ajouter une question' : 
+                require ($rep.$vues['vueAdmin']);
+                break;
+            
             case 'Afficher les questions':
                     //require ($rep.$vues['vueLogin']);
                 $this->afficherQuestions(); 
@@ -47,6 +59,10 @@ class Controleur {
                 $this->resetDemonstrations();
                 break;
             
+            case 'Réintiliser les questions' :
+                $this->resetQuestions();
+                break;
+            
             case 'Afficher les QCM' :                
                 $this->afficherQCM();
                 break;
@@ -68,6 +84,13 @@ class Controleur {
         //$this->afficherQuestions();
     }    
     
+    
+    
+    function resetQuestions(){
+        $db = new SqliteDb();
+        $db->createTable();
+        $this->afficherQuestions();
+    }
     function resetRandomBdd(){
         require_once('BDD/OracleDb.php');
         $oraDb = new OracleDb();
diff --git a/BddCorrect/css/.bash_history b/BddCorrect/css/.bash_history
new file mode 100644
index 0000000..8cc7f9e
--- /dev/null
+++ b/BddCorrect/css/.bash_history
@@ -0,0 +1,13 @@
+cd /var/www/html/
+cd oracle/
+cd correction-bd-mehdi/
+cd BddCorrect/
+ls
+cd ..
+ls
+ls -l
+chmod -R 777 BddCorrect/
+cd BddCorrect/
+ls -l
+cd Traitement/
+ls -l
diff --git a/BddCorrect/css/VueAccueil.css b/BddCorrect/css/VueAccueil.css
new file mode 100644
index 0000000..0e08ad0
--- /dev/null
+++ b/BddCorrect/css/VueAccueil.css
@@ -0,0 +1,40 @@
+.bouton {
+    background: #0082b5;
+    color: #fff;
+    border: 1px solid #eee;
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;   
+    width: 100%;
+    height: 100px;    
+    margin: 20px;    
+}
+
+.bouton:hover {
+    background: #016ABC;
+    color: #fff;
+    border: 1px solid #eee;
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;
+}
+
+body {
+    text-align: center;
+}
+
+form {
+    margin-top: 100px;
+    display: inline-block;
+    width: 50%;
+}
+
+footer{
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  width: 100%;
+  background-color: red;
+  color: white;
+  text-align: center;
+}
diff --git a/BddCorrect/css/VueDemonstration.css b/BddCorrect/css/VueDemonstration.css
new file mode 100644
index 0000000..6dce448
--- /dev/null
+++ b/BddCorrect/css/VueDemonstration.css
@@ -0,0 +1,34 @@
+#frm-reset{
+   position:absolute;  
+    right: 0;  
+    
+    
+}
+
+
+#frm-reset input{
+    background: #0082b5;
+    color: #fff;
+    border: 1px solid #eee;
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;           
+    width: 500px; 
+   
+    display: block;
+    height: 30%;
+}
+
+#content{
+    min-height:88vh;
+}
+footer{
+    position: relative;
+    bottom: 0;
+    width: 100%;
+    background-color: red;
+    color: white;
+    text-align: center;
+    min-height: 12vh;
+    border : double;
+}
diff --git a/BddCorrect/css/VuePrincipale.css b/BddCorrect/css/VuePrincipale.css
index 62486a3..60e9f87 100644
--- a/BddCorrect/css/VuePrincipale.css
+++ b/BddCorrect/css/VuePrincipale.css
@@ -9,6 +9,79 @@ and open the template in the editor.
 */
 
 .frm{
-    text-align: right;
-    margin: 10px;
+        
+    position:absolute;  
+    right: 0;       
+}
+
+.inp-reset{
+    background: #0082b5;
+    color: #fff;
+    border: 1px solid #eee;
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;           
+    width: 500px; 
+    margin-bottom: 5px;
+    display: block;
+    height: 30%;
+
+}
+
+.inp-reset:hover {
+    background: #d9534f;
+    color: #fff;
+    border: 1px solid #eee;footer{
+    position: relative;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    background-color: red;
+    color: white;
+    text-align: center;
+}
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;
+}
+
+footer{
+    position: relative;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    background-color: red;
+    color: white;
+    text-align: center;
+}
+
+
+li {
+    cursor: pointer;
+}
+
+#btn-ajout, #inp-ret {
+    background: #0082b5;
+    border: 1px solid #eee;
+    color: #fff;
+    border-radius:20px;
+    box-shadow: 5px 5px 5px #eee;
+    margin-bottom: 10px;
+    width: 400px;          
+}
+
+#btn-ajout:hover, #inp-ret:hover {
+    background: #016ABC;
+    color: #fff;
+    border: 1px solid #eee;
+    border-radius: 20px;
+    box-shadow: 5px 5px 5px #eee;
+    text-shadow:none;          
+}
+
+#a-ajout{
+position: absolute;
+    left: 0;
+
+    text-shadow:none;           
 }
\ No newline at end of file
diff --git a/BddCorrect/modeles/Modele.php b/BddCorrect/modeles/Modele.php
index 9628c36..d966b35 100644
--- a/BddCorrect/modeles/Modele.php
+++ b/BddCorrect/modeles/Modele.php
@@ -6,8 +6,7 @@ class Modele {
     function afficherQuestions(){
         $db = new SqliteDb();
         //$db->createTable();
-        $qg = new QuestionsGateway($db);
-                die("test");    
+        $qg = new QuestionsGateway($db);   
 
         $tabQuestions = $qg->afficherQuestions();
         return $tabQuestions;
diff --git a/BddCorrect/nbproject/private/private.properties b/BddCorrect/nbproject/private/private.properties
index 440ba30..19bd4fe 100644
--- a/BddCorrect/nbproject/private/private.properties
+++ b/BddCorrect/nbproject/private/private.properties
@@ -1,6 +1,7 @@
 auxiliary.org-netbeans-modules-php-editor.fluent_2e_setter_2e_project_2e_property=false
 auxiliary.org-netbeans-modules-php-editor.getter_2e_setter_2e_method_2e_name_2e_generation=AS_JAVA
 auxiliary.org-netbeans-modules-php-editor.public_2e_modifier_2e_project_2e_property=false
+browser.id=SL[/Browsers/MicrosoftEdgeBrowser
 copy.src.files=false
 copy.src.on.open=false
 copy.src.target=C:\\xampp\\htdocs\\PhpProject1
diff --git a/BddCorrect/nbproject/private/private.xml b/BddCorrect/nbproject/private/private.xml
index 4279b6d..6e2ea97 100644
--- a/BddCorrect/nbproject/private/private.xml
+++ b/BddCorrect/nbproject/private/private.xml
@@ -3,14 +3,10 @@
     
     
         
-            file:/C:/xampp/htdocs/BddCorrect/vues/VueAdmin.php
-            file:/C:/xampp/htdocs/BddCorrect/Traitement/AjoutQuestion.php
-            file:/C:/xampp/htdocs/BddCorrect/BDD/SqliteDb.php
-            file:/C:/xampp/htdocs/BddCorrect/Traitement/Suppression.php
-            file:/C:/xampp/htdocs/BddCorrect/Traitement/Ordre.php
-            file:/C:/xampp/htdocs/BddCorrect/Traitement/Modification.php
-            file:/C:/xampp/htdocs/BddCorrect/BDD/OracleDb.php
-            file:/C:/xampp/htdocs/BddCorrect/Traitement/Correcteur.php
+            file:/C:/xampp/htdocs/BddCorrect/css/VueAccueil.css
+            file:/C:/xampp/htdocs/BddCorrect/vues/VueAccueil.php
+            file:/C:/xampp/htdocs/BddCorrect/css/VuePrincipale.css
+            file:/C:/xampp/htdocs/BddCorrect/vues/VuePrincipale.php
         
     
 
diff --git a/BddCorrect/vues/VueAccueil.php b/BddCorrect/vues/VueAccueil.php
new file mode 100644
index 0000000..9a5f7a3
--- /dev/null
+++ b/BddCorrect/vues/VueAccueil.php
@@ -0,0 +1,59 @@
+
+
+
+    
+        
+        
+        
+        
+        
+    
+           
+        
+        
+
+

test

+

TEST

+
+
+
+
+ + +
+
+
+
+
+ + + +
+ + +
+
+

IUT Clermont-Ferrand 2020

+
+ +
+ + + + + + + + + + + + + diff --git a/BddCorrect/vues/VueAdmin.php b/BddCorrect/vues/VueAdmin.php index df63ffe..0b7aaba 100644 --- a/BddCorrect/vues/VueAdmin.php +++ b/BddCorrect/vues/VueAdmin.php @@ -3,9 +3,9 @@ - - - + + + @@ -59,6 +59,10 @@
+ +
+ +
- + - - -
-
-

Demonstrations

-

TEST

-
-
+ + +
+ + -
+
-
-
-
-
-

TP 2

- -
- - getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?>
- -

+
+
+
+
+

TP 2

+ + + + getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?>
+ +

+ +

-

- -
- -

- - - +
+ +

+ + + +
+
+
+
+
+
+ + + + +
+ +
+
+
-
-
-
-
-
- - - -
-
-
- -
-
- -
- + +

IUT Clermont-Ferrand 2020

-
- -
- - - - - - - - - - - + + diff --git a/BddCorrect/vues/VuePrincipale.php b/BddCorrect/vues/VuePrincipale.php index 48f7aba..125f891 100644 --- a/BddCorrect/vues/VuePrincipale.php +++ b/BddCorrect/vues/VuePrincipale.php @@ -8,6 +8,11 @@ +
-

test

+

test

TEST

-
+ $questions){ //die(print_r($questions));?> +
-

TP 2

+

-
+ $_SESSION['nbQuestions']) break; */ ?>

getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?>
-

@@ -62,7 +64,7 @@

-
+

@@ -70,32 +72,28 @@
-
+
- -
+ + + + +
+
- - + + +
- -
+ +
createTable(); - $URL="index.php"; - echo ''; - } - ?>
@@ -127,14 +125,24 @@ } init(); + function changerSection(tp,keys){ + + tpk = keys.split(","); + tpk.forEach(function(entry) { + $("#o"+entry).hide(); + console.log(entry); + }); + $("#o"+tp).show(); + + } function SubmitQuestionData(numQuestion, numTp) { //document.write($('#demo'+numQuestion).val()); - var txt = $('#question'+numQuestion).val() ; + var txt = $('#question'+numQuestion+numTp).val() ; $.get("Traitement/Correcteur.php", { textbox : txt, numQuestion : numQuestion, numTp : numTp}, function(data) { - $('#resultatsQuestions'+numQuestion).html(data); + $('#resultatsQuestions'+numQuestion+numTp).html(data); //$('#questionsForm')[0].reset(); }); @@ -143,9 +151,9 @@ function SupprimerQuestion(numQuestion,numTp) { $.get("Traitement/Suppression.php", { numQuestion : numQuestion, numTp : numTp}, function(data) { - $('#resultatsQuestions'+numQuestion).html(data); + //$('#resultatsQuestions'+numQuestion).html(data); //$('#questionsForm')[0].reset(); - location.reload(); + $('#inp-questions').trigger("click"); }); } @@ -168,8 +176,8 @@ function(data) { //$('#questionsForm')[0].reset(); - - window.location.replace("index.php"); + $('#inp-questions').trigger("click"); + //window.location.replace("index.php"); }); } }