Vue démonstration(et correction) + Vue QCM

master
Mehdi 5 years ago
parent 1e3f3a7ce0
commit 494d036377

@ -0,0 +1,23 @@
<?php
session_start();
require_once('SqliteDb.php');
require_once('OracleDb.php');
header('Content-type: text/plain');
$db = new SqliteDb();
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
$textbox = $_POST['textbox'];
$UserQuery = oci_parse($conn, $textbox);
$reponseUser = oci_execute($UserQuery);
$numLigne = 0;
while( ($oracleRow = oci_fetch_array($UserQuery, OCI_NUM))) {
$numLigne++;
echo '<strong> Ligne '.$numLigne.' : </strong>';
for($i=0 ; $i< sizeof($oracleRow) ; $i++){
echo $oracleRow[$i].' ; ';
}
echo '</br>';
}

@ -8,8 +8,8 @@ require_once('OracleDb.php');
header('Content-type: text/plain');
$db = new SqliteDb();
$conn = oci_connect('u_prems', '123456','localhost/orcl');
//$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
$_SESSION['fi'] = array();
$cmpt = 0;
@ -285,10 +285,59 @@ foreach ($_POST['textbox'] as $textbox) {
}
$txt = 'Résultat : ' . $cmpt . '/' . $numQuestion;
// Eléments d'authentification LDAP
$ldaprdn = 'cn=web_bind,OU=DSI,dc=iut,dc=local'; // DN ou RDN LDAP
$ldappass = 'ldap'; // Mot de passe associé
// Connexion au serveur LDAP
$ldapconn = ldap_connect("ldap://192.168.105.5",389)
or die("Impossible de se connecter au serveur LDAP.");
if ($ldapconn) {
// Connexion au serveur LDAP
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// Vérification de l'authentification
if ($ldapbind) {
// echo "Connexion LDAP réussie...";
} else {
// echo "Connexion LDAP échouée...";
}
}
$dn="OU=ITC,OU=uca,OU=etudiants,OU=utilisateurs,DC=iut,
DC=local";
//$dn="OU=enseignants,OU=UIT,OU=uca,OU=personnels,OU=utilisateurs,DC=iut,DC=local";
$filter = "cn=".$_SERVER['REMOTE_USER'];
$sr = ldap_search($ldapconn, $dn, $filter);
/* echo 'Le résultat de la recherche est ' . $sr . '<br />';
echo 'Le nombre d\'entrées retournées est ' . ldap_count_entries($ldapconn,$sr)
. '<br />';
echo 'Lecture des entrées ...<br />';
echo 'Données pour ' . $info["count"] . ' entrées:<br />';
for ($i=0; $i<$info["count"]; $i++) {
echo 'dn est : ' . $info[$i]["dn"] . '<br />';
echo 'premiere entree cn : ' . $info[$i]["cn"][0] . '<br />';
echo 'premier date de naissance : ' . $info[$i]["postofficebox"][0] . '<br />';
}*/
$info = ldap_get_entries($ldapconn, $sr);
$_SESSION["sn"] = $info[0]["sn"][0];
$txt = 'Résultat de '.$info[0]["sn"][0] .' : '. $cmpt . '/' . $numQuestion;
echo $txt;
file_put_contents('resultat.html', ob_get_contents());
//file_put_contents('resultat.html', ob_get_contents());
$fic = fopen("result.txt", "w");
fwrite($fic, $txt);
fclose($fic);

@ -0,0 +1,41 @@
<?php
//require_once ('Question.php');
class QCMGateway {
private $db;
function __construct(SqliteDb $db) {
$this->db=$db;
}
public function afficherQCM() {
$i = 0;
$query = 'SELECT * FROM QcmQuestion';
$query = $this->db->prepare($query);
$result = $query->execute();
$tabReponses =array();
$tabQuestions = array();
//$resultats = $this->db->query('SELECT found_rows()');
while($q = $result->fetchArray()){
$i= $i+1;
$reponseQuery = 'SELECT * FROM QcmReponse WHERE numQuestion=?';
$stmt = $this->db->prepare($reponseQuery);
$stmt->bindParam(1, $q['numQuestion']);
$reponseResult = $stmt->execute();
$i=0;
while ($r = $reponseResult->fetchArray()){
$i++;
$tabReponses[] = new ReponseQCM($r['numReponse'], $r['reponse'], $r['numQuestion']) ;
}
//die(print_r($i, true ));
$tabQuestions[] = new QCM($q['numQuestion'],$q['question'],$tabReponses);
}
//die(print_r($tabQuestions, true ));
return $tabQuestions;
}
}

@ -20,4 +20,17 @@ class QuestionsGateway {
}
return $tabQuestions;
}
public function afficherDemonstrations() {
$i = 0;
$query = 'SELECT * FROM Demonstration';
$query = $this->db->prepare($query);
$result = $query->execute();
//$resultats = $this->db->query('SELECT found_rows()');
while($q = $result->fetchArray()){
$i= $i+1;
$tabDemo[] = new Question($q['numDemo'],$q['description'],$q['reponse']);
}
return $tabDemo;
}
}

@ -16,8 +16,8 @@ class OracleDb {
private $conn;
function __construct() {
$this->conn = oci_connect('u_prems', '123456', 'localhost/orcl');
//$this->conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
//$this->conn = oci_connect('u_prems', '123456', 'localhost/orcl');
$this->conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
$this->createRandomTables();
}

@ -8,6 +8,8 @@ class SqliteDb extends SQLite3
$this->open('test.db');
$this->createLogin();
$this->createTable();
$this->createDemonstration();
$this->createQCM();
}
function createTable(){
@ -120,6 +122,35 @@ class SqliteDb extends SQLite3
}
function createDemonstration(){
$this->exec('DROP TABLE Demonstration');
$this->exec('CREATE TABLE Demonstration ( numDemo NUMBER, description STRING,reponse STRING)');
$this->exec("INSERT INTO Demonstration VALUES(1,'Exemple de requête pour selectionner les 2 premières lignes de la table JOUEUR','SELECT * FROM JOUEUR WHERE rownum<3')");
$this->exec("INSERT INTO Demonstration VALUES(2,'Exemple de requête pour selectionner les 2 premières lignes de la table STATS','SELECT * FROM STATS WHERE rownum<3')");
}
function createQCM(){
$this->exec('DROP TABLE QcmQuestion');
$this->exec('CREATE TABLE QcmQuestion ( numQuestion NUMBER, question STRING)');
$this->exec('DROP TABLE QcmReponse');
$this->exec('CREATE TABLE QcmReponse ( numReponse NUMBER, reponse STRING, numQuestion NUMBER)');
$this->exec('DROP TABLE QcmCorrection');
$this->exec('CREATE TABLE QcmCorrection ( numQuestion NUMBER, numReponse NUMBER)');
$this->exec("INSERT INTO QcmQuestion VALUES(1,'Ceci est la question 1')");
$this->exec("INSERT INTO QcmReponse VALUES(1,'Ceci est la reponse 1 de la question 1(fausse)',1)");
$this->exec("INSERT INTO QcmReponse VALUES(2,'Ceci est la reponse 2 de la question 1(Vraie)',1)");
$this->exec("INSERT INTO QcmReponse VALUES(3,'Ceci est la reponse 3 de la question 1(fausse)',1)");
$this->exec("INSERT INTO QcmCorrection VALUES(1,2)");
}
function createLogin(){
$mdp = password_hash('mdptest', PASSWORD_DEFAULT);
$username = 'test';

@ -0,0 +1,16 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of ValidationQCM
*
* @author Mehdi
*/
class ValidationQCM {
//put your code here
}

@ -8,4 +8,9 @@ $rep=__DIR__.'/../';
$vues['vuePrincipale']='vues/VuePrincipale.php';
$vues['vueLogin']='vues/vueLogin.php';
$vues['vueSupression']='vues/VueSupression.php';
$vues['vueNbQuestions']='vues/VueNbQuestions.php';
$vues['vueNbQuestions']='vues/VueNbQuestions.php';
$vues['vueDemonstration']='vues/VueDemonstration.php';
$vues['vueQCM']='vues/VueQCM.php';
$vues['vueBoo']='css/bootstrap.min.css';
$css['vuePrincipale']='css/VuePrincipale.php';
$css['bootstrap']='css/bootstrap.min.css';

@ -16,7 +16,10 @@ class Controleur {
//require ($rep.$vues['vueLogin']);
$this->afficherQuestions();
break;
case 'Afficher les questions':
//require ($rep.$vues['vueLogin']);
$this->afficherQuestions();
break;
case 'login' :
//$this->verificationConnexion();
require ($rep.$vues['vueLogin']);
@ -26,18 +29,33 @@ class Controleur {
$this->Correction();
break;
case 'Afficher les demonstrations' :
//$this->verificationConnexion();
$this->afficherDemonstrations();
break;
case 'ok' :
//$this->verificationConnexion();
$this->afficherDemonstrations();
break;
case 'Afficher les QCM' :
$this->afficherQCM();
break;
default:
$dVueEreur[] ="Erreur d'appel php";
require ($rep.$vues['erreur']);
$dVueEreur[] ="Erreur d'appel php";
require ($rep.$vues['erreur']);
break;
}
} catch (PDOException $e)
{
$dVueEreur[] = "Erreur inattendue!!! ";
//require ($rep.$vues['erreur']);
$dVueEreur[] = "Erreur inattendue!!! ";
//require ($rep.$vues['erreur']);
}
@ -45,7 +63,7 @@ class Controleur {
}
function afficherQuestions(){
global $rep,$vues;
global $rep,$vues,$css;
$model = new Modele();
$dVueQuestions = $model->afficherQuestions();
@ -56,6 +74,29 @@ class Controleur {
//session_destroy();
}
function afficherDemonstrations(){
global $rep,$vues;
$model = new Modele();
$dVueDemonstrations = $model->afficherDemonstrations();
$_SESSION['arrayDemo']=$dVueDemonstrations;
//require ($rep.$vues['vueSupression']);
//require ($rep.$vues['vuePrincipale']);
require ($rep.$vues['vueDemonstration']);
//session_destroy();
}
function afficherQCM(){
global $rep,$vues;
$model = new Modele();
$tabQCM = $model->afficherQCM();
$_SESSION['arrayQCM']=$tabQCM;
require ($rep.$vues['vueQCM']);
//session_destroy();
}
function verificationConnexion(){
global $rep,$vues;

@ -0,0 +1,45 @@
<?php
class QCM {
private $numQuestion;
private $question;
private $reponse = array();
function __construct($numQuestion,$question,$reponse){
$this->numQuestion = $numQuestion;
$this->question = $question;
$this->reponse = $reponse;
}
// Getters
function getNumQuestion() {
return $this->numQuestion;
}
function getQuestion() {
return $this->question;
}
function getReponse() {
return $this->reponse;
}
// Setters
function setNumQuestion($numQuestion) {
$this->numQuestion = $numQuestion;
}
function setQuestion($question) {
$this->question = $question;
}
function setReponse($reponse) {
$this->reponse = $reponse;
}
}

@ -0,0 +1,37 @@
<?php
class ReponseQCM {
private $numReponse;
private $reponse;
private $numQuestion;
function __construct($numReponse,$reponse,$numQuestion){
$this->numReponse = $numReponse;
$this->reponse = $reponse;
$this->numQuestion = $numQuestion;
}
function getNumReponse() {
return $this->numReponse;
}
function getReponse() {
return $this->reponse;
}
function getNumQuestion() {
return $this->numQuestion;
}
public function __toString(){
$output = ''.$this->getReponse();
return $output;
}
}

@ -12,6 +12,25 @@ class Modele {
return $tabQuestions;
}
function afficherDemonstrations(){
$db = new SqliteDb();
//$db->createTable();
$qg = new QuestionsGateway($db);
$tabDemo = $qg->afficherDemonstrations();
return $tabDemo;
}
function afficherQCM(){
$db = new SqliteDb();
//$db->createTable();
$qg = new QCMGateway($db);
$tabQCM = $qg->afficherQCM();
//die(print_r($tabQCM, true ));
return $tabQCM;
}
function connection($id, $mdp){
$ug = new UserGateway(new SqliteDb());
$vraiMdp = $ug->getPassword($id);

@ -3,13 +3,14 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/VueQCM.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/controleur/Controleur.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/Suppression.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/VueSupression.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/VueNbQuestions.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/AffichageDemo.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/VuePrincipale.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/SqliteDb.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/config/Autoload.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/VueDemonstration.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/Correcteur.php</file>
<file>file:/C:/xampp/htdocs/BddCorrect/vues/vueLogin.php</file>
</group>
</open-files>
</project-private>

@ -1,8 +1,20 @@
La réponse à la question 1 est JUSTE !
<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>35</b><br />
<br />
<b>Warning</b>: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>62</b><br />
<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>110</b><br />
<br />
<b>Warning</b>: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>119</b><br />
La réponse à la question 2 est FAUSSE !
<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>35</b><br />
<br />
<b>Warning</b>: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>62</b><br />
<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>110</b><br />
<br />
<b>Warning</b>: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>119</b><br />
La réponse à la question 3 est FAUSSE !
<br />
@ -12,7 +24,7 @@ La réponse à la question 3 est FAUSSE !
La réponse à la question 4 est FAUSSE !
<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>35</b><br />
qdsdqdsqdqsreponse : 7question : 23<br />
qdsdqdsqdqsreponse : 1question : 5<br />
<b>Warning</b>: oci_execute(): ORA-00900: invalid SQL statement in <b>C:\xampp\htdocs\BddCorrect\Correcteur.php</b> on line <b>244</b><br />
La réponse à la question 5 est FAUSSE !
Résultat : 1/5

Binary file not shown.

@ -4,10 +4,19 @@
<form style="border:1px solid #ccc" method="POST" action="../AjoutQuestion.php">
<div class="container">
<h1>Ajouter Une Question</h1>
<h1>Ajouter une question</h1>
<hr>
<label><b>Num de Question : </b></label>
<label><b>TP n° : </b></label>
<input type="text" placeholder="Numéro du TP" name="tp" required>
<label><b>Numéro de question : </b></label>
<input type="text" placeholder="Saisir le numéro de question..." name="num" required>
<label><b>Barème : </b></label>
<input type="text" placeholder="Barème..." name="points" required>
<label><b>Consigne : </b></label>
<input type="text" placeholder="Ecrire la consigne..." name="consigne" required>
@ -15,14 +24,9 @@
<label><b>Réponse : </b></label>
<input type="text" placeholder="SELECT ..." name="reponse" required>
<label><b>Points : </b></label>
<input type="text" placeholder="Nombre de points..." name="points" required>
<label><b>TP n° : </b></label>
<input type="text" placeholder="Nombre de points..." name="points" required>
<label>
<input type="radio" name="type" value="requete" style="margin-bottom:15px"> requête
<label> <b>Choisir le type de la question : </b><br/>
<input type="radio" name="type" value="requete" style="margin-bottom:15px"> requête simple
<input type="radio" name="type" value="fonction" style="margin-bottom:15px"> fonction
</label><br/>
<label><b>Verification avec BDD aléatoire? </b><br/>

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/VuePrincipale.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">TP de Base De Données</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP2">TP2</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP3">TP3</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP4">TP4</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP5">TP5</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="bg-primary text-white">
<div class="container text-center">
<h1>Demonstrations</h1>
<p class="lead">TEST</p>
</div>
</header>
<div style="font-weight: bold" id="Temps-Restant"></div>
<section id="TP2">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>TP 2</h2>
<form id="myForm" method="post" name="Exam" >
<?php $i=0; //shuffle($dVueQuestions);
$nbQ=1;
foreach ($dVueDemonstrations as $q) {
?>
<p><?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
<textarea rows="5" cols="70" name="textbox<?php echo $q->getNumQuestion(); ?>" id="textbox<?php echo $q->getNumQuestion(); ?>" >
<?php echo $q->getReponse(); ?>
</textarea>
<p><input class="submitFormData" type="button" value="Exécuter" onclick="SubmitFormData(<?php echo $q->getNumQuestion(); ?>);" ></p>
</p>
<div id="results<?php echo $q->getNumQuestion(); ?>">
<!-- les résultats s'affichent içi -->
</div><br/>
<?php $i++; $nbQ++; } //fin foreach ?>
</form>
</div>
</div>
</div>
</section>
<form method="post" class="frm">
<input type="submit" name="test" id="test" value="Générer Base de données aléatoire" /><br/>
<input type="submit" name="regenerer" id="test" value="Réintiliser les questions" /><br/>
</form>
<a href="vues/VueAdmin.php"><button>Ajouter Une Question</button></a>
<a href="vues/VueLibre.php"><button>Creation table</button></a>
<a href="vues/VueSupression.php"><button>vue suppression</button></a>
<form method="post" role="form">
<input type="submit" name="action" value="Afficher les questions" /><br/>
</form>
<?php
if(array_key_exists('test',$_POST)){
$oraDb = new OracleDb;
}
if(array_key_exists('regenerer',$_POST)){
$db = new SqliteDb();
$db->createTable();
$URL="index.php";
echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">';
}
?>
<script>
function SubmitFormData(numQuestion) {
var l= [];
//document.write($('#textbox'+numQuestion).val());
var txt = $('#textbox'+numQuestion).val() ;
/*$('textarea[name^="textbox"]').each(function() {
l.push($(this).val());
});*/
$.post("AffichageDemo.php", { textbox: txt},
function(data) {
$('#results'+numQuestion).html(data);
$('#myForm')[0].reset();
});
}
</script>
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom JavaScript for this theme -->
<script src="js/scrolling-nav.js"></script>
</body>
</html>

@ -1,8 +1,8 @@
<form method="post" class="frmnmbre" >
<input type="text" name="nmbre" id="nmbre" /><br/>
Choisir le nombre de questions à afficher <br/>
<input type="text" name="nmbre" id="nmbre" /><br/>
<p><input type="submit" ></p>
</form>
<?php
@ -10,5 +10,6 @@
if(array_key_exists('nmbre',$_POST)){
$test =2;
$_SESSION['nbQuestions']=$_POST['nmbre'];
if($_POST['nmbre'] == 0) $_SESSION['nbQuestions']='10';
require ($rep.$vues['vuePrincipale']);
}

@ -2,10 +2,11 @@
<html>
<head>
<meta charset="UTF-8">
<meta charset="UTF-8"><style><?php global $rep,$vues,$css; include $rep.$css['bootstrap']; ?></style>
<title></title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="css/VuePrincipale.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
@ -47,7 +48,7 @@
<div class="col-lg-8 mx-auto">
<h2>TP 2</h2>
<form method="post" action="Correcteur.php" name="Exam">
<form id="myForm" method="post" name="Exam">
<?php $i=0; //shuffle($dVueQuestions);
$nbQ=1;
foreach ($dVueQuestions as $q) {
@ -55,22 +56,25 @@
break; ?>
<p><?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
<textarea rows="5" cols="70" name="textbox[]" >
<?php echo (isset($_SESSION['fi'][$i]) ? $_SESSION['fi'][$i] : '') ?>
<?php echo (isset($_SESSION['fi'][$i]) ? $_SESSION['fi'][$i] : '') ?>
</textarea>
<strong>TEST</strong>
</p>
<input type="submit" name="act" value="supprimer">
<input type="submit" name="act" value="supprimer définitivement">
<?php $i++; $nbQ++; } //fin foreach ?>
<p><input type="submit" ></p>
<?php $i++; $nbQ++; } //fin foreach ?>
<p><input id="submitFormData" type="button" value="Submit" onclick="SubmitFormData();"></p>
</form>
</form>
<p id="demo"></p>
<div id="results">
<!-- All data will display here -->
</div>
</div>
</div>
</div>
</section>
<form method="post" class="frm">
<input type="submit" name="test" id="test" value="Générer Base de données aléatoire" /><br/>
<input type="submit" name="regenerer" id="test" value="Réintiliser les questions" /><br/>
@ -79,7 +83,12 @@
<a href="vues/VueLibre.php"><button>Creation table</button></a>
<a href="vues/VueSupression.php"><button>vue suppression</button></a>
<form method="post" role="form">
<input type="submit" name="action" value="Afficher les demonstrations" ><br/>
</form>
<form method="post" role="form">
<input type="submit" name="action" value="Afficher les QCM" ><br/>
</form>
<?php
if(array_key_exists('test',$_POST)){
@ -94,8 +103,10 @@
?>
<script type="text/javascript">
var tempsMin =50 ;
var total_secondes =60*tempsMin;
tempsMin = parseInt(total_secondes/60);
@ -117,7 +128,42 @@
setTimeout("TempsRestant()",999);
}
}
init();
init();
function myFunction() {
var x, text;
// Get the value of the input field with id="numb"
x = document.getElementById("numb").value;
// If x is Not a Number or less than one or greater than 10
if (isNaN(x) || x < 1 || x > 10) {
text = "Input not valid";
} else {
text = "Input OK";
}
document.getElementById("demo").innerHTML = text;
}
//document.getElementById('insertHere').innerHTML = '<div>Print this after the script tag</div>';
function SubmitFormData() {
var l= [];
$('textarea[name^="textbox"]').each(function() {
l.push($(this).val());
});
$.post("Correcteur.php", { textbox: l},
function(data) {
$('#results').html(data);
$('#myForm')[0].reset();
});
}
</script>
<!-- Footer -->
<footer class="py-5 bg-dark">

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/VuePrincipale.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">TP de Base De Données</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP2">TP2</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP3">TP3</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP4">TP4</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#TP5">TP5</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="bg-primary text-white">
<div class="container text-center">
<h1>test</h1>
<p class="lead">TEST</p>
</div>
</header>
<div style="font-weight: bold" id="Temps-Restant"></div>
<section id="TP2">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>TP 2</h2>
<form method="post" action="Correcteur.php" name="Exam">
<?php $i=0; //shuffle($dVueQuestions);
$nbQ=1;
foreach ($tabQCM as $qcm) {
?>
<p><?php $i++; echo $qcm->getNumQuestion() .'.'.$qcm->getQuestion(); ?> <br/>
<?php
foreach ($qcm->getReponse() as $r ) { ?>
<input type="radio" name="<?php echo $qcm->getQuestion();?>" value="<?php echo $r->getReponse();?>" style="margin-bottom:15px"> <?php echo $r->getNumReponse().'.'.$r->getReponse(); ?> <br/>
<?php
}
?>
</p>
<?php $i++; $nbQ++; } //fin foreach ?>
<p><input type="submit" ></p>
</form>
</div>
</div>
</div>
</section>
<a href="vues/VueAdmin.php"><button>Ajouter Une Question</button></a>
<a href="vues/VueLibre.php"><button>Creation table</button></a>
<a href="vues/VueSupression.php"><button>vue suppression</button></a>
<form method="post" role="form">
<input type="submit" name="action" value="Afficher les demonstrations" ><br/>
</form>
<?php
?>
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom JavaScript for this theme -->
<script src="js/scrolling-nav.js"></script>
</body>
</html>
Loading…
Cancel
Save