parent
dd0006c1bb
commit
b267e02f1f
@ -0,0 +1,270 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of OracleDb
|
||||||
|
*
|
||||||
|
* @author Mehdi
|
||||||
|
*/
|
||||||
|
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('palafour2', 'palafour2', 'kirov:1521/kirov');
|
||||||
|
//$this->createRandomTables();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRandomTables() {
|
||||||
|
$this->createRandomStats();
|
||||||
|
$this->createRandomJoueur();
|
||||||
|
$this->createRandomEquipe();
|
||||||
|
$this->createRandomGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRandomStats(){
|
||||||
|
//Creation de la table
|
||||||
|
$drop = oci_parse($this->conn, 'DROP TABLE randomstats');
|
||||||
|
oci_execute($drop);
|
||||||
|
$q = oci_parse($this->conn, 'CREATE TABLE randomstats AS SELECT * FROM stats WHERE 1=0');
|
||||||
|
oci_execute($q);
|
||||||
|
|
||||||
|
//Insertion Stats
|
||||||
|
$tabStats = oci_parse($this->conn, 'SELECT * FROM stats');
|
||||||
|
oci_execute($tabStats);
|
||||||
|
|
||||||
|
$tabDate = array();
|
||||||
|
$tabType = array();
|
||||||
|
$tabEquipeJoueur = array();
|
||||||
|
$tabLocation = array();
|
||||||
|
$tabResultat = array();
|
||||||
|
$tabPrenom = array();
|
||||||
|
$tabStatus = array();
|
||||||
|
$tabMinutes = array();
|
||||||
|
$tabNaissance = array();
|
||||||
|
$tabPoints = array();
|
||||||
|
$tabPasses = array();
|
||||||
|
$tabBallesPerdues = array();
|
||||||
|
$tabInterceptions = array();
|
||||||
|
$tabContres = array();
|
||||||
|
$tabFautes = array();
|
||||||
|
$tabTirsPris = array();
|
||||||
|
$tabTirsMarques = array();
|
||||||
|
$tabTirsPourcent = array();
|
||||||
|
$tabTirs2Pris = array();
|
||||||
|
$tabTirs2Marques = array();
|
||||||
|
$tabTirs2Pourcent = array();
|
||||||
|
$tabTirs3Pris = array();
|
||||||
|
$tabTirs3Marques = array();
|
||||||
|
$tabTirs3Pourcent = array();
|
||||||
|
$tabLfPris = array();
|
||||||
|
$tabLfMarques = array();
|
||||||
|
$tabLfPourcent = array();
|
||||||
|
$tabRebondDef = array();
|
||||||
|
$tabRebondOff = array();
|
||||||
|
$tabRebondTotal = array();
|
||||||
|
$tabEquipeAdverse = array();
|
||||||
|
|
||||||
|
while ($statsArray = oci_fetch_array($tabStats, OCI_NUM)) {
|
||||||
|
$tabDate[] = $statsArray[0];
|
||||||
|
$tabType[] = $statsArray[1];
|
||||||
|
$tabEquipeJoueur[] = $statsArray[2];
|
||||||
|
$tabLocation[] = $statsArray[3];
|
||||||
|
$tabResultat[] = $statsArray[4];
|
||||||
|
$tabPrenom[] = $statsArray[5];
|
||||||
|
$tabStatus[] = $statsArray[6];
|
||||||
|
$tabMinutes[] = $statsArray[7];
|
||||||
|
$tabNaissance[] = $statsArray[8];
|
||||||
|
$tabPoints[] = $statsArray[9];
|
||||||
|
$tabPasses[] = $statsArray[10];
|
||||||
|
$tabBallesPerdues[] = $statsArray[11];
|
||||||
|
$tabInterceptions[] = $statsArray[12];
|
||||||
|
$tabContres[] = $statsArray[13];
|
||||||
|
$tabFautes[] = $statsArray[14];
|
||||||
|
$tabTirsPris[] = $statsArray[15];
|
||||||
|
$tabTirsMarques[] = $statsArray[16];
|
||||||
|
$tabTirsPourcent[] = $statsArray[17];
|
||||||
|
$tabTirs2Pris[] = $statsArray[18];
|
||||||
|
$tabTirs2Marques[] = $statsArray[19];
|
||||||
|
$tabTirs2Pourcent[] = $statsArray[20];
|
||||||
|
$tabTirs3Pris[] = $statsArray[21];
|
||||||
|
$tabTirs3Marques[] = $statsArray[22];
|
||||||
|
$tabTirs3Pourcent[] = $statsArray[23];
|
||||||
|
$tabLfPris[] = $statsArray[24];
|
||||||
|
$tabLfMarques[] = $statsArray[25];
|
||||||
|
$tabLfPourcent[] = $statsArray[26];
|
||||||
|
$tabRebondDef[] = $statsArray[27];
|
||||||
|
$tabRebondOff[] = $statsArray[28];
|
||||||
|
$tabRebondTotal[] = $statsArray[29];
|
||||||
|
$tabEquipeAdverse[] = $statsArray[30];
|
||||||
|
}
|
||||||
|
|
||||||
|
shuffle($tabDate);
|
||||||
|
shuffle($tabType);
|
||||||
|
shuffle($tabEquipeJoueur);
|
||||||
|
shuffle($tabLocation);
|
||||||
|
shuffle($tabResultat);
|
||||||
|
shuffle($tabPrenom);
|
||||||
|
shuffle($tabStatus);
|
||||||
|
shuffle($tabMinutes);
|
||||||
|
shuffle($tabNaissance);
|
||||||
|
shuffle($tabPoints);
|
||||||
|
shuffle($tabPasses);
|
||||||
|
shuffle($tabBallesPerdues);
|
||||||
|
shuffle($tabInterceptions);
|
||||||
|
shuffle($tabContres);
|
||||||
|
shuffle($tabFautes);
|
||||||
|
shuffle($tabTirsPris);
|
||||||
|
shuffle($tabTirsMarques);
|
||||||
|
shuffle($tabTirsPourcent);
|
||||||
|
shuffle($tabTirs2Pris);
|
||||||
|
shuffle($tabTirs2Marques);
|
||||||
|
shuffle($tabTirs2Pourcent);
|
||||||
|
shuffle($tabTirs3Pris);
|
||||||
|
shuffle($tabTirs3Marques);
|
||||||
|
shuffle($tabTirs3Pourcent);
|
||||||
|
shuffle($tabLfPris);
|
||||||
|
shuffle($tabLfMarques);
|
||||||
|
shuffle($tabLfPourcent);
|
||||||
|
shuffle($tabRebondDef);
|
||||||
|
shuffle($tabRebondOff);
|
||||||
|
shuffle($tabRebondTotal);
|
||||||
|
shuffle($tabEquipeAdverse);
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($tabDate); $i++) {
|
||||||
|
$insert = oci_parse($this->conn, 'INSERT INTO randomstats VALUES(\'' . $tabDate[$i] . ' \' , \''.$tabType[$i].'\' ,\'' . $tabEquipeJoueur[$i] . '\' , \'' . $tabLocation[$i] . '\' , \'' . $tabResultat[$i] . '\' , \'' . $tabPrenom[$i] . '\' , \'' . $tabStatus[$i] . '\' ,' . $tabMinutes[$i] . ' , \'' . $tabNaissance[$i] . ' \' ,'.$tabPoints[$i] . ' ,'.$tabPasses[$i] . ' ,'.$tabBallesPerdues[$i] . ' ,'.$tabInterceptions[$i] . ' ,'.$tabContres[$i] . ' ,'.$tabFautes[$i] . ' ,'.$tabTirsPris[$i] . ' ,'.$tabTirsMarques[$i] . ' ,'.$tabTirsPourcent[$i] . ' ,'.$tabTirs2Pris[$i] . ' ,'.$tabTirs2Marques[$i] . ' ,'.$tabTirs2Pourcent[$i] . ' ,'.$tabTirs3Pris[$i] . ' ,'.$tabTirs3Marques[$i] . ' ,'.$tabTirs3Pourcent[$i] . ' ,'.$tabLfPris[$i] . ' ,'.$tabLfMarques[$i] . ' ,'.$tabLfPourcent[$i] . ' ,'.$tabRebondDef[$i] . ' ,'.$tabRebondOff[$i] . ' ,'.$tabRebondTotal[$i] . ' , \'' . $tabEquipeAdverse[$i] . '\' ) ');
|
||||||
|
oci_execute($insert);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRandomJoueur(){
|
||||||
|
//Creation de la table
|
||||||
|
$drop = oci_parse($this->conn, 'DROP TABLE randomjoueur');
|
||||||
|
oci_execute($drop);
|
||||||
|
$q = oci_parse($this->conn, 'CREATE TABLE randomjoueur AS SELECT * FROM joueur WHERE 1=0');
|
||||||
|
oci_execute($q);
|
||||||
|
|
||||||
|
//Insertion Joueur
|
||||||
|
$tabJoueur = oci_parse($this->conn, 'SELECT * FROM joueur');
|
||||||
|
oci_execute($tabJoueur);
|
||||||
|
|
||||||
|
$tabPrenomnomj = array();
|
||||||
|
$tabAnneedebut = array();
|
||||||
|
$tabAnneefin = array();
|
||||||
|
$tabPoste = array();
|
||||||
|
$tabTaille = array();
|
||||||
|
$tabPoids = array();
|
||||||
|
$tabDateNaissanceJ = array();
|
||||||
|
|
||||||
|
while ($joueurArray = oci_fetch_array($tabJoueur, OCI_NUM)) {
|
||||||
|
$tabPrenomnomj[] = $joueurArray[0];
|
||||||
|
$tabAnneedebut[] = $joueurArray[1];
|
||||||
|
$tabAnneefin[] = $joueurArray[2];
|
||||||
|
$tabPoste[] = $joueurArray[3];
|
||||||
|
$tabTaille[] = $joueurArray[4];
|
||||||
|
$tabPoids[] = $joueurArray[5];
|
||||||
|
$tabDateNaissanceJ[] = $joueurArray[6];
|
||||||
|
}
|
||||||
|
|
||||||
|
shuffle($tabPrenomnomj);
|
||||||
|
shuffle($tabAnneedebut);
|
||||||
|
shuffle($tabAnneefin);
|
||||||
|
shuffle($tabPoste);
|
||||||
|
shuffle($tabTaille);
|
||||||
|
shuffle($tabPoids);
|
||||||
|
shuffle($tabDateNaissanceJ);
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($tabPrenomnomj); $i++) {
|
||||||
|
$insert = oci_parse($this->conn, 'INSERT INTO randomJoueur VALUES(\'' . $tabPrenomnomj[$i] . ' \' ,' . $tabAnneedebut[$i] . ' ,'.$tabAnneefin[$i] . ' , \'' . $tabPoste[$i] . '\', '.$tabTaille[$i] . ','.$tabPoids[$i] . ',\'' . $tabDateNaissanceJ[$i] . '\' ) ');
|
||||||
|
oci_execute($insert);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRandomEquipe(){
|
||||||
|
//Creation de la table
|
||||||
|
$drop = oci_parse($this->conn, 'DROP TABLE randomequipe');
|
||||||
|
oci_execute($drop);
|
||||||
|
$q = oci_parse($this->conn, 'CREATE TABLE randomequipe AS SELECT * FROM equipe WHERE 1=0');
|
||||||
|
oci_execute($q);
|
||||||
|
|
||||||
|
//Insertion Joueur
|
||||||
|
$tabEquipe = oci_parse($this->conn, 'SELECT * FROM equipe');
|
||||||
|
oci_execute($tabEquipe);
|
||||||
|
|
||||||
|
$tabId = array();
|
||||||
|
$tabVille = array();
|
||||||
|
$tabNom = array();
|
||||||
|
$tabConference = array();
|
||||||
|
|
||||||
|
while ($equipeArray = oci_fetch_array($tabEquipe, OCI_NUM)) {
|
||||||
|
$tabId[] = $equipeArray[0];
|
||||||
|
$tabVille[] = $equipeArray[1];
|
||||||
|
$tabNom[] = $equipeArray[2];
|
||||||
|
$tabConference[] = $equipeArray[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
shuffle($tabId);
|
||||||
|
shuffle($tabVille);
|
||||||
|
shuffle($tabNom);
|
||||||
|
shuffle($tabConference);
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($tabId); $i++) {
|
||||||
|
$insert = oci_parse($this->conn, 'INSERT INTO randomequipe VALUES(\'' . $tabId[$i] . '\' ,\'' . $tabVille[$i] . '\', \'' . $tabNom[$i] . '\', \'' . $tabConference[$i] . '\' ) ');
|
||||||
|
oci_execute($insert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRandomGame(){
|
||||||
|
//Creation de la table
|
||||||
|
$drop = oci_parse($this->conn, 'DROP TABLE randomgame');
|
||||||
|
oci_execute($drop);
|
||||||
|
$q = oci_parse($this->conn, 'CREATE TABLE randomgame AS SELECT * FROM game WHERE 1=0');
|
||||||
|
oci_execute($q);
|
||||||
|
|
||||||
|
//Insertion Joueur
|
||||||
|
$tabGame = oci_parse($this->conn, 'SELECT * FROM game');
|
||||||
|
oci_execute($tabGame);
|
||||||
|
|
||||||
|
$tabDate = array();
|
||||||
|
$tabHoraire = array();
|
||||||
|
$tabIdDomicile = array();
|
||||||
|
$tabIdExterieur = array();
|
||||||
|
$tabResultatDomicile = array();
|
||||||
|
$tabResultatExterieur = array();
|
||||||
|
$tabScoreDomicile = array();
|
||||||
|
$tabScoreExterieur = array();
|
||||||
|
|
||||||
|
while ($gameArray = oci_fetch_array($tabGame, OCI_NUM)) {
|
||||||
|
$tabDate[] = $gameArray[0];
|
||||||
|
$tabHoraire[] = $gameArray[1];
|
||||||
|
$tabIdDomicile[] = $gameArray[2];
|
||||||
|
$tabResultatDomicile[] = $gameArray[3];
|
||||||
|
$tabScoreDomicile[] = $gameArray[4];
|
||||||
|
$tabIdExterieur[] = $gameArray[5];
|
||||||
|
$tabResultatExterieur[] = $gameArray[6];
|
||||||
|
$tabScoreExterieur[] = $gameArray[7];
|
||||||
|
}
|
||||||
|
shuffle($tabDate);
|
||||||
|
shuffle($tabHoraire);
|
||||||
|
shuffle($tabIdDomicile);
|
||||||
|
shuffle($tabResultatDomicile);
|
||||||
|
shuffle($tabScoreDomicile);
|
||||||
|
shuffle($tabIdExterieur);
|
||||||
|
shuffle($tabResultatExterieur);
|
||||||
|
shuffle($tabScoreExterieur);
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($tabDate); $i++) {
|
||||||
|
$insert = oci_parse($this->conn, 'INSERT INTO randomgame VALUES(\'' . $tabDate[$i] . '\' ,' . $tabHoraire[$i] . ', \'' . $tabIdDomicile[$i] . '\', \''.$tabResultatDomicile[$i].'\', \''.$tabScoreDomicile[$i].'\', \''.$tabIdExterieur[$i].'\', \''.$tabResultatExterieur[$i].'\',' .$tabScoreExterieur[$i].' ) ');
|
||||||
|
oci_execute($insert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConn(){
|
||||||
|
return $this->conn;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,583 @@
|
|||||||
|
<?php
|
||||||
|
//header('Content-type: text/plain');
|
||||||
|
require_once('OracleDb.php');
|
||||||
|
|
||||||
|
class SqliteDb extends SQLite3
|
||||||
|
{
|
||||||
|
private $conn;
|
||||||
|
function __construct($o = 'n')
|
||||||
|
{
|
||||||
|
$odb = new OracleDb();
|
||||||
|
$this->conn = $odb->getConn();
|
||||||
|
if($o == 'n')
|
||||||
|
$this->open('Traitement/test2.db');
|
||||||
|
else if($o == 'save'){
|
||||||
|
$this->open('../test2.db');
|
||||||
|
}
|
||||||
|
else $this->open('test2.db');
|
||||||
|
//$this->createNotes();
|
||||||
|
//$this->createLogin();
|
||||||
|
// $this->createTable();
|
||||||
|
//$this->createDemonstration();
|
||||||
|
//$this->createQCM();
|
||||||
|
// $this->createDateTp();
|
||||||
|
//$this->creerSauvegardeQcm();
|
||||||
|
//$this->creerSauvegardeTp();
|
||||||
|
//$this->createNotesTp();
|
||||||
|
}
|
||||||
|
|
||||||
|
function creerSauvegardeQcm(){
|
||||||
|
$this->exec('DROP TABLE QcmSauvegarde');
|
||||||
|
$this->exec('CREATE TABLE QcmSauvegarde ( idEtudiant STRING,numQcm NUMBER, numQuestion NUMBER, numReponse NUMBER, UNIQUE(idEtudiant,numQcm,numQuestion,numReponse))');
|
||||||
|
}
|
||||||
|
|
||||||
|
function createNotes(){
|
||||||
|
$this->exec('DROP TABLE Notes');
|
||||||
|
//$this->exec('CREATE TABLE Notes ( nomExercice STRING, nomPrenom STRING,numEtudiant NUMBER, note NUMBER, UNIQUE(numEtudiant))');
|
||||||
|
$this->exec('CREATE TABLE Notes ( idEtudiant STRING,numQcm NUMBER, note NUMBER, UNIQUE(idEtudiant,numQcm))');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE NotesParQuestion');
|
||||||
|
$this->exec('CREATE TABLE NotesParQuestion ( idEtudiant STRING, numQcm NUMBER, numQuestion NUMBER, note NUMBER, UNIQUE(idEtudiant,numQuestion,numQcm))');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function creerSauvegardeTp(){
|
||||||
|
$this->exec('DROP TABLE TpSauvegarde');
|
||||||
|
$this->exec('CREATE TABLE TpSauvegarde ( idEtudiant STRING,numTp NUMBER, numQuestion NUMBER, reponse NUMBER, UNIQUE(idEtudiant,numTp,numQuestion))');
|
||||||
|
}
|
||||||
|
|
||||||
|
function createNotesTp(){
|
||||||
|
$this->exec('DROP TABLE NotesTp');
|
||||||
|
//$this->exec('CREATE TABLE Notes ( nomExercice STRING, nomPrenom STRING,numEtudiant NUMBER, note NUMBER, UNIQUE(numEtudiant))');
|
||||||
|
$this->exec('CREATE TABLE NotesTp( idEtudiant STRING,numTp NUMBER, note NUMBER, UNIQUE(idEtudiant,numTp))');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE NotesParQuestionTp');
|
||||||
|
$this->exec('CREATE TABLE NotesParQuestionTp ( idEtudiant STRING, numTp NUMBER, numQuestion NUMBER, note NUMBER, UNIQUE(idEtudiant,numQuestion,numTp))');
|
||||||
|
}
|
||||||
|
|
||||||
|
function ecrireFichierNotes($numQcm,$save = 'o',$type){
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
$info = ldap_get_entries($ldapconn, $sr);
|
||||||
|
if($type == 'vraifaux'){
|
||||||
|
$query = $this->prepare('SELECT * FROM Qcm WHERE numQcm=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$result = $query->execute();
|
||||||
|
$nomResult = $result->fetchArray();
|
||||||
|
if(!$nomResult['nom']) exit();
|
||||||
|
if($save != 'o'){
|
||||||
|
$file = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."QCM".DIRECTORY_SEPARATOR."notes_".$nomResult['nom'].".txt", "w");
|
||||||
|
$fileDetail = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."QCM".DIRECTORY_SEPARATOR."notesDetaillees_".$nomResult['nom'].".txt", "w");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$file = fopen("..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."QCM".DIRECTORY_SEPARATOR."notes_".$nomResult['nom'].".txt", "w");
|
||||||
|
$fileDetail = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."QCM".DIRECTORY_SEPARATOR."notesDetaillees_".$nomResult['nom'].".txt", "w");
|
||||||
|
}
|
||||||
|
$query = $this->prepare('SELECT * FROM Notes WHERE numQcm=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$query = $this->prepare('SELECT count(*) FROM QcmQuestion WHERE numQcm=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$resultCount = $query->execute();
|
||||||
|
$nbQuestion = $resultCount->fetchArray();
|
||||||
|
|
||||||
|
while($r = $result->fetchArray()){
|
||||||
|
$filter = "cn=".$r['idEtudiant'];
|
||||||
|
$sr = ldap_search($ldapconn, $dn, $filter);
|
||||||
|
$info = ldap_get_entries($ldapconn, $sr);
|
||||||
|
|
||||||
|
$ligne = $r['idEtudiant'].','.$info[0]["givenname"][0].','.$info[0]["sn"][0].",".$info[0]["postalcode"][0];
|
||||||
|
for($i = 1 ; $i<= $nbQuestion['count(*)'] ; $i++){
|
||||||
|
$query = $this->prepare('SELECT * FROM NotesParQuestion WHERE numQcm=? AND numQuestion=? AND idEtudiant=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$query->bindParam(2,$i);
|
||||||
|
$query->bindParam(3,$r['idEtudiant']);
|
||||||
|
$resultNoteQuestions = $query->execute();
|
||||||
|
$noteQuestionRow = $resultNoteQuestions->fetchArray();
|
||||||
|
$ligne = $ligne.','.$noteQuestionRow['note'];
|
||||||
|
}
|
||||||
|
$ligne = $ligne.','.$r['note'];
|
||||||
|
fwrite($fileDetail,$ligne."\n");
|
||||||
|
//echo $info[0]["givenname"][0].','.$info[0]["postalcode"][0].",".$r['note']."\n";
|
||||||
|
fwrite($file, $r['idEtudiant'].','.$info[0]["givenname"][0].','.$info[0]["sn"][0].",".$info[0]["postalcode"][0].",".$r['note']."\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// numqcm = numtp !!
|
||||||
|
if($save != 'o'){
|
||||||
|
$file = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."tp".DIRECTORY_SEPARATOR."notesTp_".$numQcm.".txt", "w");
|
||||||
|
$fileDetail = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."tp".DIRECTORY_SEPARATOR."notesTpDetaillees_".$numQcm.".txt", "w");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$file = fopen("..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."tp".DIRECTORY_SEPARATOR."notesTp_".$numQcm.".txt", "w");
|
||||||
|
$fileDetail = fopen("..".DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Notes".DIRECTORY_SEPARATOR."tp".DIRECTORY_SEPARATOR."notesTpDetaillees_".$numQcm.".txt", "w");
|
||||||
|
}
|
||||||
|
if(!$file) echo 'erreur';
|
||||||
|
$query = $this->prepare('SELECT * FROM NotesTp WHERE numTp=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$query = $this->prepare('SELECT count(*) FROM type WHERE numTp=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$resultCount = $query->execute();
|
||||||
|
$nbQuestion = $resultCount->fetchArray();
|
||||||
|
|
||||||
|
while($r = $result->fetchArray()){
|
||||||
|
$filter = "cn=".$r['idEtudiant'];
|
||||||
|
$sr = ldap_search($ldapconn, $dn, $filter);
|
||||||
|
$info = ldap_get_entries($ldapconn, $sr);
|
||||||
|
|
||||||
|
$ligne = $r['idEtudiant'].','.$info[0]["givenname"][0].','.$info[0]["sn"][0].",".$info[0]["postalcode"][0];
|
||||||
|
for($i = 1 ; $i<= $nbQuestion['count(*)'] ; $i++){
|
||||||
|
$query = $this->prepare('SELECT * FROM NotesParQuestionTp WHERE numTp=? AND numQuestion=? AND idEtudiant=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$query->bindParam(2,$i);
|
||||||
|
$query->bindParam(3,$r['idEtudiant']);
|
||||||
|
$resultNoteQuestions = $query->execute();
|
||||||
|
$noteQuestionRow = $resultNoteQuestions->fetchArray();
|
||||||
|
$ligne = $ligne.','.$noteQuestionRow['note'];
|
||||||
|
}
|
||||||
|
$ligne = $ligne.','.$r['note'];
|
||||||
|
fwrite($fileDetail,$ligne."\n");
|
||||||
|
//echo $info[0]["givenname"][0].','.$info[0]["postalcode"][0].",".$r['note']."\n";
|
||||||
|
fwrite($file, $r['idEtudiant'].','.$info[0]["givenname"][0].','.$info[0]["sn"][0].",".$info[0]["postalcode"][0].",".$r['note']."\n");
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
|
fclose($fileDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createTable(){
|
||||||
|
//Création De La Table
|
||||||
|
$this->exec('DROP TABLE Correct');
|
||||||
|
$this->exec('CREATE TABLE Correct ( bddConcernee STRING,numTp NUMBER, numquestion NUMBER,question STRING, reponse STRING,points NUMBER,aleatoire CHAR)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE FunctionCorrect');
|
||||||
|
$this->exec('CREATE TABLE FunctionCorrect (bddConcernee STRING,numTp NUMBER, numquestion NUMBER, question STRING, reponse STRING, fonctionCorrect STRING,testUser STRING, points NUMBER)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE TriggerCorrect');
|
||||||
|
$this->exec('CREATE TABLE TriggerCorrect ( bddConcernee STRING,numTp NUMBER, numquestion NUMBER,question STRING, reponse STRING,fonctionCorrect STRING,testUser STRING)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE Type');
|
||||||
|
$this->exec('CREATE TABLE Type ( numTp NUMBER,numQuestion NUMBER,type STRING)');
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO Type VALUES(2,1,'query')");
|
||||||
|
$this->exec("INSERT INTO Type VALUES(2,2,'query')");
|
||||||
|
$this->exec("INSERT INTO Type VALUES(2,3,'query')");
|
||||||
|
$this->exec("INSERT INTO Type VALUES(2,4,'query')");
|
||||||
|
$this->exec("INSERT INTO Type VALUES(2,5,'functionCorrect')");
|
||||||
|
|
||||||
|
|
||||||
|
$this->createDateTp();
|
||||||
|
|
||||||
|
//Question 1
|
||||||
|
/* $type = 'query';
|
||||||
|
$points =1;
|
||||||
|
$reponse = 'SELECT count(*) FROM STATS WHERE prenomnoms=\'Kevin Durant\' ';
|
||||||
|
$q = "INSERT INTO Correct VALUES ('NBA',2,1,'Trouver le nombre de matchs joués par Kevin Durant', ? ,?,'o')";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$reponse);
|
||||||
|
$stmt->bindParam(2,$points);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
//Question 2
|
||||||
|
$type = 'query';
|
||||||
|
$points =1;
|
||||||
|
$reponse = ' SELECT prenomnoms,datematch,points,equipeadverse FROM STATS WHERE points = (SELECT max(points) FROM STATS)';
|
||||||
|
$q = "INSERT INTO Correct VALUES ('NBA',2,2,'Lister le(s) joueur(s) ayant marqué le plus de points dans la saison en indiquant son nom, la date du match, le nombre de points, l équipe adverse et le nombre de points marqués ', ? ,?,'o')";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$reponse);
|
||||||
|
$stmt->bindParam(2,$points);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
//Question 3
|
||||||
|
$type = 'query';
|
||||||
|
$points =1;
|
||||||
|
$reponse = ' SELECT prenomnoms, COUNT(*) FROM STATS GROUP BY prenomnoms HAVING count(*) = (SELECT MAX(c) FROM (SELECT COUNT(*) AS c FROM STATS GROUP BY prenomnoms))';
|
||||||
|
$q = "INSERT INTO Correct VALUES ('NBA',2,3,'Lister le(s) joueur(s) ayant joué le plus de match pendant la saison', ? ,?,'o')";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$reponse);
|
||||||
|
$stmt->bindParam(2,$points);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
//Question 4
|
||||||
|
$type = 'query';
|
||||||
|
$points =1;
|
||||||
|
$reponse = 'SELECT nom FROM EQUIPE, STATS WHERE datematch = \'30-OCT-17\' AND prenomnoms = \'Kevin Durant\' AND idequipe = CASE WHEN locationjoueur = \'Away\' THEN equipeadverse WHEN locationjoueur = \'Home\' THEN equipejoueur END ';
|
||||||
|
$q = "INSERT INTO Correct VALUES ('NBA',2,4,'Déterminer pour Kevin Durant pour le match du 30-oct-17 quelle est l équipe qui joue à domicile', ?,?,'n' )";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$reponse);
|
||||||
|
$stmt->bindParam(2,$points);
|
||||||
|
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
//Question 5
|
||||||
|
$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;' ;
|
||||||
|
$reponse = 'SELECT fpointsmarques(\''.$dateRandom.'\', \''.$joueurRandom.'\') FROM DUAL';
|
||||||
|
$testU = 'SELECT pointsmarques(\''.$dateRandom.'\', \''.$joueurRandom.'\') FROM DUAL' ;
|
||||||
|
$points =1;
|
||||||
|
$q = "INSERT INTO FunctionCorrect VALUES ('NBA',2,5,'Ecrire une fonction pointsmarques qui détermine pour une date de match et un joueur donnés quelle est le nombre de points marqués par ce joueur', ?,?,?,? )";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$reponse);
|
||||||
|
$stmt->bindParam(2,$fonctionCorrect);
|
||||||
|
$stmt->bindParam(3,$testU);
|
||||||
|
$stmt->bindParam(4,$points);
|
||||||
|
$stmt->execute();*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function createDemonstration(){
|
||||||
|
$this->exec('DROP TABLE Demonstration');
|
||||||
|
$this->exec('CREATE TABLE Demonstration ( bddconcernee STRING ,chapitre NUMBER, numDemo NUMBER, description STRING,reponse STRING)');
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO Demonstration VALUES('NBA',1,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('NBA',1,2,'Exemple de requête pour selectionner les 2 premières lignes de la table STATS','SELECT * FROM STATS WHERE rownum<3')");
|
||||||
|
$this->exec("INSERT INTO Demonstration VALUES('NBA',2,1,'Exemple de requête pour selectionner les 2 premières lignes de la table GAME','SELECT * FROM GAME WHERE rownum<3')");
|
||||||
|
}
|
||||||
|
|
||||||
|
function createQCM(){
|
||||||
|
$this->exec('DROP TABLE Qcm');
|
||||||
|
$this->exec('CREATE TABLE Qcm ( numQcm NUMBER, nom STRING,type STRING,introduction STRING)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE QcmQuestion');
|
||||||
|
$this->exec('CREATE TABLE QcmQuestion ( numQuestion NUMBER,numQcm NUMBER, question STRING,bareme NUMBER)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE QcmReponse');
|
||||||
|
$this->exec('CREATE TABLE QcmReponse ( numQcm NUMBER, numReponse NUMBER, reponse STRING, numQuestion NUMBER, points NUMBER)');
|
||||||
|
|
||||||
|
$this->exec('DROP TABLE QcmCorrection');
|
||||||
|
$this->exec('CREATE TABLE QcmCorrection (numQcm NUMBER, numQuestion NUMBER, numReponse NUMBER)');
|
||||||
|
|
||||||
|
//------QCM sql --------------//
|
||||||
|
/*$this->exec("INSERT INTO Qcm VALUES(1,'sql','vraifaux','intro sql')");
|
||||||
|
|
||||||
|
//Question 1
|
||||||
|
$this->exec("INSERT INTO QcmQuestion VALUES(1,1,'Ceci est la question 1',10)");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,1,'Ceci est la reponse 1 de la question 1(fausse)',1)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,2,'Ceci est la reponse 2 de la question 1(Vraie)',1)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,3,'Ceci est la reponse 3 de la question 1(Vraie)',1)");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmCorrection VALUES(1,1,2)");
|
||||||
|
$this->exec("INSERT INTO QcmCorrection VALUES(1,1,3)");
|
||||||
|
|
||||||
|
//Question 2
|
||||||
|
$this->exec("INSERT INTO QcmQuestion VALUES(2,1,'Ceci est la question 2',9)");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,1,'Ceci est la reponse 1 de la question 2(Vraie)',2)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,2,'Ceci est la reponse 2 de la question 2(fausse)',2)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,3,'Ceci est la reponse 3 de la question 2(fausse)',2)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES(1,4,'Ceci est la reponse 4 de la question 2(fausse)',2)");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmCorrection VALUES(1,2,1)");
|
||||||
|
|
||||||
|
//------QCM EPSWORTH --------------//
|
||||||
|
$this->exec("INSERT INTO Qcm VALUES(2,'EPSWORTH','test','intro epsworth')");
|
||||||
|
|
||||||
|
//Question 1
|
||||||
|
$this->exec("INSERT INTO QcmQuestion(numQuestion,numQcm,question) VALUES(1,2,'Ceci est la question 1')");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,1,'Ceci est la reponse 1 de la question 1(5)',1,5)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,2,'Ceci est la reponse 2 de la question 1(11)',1,11)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,3,'Ceci est la reponse 3 de la question 1(12)',1,12)");
|
||||||
|
|
||||||
|
|
||||||
|
//Question 2
|
||||||
|
$this->exec("INSERT INTO QcmQuestion(numQuestion,numQcm,question) VALUES(2,2,'Ceci est la question 2')");
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,1,'Ceci est la reponse 1 de la question 2(5)',2,5)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,2,'Ceci est la reponse 2 de la question 2(11)',2,11)");
|
||||||
|
$this->exec("INSERT INTO QcmReponse VALUES(2,3,'Ceci est la reponse 3 de la question 2(12)',2,12)");*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function createLogin(){
|
||||||
|
$mdp = password_hash('mdptest', PASSWORD_DEFAULT);
|
||||||
|
$username = 'test';
|
||||||
|
$this->exec('DROP TABLE login');
|
||||||
|
$this->exec('CREATE TABLE login ( username STRING, password STRING)');
|
||||||
|
|
||||||
|
$stmt = $this->prepare("INSERT INTO login VALUES(? , ?)");
|
||||||
|
$stmt->bindParam(1, $username);
|
||||||
|
$stmt->bindParam(2, $mdp);
|
||||||
|
$stmt->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createDateTp(){
|
||||||
|
$this->exec('DROP TABLE dateTp');
|
||||||
|
$this->exec('CREATE TABLE dateTp ( numTp NUMBER, dateDebut STRING, dateFin STRING)');
|
||||||
|
|
||||||
|
$this->exec("INSERT INTO dateTp VALUES(2,'20200101','20200814')");
|
||||||
|
}
|
||||||
|
|
||||||
|
function joueurEtDateRandom(&$nomRandom, &$dateRandom){
|
||||||
|
|
||||||
|
$listeJoueurQuery = oci_parse($this->conn, 'SELECT prenomnoms,datematch FROM STATS INTERSECT SELECT prenomnoms,datematch FROM randomstats ');
|
||||||
|
oci_execute($listeJoueurQuery);
|
||||||
|
$listeJoueurRows = oci_fetch_all($listeJoueurQuery, $listeJoueurArray);
|
||||||
|
//print_r($listeJoueurArray);
|
||||||
|
$rand_keys = array_rand($listeJoueurArray['PRENOMNOMS'], 1);
|
||||||
|
$nomRandom = $listeJoueurArray['PRENOMNOMS'][$rand_keys];
|
||||||
|
$dateRandom = $listeJoueurArray['DATEMATCH'][$rand_keys];
|
||||||
|
}
|
||||||
|
|
||||||
|
function joueurEtDateRandom2(&$nomRandom, &$dateRandom){
|
||||||
|
$listeJoueurQuery = oci_parse($this->conn, 'SELECT prenomnoms,datematch FROM STATS');
|
||||||
|
oci_execute($listeJoueurQuery);
|
||||||
|
$listeJoueurRows = oci_fetch_all($listeJoueurQuery, $listeJoueurArray);
|
||||||
|
//print_r($listeJoueurArray);
|
||||||
|
$rand_keys = array_rand($listeJoueurArray['PRENOMNOMS'], 1);
|
||||||
|
$nomRandom = $listeJoueurArray['PRENOMNOMS'][$rand_keys];
|
||||||
|
$dateRandom = $listeJoueurArray['DATEMATCH'][$rand_keys];
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajouterRequete($contexte,$tp,$numQuestion,$consigne,$requete,$points,$aleatoire){
|
||||||
|
if($this->verificationExistenceQuestion($tp, $numQuestion)) return false;
|
||||||
|
$qt = "INSERT INTO Type VALUES(?,?,'query')";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $tp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
$q = "INSERT INTO Correct VALUES (?,?,?,?,? ,?,?)";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$contexte);
|
||||||
|
$stmt->bindParam(2,$tp);
|
||||||
|
$stmt->bindParam(3,$numQuestion);
|
||||||
|
$stmt->bindParam(4,$consigne);
|
||||||
|
$stmt->bindParam(5,$requete);
|
||||||
|
$stmt->bindParam(6,$points);
|
||||||
|
$stmt->bindParam(7,$aleatoire);
|
||||||
|
|
||||||
|
$stmt->execute();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajouterFonction($contexte,$tp,$numQuestion,$consigne,$requete,$fonction,$requeteUser,$points){
|
||||||
|
if($this->verificationExistenceQuestion($tp, $numQuestion)) return false;
|
||||||
|
$qt = "INSERT INTO Type VALUES(?,?,'functionCorrect')";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $tp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
$q = "INSERT INTO FunctionCorrect VALUES (?,?,?,?,?,?,? ,?)";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$contexte);
|
||||||
|
$stmt->bindParam(2,$tp);
|
||||||
|
$stmt->bindParam(3,$numQuestion);
|
||||||
|
$stmt->bindParam(4,$consigne);
|
||||||
|
$stmt->bindParam(5,$requete);
|
||||||
|
$stmt->bindParam(6,$fonction);
|
||||||
|
$stmt->bindParam(7,$requeteUser);
|
||||||
|
$stmt->bindParam(8,$points);
|
||||||
|
$stmt->execute();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajouterQCM($numQcm,$numQuestion,$consigne,$choix,$reponses,$bareme){
|
||||||
|
if($this->verificationExistenceQCM($numQcm,$numQuestion)) return false;
|
||||||
|
$qt = "INSERT INTO QcmQuestion VALUES(?,?,?,?)";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$prp->bindParam(3, $consigne);
|
||||||
|
$prp->bindParam(4, $bareme);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
$i=1;
|
||||||
|
foreach($choix as $c){
|
||||||
|
$q = "INSERT INTO QcmReponse(numQcm,numReponse,reponse,numQuestion) VALUES (?,?,?,?)";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$numQcm);
|
||||||
|
$stmt->bindParam(2,$i);
|
||||||
|
$stmt->bindParam(3,$c);
|
||||||
|
$stmt->bindParam(4,$numQuestion);
|
||||||
|
$stmt->execute();
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($reponses as $numReponse){
|
||||||
|
$qt = "INSERT INTO QcmCorrection VALUES(?,?,?)";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1,$numQcm);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->bindParam(3, $numReponse);
|
||||||
|
$prp->execute();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajouterQCMTest($numQcm,$numQuestion,$consigne,$choixEtPoints){
|
||||||
|
if($this->verificationExistenceQCM($numQcm,$numQuestion)) return false;
|
||||||
|
$qt = "INSERT INTO QcmQuestion(numQuestion,numQcm,question) VALUES(?,?,?)";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$prp->bindParam(3, $consigne);
|
||||||
|
$prp->execute();
|
||||||
|
$i=1;
|
||||||
|
foreach($choixEtPoints as $c ){
|
||||||
|
|
||||||
|
$res = explode("---",$c);
|
||||||
|
$q = "INSERT INTO QcmReponse VALUES (?,?,?,?,?)";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$numQcm);
|
||||||
|
$stmt->bindParam(2,$i);
|
||||||
|
$stmt->bindParam(3,$res[0]);
|
||||||
|
$stmt->bindParam(4,$numQuestion);
|
||||||
|
$stmt->bindParam(5,$res[1]);
|
||||||
|
$stmt->execute();
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
function verificationExistenceQCM($numQcm,$numQuestion){
|
||||||
|
$q = "SELECT count(*) FROM QcmQuestion WHERE numQuestion = ? AND numQcm=?";
|
||||||
|
$prp=$this->prepare($q);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$result = $prp->execute();
|
||||||
|
$row = $result->fetchArray();
|
||||||
|
if($row['count(*)'] == 0) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function verificationExistenceQuestion($tp,$numQuestion){
|
||||||
|
$q = "SELECT count(*) FROM Type WHERE numTp = ? AND numQuestion = ? ";
|
||||||
|
$prp=$this->prepare($q);
|
||||||
|
$prp->bindParam(1, $tp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$result = $prp->execute();
|
||||||
|
$row = $result->fetchArray();
|
||||||
|
if($row['count(*)'] == 0){
|
||||||
|
$q = "SELECT count(*) FROM Type WHERE numTp = ?";
|
||||||
|
$prp=$this->prepare($q);
|
||||||
|
$prp->bindParam(1, $tp);
|
||||||
|
$result = $prp->execute();
|
||||||
|
$row = $result->fetchArray();
|
||||||
|
if($row['count(*)'] == 0){
|
||||||
|
date_default_timezone_set('Europe/Paris');
|
||||||
|
$dateD = date('Ymd');
|
||||||
|
$dateF = date('Ymd',strtotime('+9 months'));
|
||||||
|
$q = "INSERT INTO DateTp VALUES(?,?,?)";
|
||||||
|
$prp=$this->prepare($q);
|
||||||
|
$prp->bindParam(1, $tp);
|
||||||
|
$prp->bindParam(2, $dateD);
|
||||||
|
$prp->bindParam(3, $dateF);
|
||||||
|
$result = $prp->execute();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajouterDemonstration($contexte,$chapitre,$num,$intitule,$requete){
|
||||||
|
if($this->verificationExistenceDemo($chapitre, $num)) return false;
|
||||||
|
$q = "INSERT INTO Demonstration VALUES (?,?,?,?,?)";
|
||||||
|
$stmt = $this->prepare($q);
|
||||||
|
$stmt->bindParam(1,$contexte);
|
||||||
|
$stmt->bindParam(2,$chapitre);
|
||||||
|
$stmt->bindParam(3,$num);
|
||||||
|
$stmt->bindParam(4,$intitule);
|
||||||
|
$stmt->bindParam(5,$requete);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function verificationExistenceDemo($chapitre,$numDemo){
|
||||||
|
$q = "SELECT count(*) FROM Demonstration WHERE chapitre = ? AND numDemo = ? ";
|
||||||
|
$prp=$this->prepare($q);
|
||||||
|
$prp->bindParam(1, $chapitre);
|
||||||
|
$prp->bindParam(2, $numDemo);
|
||||||
|
$result = $prp->execute();
|
||||||
|
$row = $result->fetchArray();
|
||||||
|
if($row['count(*)'] == 0) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function supprimerRequete($numQuestion,$numTp){
|
||||||
|
$qt = "DELETE FROM Type WHERE numTp=? AND numQuestion=? ";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numTp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
$qt = "DELETE FROM Correct WHERE numTp=? AND numQuestion=? ";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numTp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
function supprimerFonction($numQuestion,$numTp){
|
||||||
|
$qt = "DELETE FROM Type WHERE numTp=? AND numQuestion=? ";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numTp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
$qt = "DELETE FROM FunctionCorrect WHERE numTp=? AND numQuestion=? ";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numTp);
|
||||||
|
$prp->bindParam(2, $numQuestion);
|
||||||
|
$prp->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
function supprimerDemonstration($chapitre, $numDemo){
|
||||||
|
$qt = "DELETE FROM Demonstration WHERE chapitre=? AND numDemo=? ";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $chapitre);
|
||||||
|
$prp->bindParam(2, $numDemo);
|
||||||
|
$prp->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
function supprimerQCM($numQcm,$numQuestion,$type){
|
||||||
|
$qt = "DELETE FROM QcmQuestion WHERE numQuestion=? AND numQcm = ?";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
$qt = "DELETE FROM QcmReponse WHERE numQuestion=? AND numQcm = ?";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$prp->execute();
|
||||||
|
|
||||||
|
if($type == 'test') return;
|
||||||
|
$qt = "DELETE FROM QcmCorrection WHERE numQuestion=? AND numQcm = ?";
|
||||||
|
$prp=$this->prepare($qt);
|
||||||
|
$prp->bindParam(1, $numQuestion);
|
||||||
|
$prp->bindParam(2, $numQcm);
|
||||||
|
$prp->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
|||||||
|
<?php //header('Content-type: text/plain');
|
||||||
|
|
||||||
|
//require_once ('Question.php');
|
||||||
|
class QCMGateway {
|
||||||
|
private $db;
|
||||||
|
|
||||||
|
|
||||||
|
function __construct(SqliteDb $db) {
|
||||||
|
$this->db=$db;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function afficherQCM() {
|
||||||
|
|
||||||
|
$query = 'SELECT * FROM Qcm ORDER BY numQcm';
|
||||||
|
$query = $this->db->prepare($query);
|
||||||
|
$resultqcm = $query->execute();
|
||||||
|
while($qcm = $resultqcm->fetchArray()){
|
||||||
|
$query = 'SELECT * FROM QcmQuestion WHERE numQcm = ? ORDER BY numQuestion ';
|
||||||
|
$query = $this->db->prepare($query);
|
||||||
|
$query->bindParam(1, $qcm['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
$tabQuestions = array();
|
||||||
|
//$resultats = $this->db->query('SELECT found_rows()');
|
||||||
|
while($q = $result->fetchArray()){
|
||||||
|
$reponseQuery = 'SELECT * FROM QcmReponse WHERE numQuestion=? AND numQcm = ? ORDER BY numReponse';
|
||||||
|
$stmt = $this->db->prepare($reponseQuery);
|
||||||
|
$stmt->bindParam(1, $q['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $qcm['numQcm']);
|
||||||
|
$reponseResult = $stmt->execute();
|
||||||
|
$tabReponses =array();
|
||||||
|
while ($r = $reponseResult->fetchArray()){
|
||||||
|
$tabReponses[] = new ReponseQCM($r['numReponse'], $r['reponse'], $r['numQuestion']) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabQuestions[] = new QuestionQCM($q['numQuestion'],$q['question'],$tabReponses,$q['bareme']);
|
||||||
|
}
|
||||||
|
$tabQcm[] = new QCM($qcm['numQcm'], $qcm['nom'], $qcm['type'], $tabQuestions, $qcm['introduction']) ;
|
||||||
|
|
||||||
|
}
|
||||||
|
//die(print_r($tabQcm, true ));
|
||||||
|
//+die(print_r($tabQuestions, true ));
|
||||||
|
return $tabQcm;
|
||||||
|
//die('ook');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
//require_once ('Question.php');
|
||||||
|
|
||||||
|
|
||||||
|
class QuestionsGateway {
|
||||||
|
private $db;
|
||||||
|
|
||||||
|
|
||||||
|
function __construct(SqliteDb $db) {
|
||||||
|
$this->db=$db;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function afficherQuestions() {
|
||||||
|
$tabQuestions=array();
|
||||||
|
$query = 'SELECT numTp FROM Correct UNION SELECT numTp FROM FunctionCorrect';
|
||||||
|
$query = $this->db->prepare($query);
|
||||||
|
$result = $query->execute();
|
||||||
|
//$nbTpRow = $result->fetchArray(SQLITE3_NUM);
|
||||||
|
$i = 0;
|
||||||
|
while ($tp = $result->fetchArray(SQLITE3_NUM)){
|
||||||
|
$questionQuery = 'SELECT numTp,numquestion,question,reponse,points FROM Correct WHERE numTp = ? UNION SELECT numTp,numquestion,question,reponse,points 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 QuestionNote($q['numTp'],$q['numquestion'],$q['question'],$q['reponse'],$q['points']);
|
||||||
|
}
|
||||||
|
$tabTp['tp'.$tp[0]] = $tabQuestions ;
|
||||||
|
unset($tabQuestions);
|
||||||
|
$tabQuestions = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
//die("<pre>".print_r($tabTp)."</pre");
|
||||||
|
return $tabTp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function afficherDemonstrations() {
|
||||||
|
$tabQuestions=array();
|
||||||
|
$query = 'SELECT chapitre FROM Demonstration';
|
||||||
|
$query = $this->db->prepare($query);
|
||||||
|
$result = $query->execute();
|
||||||
|
//$nbTpRow = $result->fetchArray(SQLITE3_NUM);
|
||||||
|
$i = 0;
|
||||||
|
while ($chapitre = $result->fetchArray(SQLITE3_NUM)){
|
||||||
|
$questionQuery = 'SELECT chapitre,numDemo,description,reponse FROM Demonstration WHERE chapitre = ? ORDER BY numDemo';
|
||||||
|
$questionQuery = $this->db->prepare($questionQuery);
|
||||||
|
$questionQuery->bindParam(1, $chapitre[0]);
|
||||||
|
$questionResult = $questionQuery->execute();
|
||||||
|
while($q = $questionResult->fetchArray()){
|
||||||
|
$tabQuestions[] = new Question($q['chapitre'],$q['numDemo'],$q['description'],$q['reponse']);
|
||||||
|
}
|
||||||
|
$tabChapitre['chapitre'.$chapitre[0]] = $tabQuestions ;
|
||||||
|
unset($tabQuestions);
|
||||||
|
$tabQuestions = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
//die("<pre>".print_r($tabTp)."</pre");
|
||||||
|
return $tabChapitre;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class UserGateway {
|
||||||
|
private $db;
|
||||||
|
|
||||||
|
public function __construct(SqliteDb $sd) {
|
||||||
|
$this->db = $sd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPassword($identifiant){
|
||||||
|
$q = "SELECT password FROM login WHERE username= ";
|
||||||
|
$stmt = $this->db->prepare("SELECT * FROM login WHERE username= ?");
|
||||||
|
$stmt->bindParam(1, $identifiant);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
$passArray = $result->fetcharray();
|
||||||
|
return $passArray['password'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
palafour,,,,1,1,1,1,1,1,1,1,1,1,10
|
@ -0,0 +1 @@
|
|||||||
|
palafour,,,,10
|
@ -0,0 +1,2 @@
|
|||||||
|
meelaichao,Mohamed El Mehdi,ELAICHAOUI,21709883,1,1
|
||||||
|
palafour,,,,1,1
|
@ -0,0 +1,2 @@
|
|||||||
|
meelaichao,Mohamed El Mehdi,ELAICHAOUI,21709883,1,1,1,0,0,,,,3
|
||||||
|
palafour,,,,1,1,1,1,0,,1,1,6
|
@ -0,0 +1,2 @@
|
|||||||
|
meelaichao,Mohamed El Mehdi,ELAICHAOUI,21709883,1
|
||||||
|
palafour,,,,1
|
@ -0,0 +1,2 @@
|
|||||||
|
meelaichao,Mohamed El Mehdi,ELAICHAOUI,21709883,3
|
||||||
|
palafour,,,,6
|
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
header('Content-type: text/plain');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
$n = new OracleDb();
|
||||||
|
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
|
||||||
|
//$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
|
||||||
|
$conn = $n->getConn();
|
||||||
|
$textbox = $_GET['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>';
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../controleur/Controleur.php');
|
||||||
|
|
||||||
|
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($_GET['chapitre']) || empty($_GET['bdd']) || empty($_GET['description']) || empty($_GET['reponse']) ) {
|
||||||
|
echo '<strong>ERREUR : Veuillez remplir tous les champs </strong>';
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(!is_numeric($_GET['chapitre']))
|
||||||
|
echo '<strong>ERREUR : une valeur non numérique à été détectée dans le champ \'Chapitre n° :\' </strong>';
|
||||||
|
|
||||||
|
else {
|
||||||
|
$reponseQuery = $db->prepare('SELECT count(*) FROM demonstration WHERE chapitre=?');
|
||||||
|
$reponseQuery->bindParam(1, $_GET['chapitre']);
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
$reponseRow = $reponseResult->fetchArray();
|
||||||
|
$numDemo = $reponseRow['count(*)'] + 1;
|
||||||
|
|
||||||
|
if(isset($_GET['modif'])){
|
||||||
|
$numDemo = $_GET['numDemo'];
|
||||||
|
$db->supprimerDemonstration($_GET['chapitre'], $_GET['numDemo']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$isAdd = $db->ajouterDemonstration($_GET['bdd'],$_GET['chapitre'], $numDemo,$_GET['description'], $_GET['reponse']);
|
||||||
|
if(!$isAdd){
|
||||||
|
echo '<strong>ERREUR : la combinaison (numéro de chapitre, numéro de démonstration) existe déjà dans la bdd</strong>';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$trouve=0;
|
||||||
|
$file = fopen('..\imports\demonstration\demo_historiqueAuto.txt', "a");
|
||||||
|
$ligne = $_GET['bdd'].'**'.$_GET['chapitre'].'**'.$_GET['description'].'**'.$_GET['reponse'];
|
||||||
|
$handle = @fopen('..\imports\demonstration\demo_historiqueAuto.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0) fwrite($file, $ligne."\n");
|
||||||
|
$trouve = 0;
|
||||||
|
fclose($file);
|
||||||
|
|
||||||
|
echo '<strong>AJOUT Démonstration n°'.$numDemo.' au chapitre '.$_GET['chapitre'].' avec succès</strong>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//require_once('index.php');
|
||||||
|
//header("Location: ../index.php");
|
||||||
|
|
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../controleur/Controleur.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
session_start();
|
||||||
|
$query = $db->prepare('SELECT count(*) FROM Qcm WHERE numQcm= ?');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
$countRow = $result->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
if($_GET['nomQcm'] == 'existe' && $countRow['count(*)'] == 0){
|
||||||
|
exit("Le numéro de qcm n'existe pas : veuillez remplir le champ 'Nom du Qcm' ou utiliser un numéro de qcm existant");
|
||||||
|
}
|
||||||
|
else if($_GET['nomQcm'] !== 'existe' && $countRow['count(*)'] !== 0){
|
||||||
|
$query = $db->prepare('UPDATE Qcm SET nom=? WHERE numQcm= ?');
|
||||||
|
$query->bindParam(1, $_GET['nomQcm']);
|
||||||
|
$query->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
else if($countRow['count(*)'] == 0){
|
||||||
|
$query = $db->prepare('INSERT INTO Qcm VALUES(?,?,?,?)');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$query->bindParam(2, $_GET['nomQcm']);
|
||||||
|
$query->bindParam(3, $_GET['type']);
|
||||||
|
$query->bindParam(4, $_GET['intro']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_GET['intro'] !== 'nomodif' && $countRow['count(*)'] !== 0){
|
||||||
|
$query = $db->prepare('UPDATE Qcm SET introduction=? WHERE numQcm= ?');
|
||||||
|
$query->bindParam(1, $_GET['intro']);
|
||||||
|
$query->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$reponseQuery = $db->prepare('SELECT count(*) FROM QcmQuestion WHERE numQcm= ?');
|
||||||
|
$reponseQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
$reponseRow = $reponseResult->fetchArray();
|
||||||
|
|
||||||
|
$numQuestion = $reponseRow['count(*)'] + 1;
|
||||||
|
|
||||||
|
$reponses = array();
|
||||||
|
if(isset($_GET['modif'])){
|
||||||
|
$numQuestion =$_GET['numQuestion'];
|
||||||
|
$db->supprimerQCM ($_GET['numQcm'],$numQuestion,$_GET['type']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_GET['type']=='test'){
|
||||||
|
|
||||||
|
$isAdd = $db->ajouterQCMTest($_GET['numQcm'],$numQuestion,$_GET['consigne'],$_GET['choix']);
|
||||||
|
if(!$isAdd){
|
||||||
|
echo '<strong>ERREUR : le numéro de question '.$numQuestion.' existe déjà dans le qcm '.$_GET['numQcm'].'</strong>';
|
||||||
|
}
|
||||||
|
else echo '<strong>AJOUT QCM avec succès</strong>';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$isAdd = $db->ajouterQCM($_GET['numQcm'],$numQuestion,$_GET['consigne'],$_GET['choix'],$_GET['reponse'],$_GET['baremequestion']);
|
||||||
|
if(!$isAdd){
|
||||||
|
echo '<strong>ERREUR : le numéro de question existe déjà dans la bdd</strong>';
|
||||||
|
}
|
||||||
|
else echo '<strong>AJOUT QCM avec succès</strong>';
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,118 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../controleur/Controleur.php');
|
||||||
|
|
||||||
|
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
if (empty($_GET['tp']) || empty($_GET['consigne']) || empty($_GET['reponse']) || empty($_GET['points']) ) {
|
||||||
|
echo '<strong>ERREUR1 : Veuillez remplir tous les champs </strong>';
|
||||||
|
}
|
||||||
|
else if(!is_numeric($_GET['tp']))
|
||||||
|
echo '<strong>ERREUR : une valeur non numérique à été détectée dans le champ \'TP n° :\' </strong>';
|
||||||
|
else if(!is_numeric($_GET['points']))
|
||||||
|
echo '<strong>ERREUR : une valeur non numérique à été détectée dans le champ \'Barème:\' </strong>';
|
||||||
|
else {
|
||||||
|
|
||||||
|
$reponseQuery = $db->prepare('SELECT count(*) FROM type WHERE numTp=?');
|
||||||
|
$reponseQuery->bindParam(1, $_GET['tp']);
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
$reponseRow = $reponseResult->fetchArray();
|
||||||
|
$numQuestion = $reponseRow['count(*)'] + 1;
|
||||||
|
|
||||||
|
if(isset($_GET['modif'])){
|
||||||
|
$numQuestion = $_GET['num'];
|
||||||
|
if ($_GET["type"] == 'fonction')
|
||||||
|
$db->supprimerFonction ($numQuestion, $_GET['tp']);
|
||||||
|
else if ($_GET["type"] == 'requete')
|
||||||
|
$db->supprimerRequete($numQuestion, $_GET['tp']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["type"] == 'requete'){
|
||||||
|
|
||||||
|
$isAdd = $db->ajouterRequete($_GET['bdd'],$_GET['tp'],$numQuestion,$_GET['consigne'], $_GET['reponse'],$_GET['points'],$_GET['aleatoire']);
|
||||||
|
if(!$isAdd){
|
||||||
|
echo '<strong>ERREUR : la combinaison (numéro de tp, numéro de question) existe déjà dans la bdd</strong>';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$trouve=0;
|
||||||
|
$file = fopen('..\imports\tp\tp_historiqueAuto.txt', "a");
|
||||||
|
$ligne = 'requete**'.$_GET['bdd'].'**'.$_GET['tp'].'**'.$_GET['consigne'].'**'.$_GET['reponse'].'**'.$_GET['points'].'**'.'n';
|
||||||
|
$handle = @fopen('..\imports\tp\tp_historiqueAuto.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0) fwrite($file, $ligne."\n");
|
||||||
|
$trouve = 0;
|
||||||
|
fclose($file);
|
||||||
|
if(!isset($_GET['modif']))
|
||||||
|
echo '<strong>AJOUT avec succès</strong>';
|
||||||
|
else echo '<strong>Modification avec succès</strong>';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ($_GET["type"] == 'fonction'){
|
||||||
|
if(empty($_GET['fonction']))
|
||||||
|
echo 'ERREUR : Veuillez remplir tous les champs ';
|
||||||
|
else {
|
||||||
|
if(!isset($_GET['modif'])){
|
||||||
|
$reponse = $_GET['reponse'];
|
||||||
|
$re = '/^\s*SELECT\s*([a-z0-9]*)/i';
|
||||||
|
preg_match($re, $reponse, $matches, PREG_OFFSET_CAPTURE);
|
||||||
|
$string = 'f'.$matches[1][0];
|
||||||
|
$freponse = str_replace($matches[1][0],$string, $reponse);
|
||||||
|
|
||||||
|
$fonction = $_GET['fonction'];
|
||||||
|
$re = '/^\s*CREATE OR REPLACE FUNCTION\s*([a-z0-9]*)/i';
|
||||||
|
preg_match($re, $fonction, $matches2, PREG_OFFSET_CAPTURE);
|
||||||
|
|
||||||
|
$string2 = 'f'.$matches2[1][0];
|
||||||
|
$ffonction = str_replace($matches2[1][0],$string2, $fonction);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$freponse = $_GET['reponse'];
|
||||||
|
$ffonction = $_GET['fonction'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$isAdd = $db->ajouterFonction($_GET['bdd'],$_GET['tp'],$numQuestion,$_GET['consigne'], $freponse,$ffonction,$reponse,$_GET['points']);
|
||||||
|
if(!$isAdd){
|
||||||
|
echo '<strong>ERREUR : la combinaison (numéro de tp, numéro de question) existe déjà dans la bdd</strong>';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$trouve=0;
|
||||||
|
$file = fopen('..\imports\tp\tp_historiqueAuto.txt', "a");
|
||||||
|
$ligne = 'fonction**'.$_GET['bdd'].'**'.$_GET['tp'].'**'.$_GET['consigne'].'**'.$freponse.'**'.$_GET['points'].'**'.'n**'.$ffonction;
|
||||||
|
$handle = @fopen('..\imports\tp\tp_historiqueAuto.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0) fwrite($file, $ligne."\n");
|
||||||
|
$trouve = 0;
|
||||||
|
fclose($file);
|
||||||
|
if(!isset($_GET['modif']))
|
||||||
|
echo '<strong>AJOUT succès</strong>';
|
||||||
|
else echo '<strong>Modification avec succès</strong>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//require_once('index.php');
|
||||||
|
//header("Location: ../index.php");
|
||||||
|
|
@ -0,0 +1,398 @@
|
|||||||
|
<?php
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
header('Content-type: text/plain');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
$n = new OracleDb();
|
||||||
|
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
|
||||||
|
//$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
|
||||||
|
$conn = $n->getConn();
|
||||||
|
|
||||||
|
$_SESSION['fi'] = array();
|
||||||
|
$cmpt = 0;
|
||||||
|
$numQuestion = 0;
|
||||||
|
header("Cache-Control: no cache");
|
||||||
|
|
||||||
|
//$user = "mehdi";
|
||||||
|
$user = $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
|
$textbox = $_GET['textbox'];
|
||||||
|
/*$numQuestion++;
|
||||||
|
$ic = "$numQuestion";*/
|
||||||
|
|
||||||
|
$numQuestion = $_GET['numQuestion'];
|
||||||
|
$numTp = $_GET['numTp'];
|
||||||
|
$_SESSION['fi'][$numQuestion] = $textbox;
|
||||||
|
$UserQuery = oci_parse($conn, $textbox);
|
||||||
|
$reponseUser = oci_execute($UserQuery);
|
||||||
|
|
||||||
|
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
|
||||||
|
$typeQuery->bindParam(1, $numQuestion);
|
||||||
|
$typeQuery->bindParam(2, $numTp);
|
||||||
|
$resultType = $typeQuery->execute();
|
||||||
|
$typeRow = $resultType->fetchArray();
|
||||||
|
$err = 0;
|
||||||
|
$verif =0;
|
||||||
|
|
||||||
|
//si la question attend un SELECT
|
||||||
|
|
||||||
|
if($typeRow['type'] == 'query'){
|
||||||
|
// <editor-fold desc="vérification avec la vraie BDD">
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('SELECT * FROM Correct WHERE numquestion= ? AND numTp= ? ');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numTp);
|
||||||
|
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
$sqliteRow = $result->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
$vraiReponse = oci_parse($conn, $sqliteRow['reponse']);
|
||||||
|
$enAttente = oci_execute($vraiReponse);
|
||||||
|
|
||||||
|
if(oci_num_rows($UserQuery) != oci_num_rows($vraiReponse)){
|
||||||
|
$err=-3;
|
||||||
|
}
|
||||||
|
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) ; $i++){
|
||||||
|
if($oracleRow[$i] != $vraiReponseRow[$i]){
|
||||||
|
$err = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$err = -2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//echo nl2br("\n ------------test : ".$err." test2 : ".$verif."\n");
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
$aleatoireQuery = $db->prepare('SELECT aleatoire FROM Correct WHERE numQuestion = ? AND numTp= ?');
|
||||||
|
$aleatoireQuery->bindParam(1, $numQuestion);
|
||||||
|
$aleatoireQuery->bindParam(2, $numTp);
|
||||||
|
$resultAleatoire = $aleatoireQuery->execute();
|
||||||
|
$aleatoireRow = $resultAleatoire->fetchArray();
|
||||||
|
if($aleatoireRow['aleatoire'] == 'o'){
|
||||||
|
// <editor-fold desc="vérification avec bdd aléatoire">
|
||||||
|
$nv= $sqliteRow['reponse'];
|
||||||
|
$txt = $textbox;
|
||||||
|
|
||||||
|
if(strpos($sqliteRow['reponse'],"GAME")){
|
||||||
|
$nv = str_replace('GAME', ' randomgame ', $nv);
|
||||||
|
$txt = str_replace('GAME', 'randomgame', $txt);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (strpos($sqliteRow['reponse'],"EQUIPE")){
|
||||||
|
$nv= str_replace('EQUIP', ' randomequipe ', $nv);
|
||||||
|
$txt = str_replace('EQUIPE', 'randomequipe', $txt);
|
||||||
|
}
|
||||||
|
if (strpos($sqliteRow['reponse'],"STATS")){
|
||||||
|
$nv= str_replace('STATS' , ' randomstats ', $nv);
|
||||||
|
$txt = str_replace('STATS', ' randomstats ', $txt);
|
||||||
|
}
|
||||||
|
if (strpos($sqliteRow['reponse'],"JOUEUR")) {
|
||||||
|
$nv = str_replace('JOUEUR', 'randomjoueur', $nv);
|
||||||
|
$txt = str_replace('JOUEUR', 'randomjoueur', $txt);
|
||||||
|
}
|
||||||
|
|
||||||
|
$UserQueryRandom = oci_parse($conn, $txt);
|
||||||
|
$reponseUser = oci_execute($UserQueryRandom);
|
||||||
|
|
||||||
|
$vraiReponseRandom = oci_parse($conn, $nv);
|
||||||
|
$enAttente = oci_execute($vraiReponseRandom);
|
||||||
|
if(oci_num_rows($UserQueryRandom) != oci_num_rows($vraiReponseRandom)){
|
||||||
|
$err=-3;
|
||||||
|
}
|
||||||
|
$verif = 0;
|
||||||
|
while( ($oracleRowRandom = oci_fetch_array($UserQueryRandom, OCI_NUM)) && $err == 0 ){
|
||||||
|
$vraiReponseRowRandom = oci_fetch_array($vraiReponseRandom,OCI_NUM );
|
||||||
|
$verif = 1;
|
||||||
|
|
||||||
|
if(sizeof($oracleRowRandom) == sizeof($vraiReponseRowRandom)){
|
||||||
|
for($i=0 ; $i< sizeof($vraiReponseRowRandom) ; $i++){
|
||||||
|
if($oracleRowRandom[$i] != $vraiReponseRowRandom[$i]){
|
||||||
|
$err = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$err = -2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// </editor-fold>
|
||||||
|
//echo nl2br("\n ------------testerr : ".$err." test2verif : ".$verif."\n");
|
||||||
|
}
|
||||||
|
// <editor-fold desc="Résultat">
|
||||||
|
if($err == 0 && $verif==1){
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestionTp VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$sqliteRow['points']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
echo "<strong>La réponse à la question " .$numQuestion. " est JUSTE ! \n</strong>";
|
||||||
|
$cmpt++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$zero = 0;
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestionTp VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$zero);
|
||||||
|
$result = $query->execute();
|
||||||
|
echo "<strong>La réponse à la question " .$numQuestion. " est FAUSSE ! \n</strong>";
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
}
|
||||||
|
//si la question attend une modification
|
||||||
|
else if($typeRow['type'] == 'tablemodification'){
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('SELECT reponse FROM Correct WHERE numquestion= ? AND numTp= ? ');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numTp);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
$sqliteRow = $result->fetchArray();
|
||||||
|
$vraiReponse = oci_parse($conn, $sqliteRow['reponse']);
|
||||||
|
$enAttente = oci_execute($vraiReponse);
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('SELECT fonctioncorrect FROM Correct WHERE numquestion= ? AND numTp= ?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numTp);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
$sqliteRow = $result->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
$t = oci_fetch_all($vraiReponse, $vraiReponseRow);
|
||||||
|
print_r($vraiReponseRow);
|
||||||
|
|
||||||
|
$err = 1;
|
||||||
|
foreach ($vraiReponseRow as $v){
|
||||||
|
for($i = 0 ; $i < sizeof($v, OCI_NUM) ; $i++){
|
||||||
|
if($v[$i] == $sqliteRow[0]){
|
||||||
|
$err = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($err == 0 ){
|
||||||
|
echo "La réponse à la question " .$numQuestion. " est JUSTE ! \n";
|
||||||
|
$cmpt++;
|
||||||
|
}
|
||||||
|
else echo "La réponse à la question " .$numQuestion. " est FAUSSE ! \n";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//si la question attend un CREATE FUNCTION
|
||||||
|
else{
|
||||||
|
$fonctionQuery = $db->prepare('SELECT * FROM FunctionCorrect WHERE numquestion= ? AND numTp= ? ');
|
||||||
|
$fonctionQuery->bindParam(1, $numQuestion);
|
||||||
|
$fonctionQuery->bindParam(2, $numTp);
|
||||||
|
$result = $fonctionQuery->execute();
|
||||||
|
$fonctionRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$creationFonction = oci_parse($conn, $fonctionRow['fonctionCorrect']);
|
||||||
|
$creatF = oci_execute($creationFonction);
|
||||||
|
|
||||||
|
$testUser = oci_parse($conn, $fonctionRow['testUser']);
|
||||||
|
$testu = oci_execute($testUser);
|
||||||
|
$testF = oci_parse($conn, $fonctionRow['reponse']);
|
||||||
|
$testf = oci_execute($testF);
|
||||||
|
|
||||||
|
if(oci_num_rows($testUser) != oci_num_rows($testF)){
|
||||||
|
$err=-3;
|
||||||
|
}
|
||||||
|
while( ($reponseRow = oci_fetch_array($testUser,OCI_NUM)) && $err == 0){
|
||||||
|
|
||||||
|
$vraiReponseRow = oci_fetch_array($testF,OCI_NUM );
|
||||||
|
|
||||||
|
$verif=1;
|
||||||
|
if(sizeof($reponseRow) == sizeof($vraiReponseRow)){
|
||||||
|
for($i=0 ; $i< sizeof($vraiReponseRow) ; $i++){
|
||||||
|
//echo nl2br('reponse : '.$reponseRow[$i].'question : '.$vraiReponseRow[$i]);
|
||||||
|
if($reponseRow[$i] != $vraiReponseRow[$i]){
|
||||||
|
$err = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$err = -2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// <editor-fold desc="vérification avec bdd aléatoire">
|
||||||
|
|
||||||
|
$nv = $fonctionRow['fonctionCorrect'];
|
||||||
|
$txt = $textbox;
|
||||||
|
|
||||||
|
if(strpos($fonctionRow['fonctionCorrect'],"GAME")){
|
||||||
|
$nv = str_replace('GAME', ' randomgame ', $nv);
|
||||||
|
$txt = str_replace('GAME', 'randomgame', $txt);
|
||||||
|
}
|
||||||
|
if (strpos($fonctionRow['fonctionCorrect'],"EQUIPE")){
|
||||||
|
$nv= str_replace('EQUIPE', ' randomequipe ', $nv);
|
||||||
|
$txt = str_replace('EQUIPE', 'randomequipe', $txt);
|
||||||
|
}
|
||||||
|
if (strpos($fonctionRow['fonctionCorrect'],"STATS")){
|
||||||
|
$nv= str_replace('STATS' , ' randomstats ', $nv);
|
||||||
|
$txt = str_replace('STATS', ' randomstats ', $txt);
|
||||||
|
}
|
||||||
|
if (strpos($fonctionRow['fonctionCorrect'],"JOUEUR")) {
|
||||||
|
$nv = str_replace('JOUEUR', 'randomjoueur', $nv);
|
||||||
|
$txt = str_replace('JOUEUR', 'randomjoueur', $txt);
|
||||||
|
}
|
||||||
|
|
||||||
|
$UserFonctionRandom = oci_parse($conn, $txt);
|
||||||
|
$reponseUserRandom = oci_execute($UserFonctionRandom);
|
||||||
|
//echo 'bbbb'.$txt;
|
||||||
|
$creationFonctionRandom = oci_parse($conn, $nv);
|
||||||
|
$creatFRandom = oci_execute($creationFonctionRandom);
|
||||||
|
//echo '154789'.$nv;
|
||||||
|
|
||||||
|
$testUserRandom = oci_parse($conn, $fonctionRow['testUser']);
|
||||||
|
$testuR = oci_execute($testUserRandom);
|
||||||
|
//echo 'aaa'.$fonctionRow['testUser'];
|
||||||
|
$testFR = oci_parse($conn, $fonctionRow['reponse']);
|
||||||
|
$testfR = oci_execute($testFR);
|
||||||
|
|
||||||
|
|
||||||
|
if(oci_num_rows($testUserRandom) != oci_num_rows($testFR)){
|
||||||
|
$err=-3;
|
||||||
|
}
|
||||||
|
$verif=0;
|
||||||
|
while( ($reponseRowRandom = oci_fetch_array($testUserRandom,OCI_NUM)) && $err == 0){
|
||||||
|
$vraiReponseRowRandom = oci_fetch_array($testFR,OCI_NUM );
|
||||||
|
$verif=1;
|
||||||
|
if(sizeof($reponseRowRandom) == sizeof($vraiReponseRowRandom)){
|
||||||
|
for($i=0 ; $i< sizeof($vraiReponseRowRandom)-1 ; $i++){
|
||||||
|
if($reponseRowRandom[$i] != $vraiReponseRowRandom[$i]){
|
||||||
|
$err = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$err = -2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//echo '.....'.$verif;
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
if($err == 0 && $verif==1 ){
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestionTp VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$fonctionRow['points']);
|
||||||
|
$result = $query->execute();
|
||||||
|
echo "<strong>La réponse à la question " .$numQuestion. " est JUSTE ! \n</strong>";
|
||||||
|
$cmpt++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$zero = 0;
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestionTp VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$zero);
|
||||||
|
$result = $query->execute();
|
||||||
|
echo "<strong>La réponse à la question " .$numQuestion. " est FAUSSE ! \n</strong>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('SELECT note FROM NotesParQuestionTp WHERE numTp= ? AND idEtudiant = ?');
|
||||||
|
$query->bindParam(1, $numTp);
|
||||||
|
$query->bindParam(2, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$note = 0;
|
||||||
|
while($r = $result->fetchArray()){
|
||||||
|
$note += $r['note'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesTp VALUES (?,?,?)');
|
||||||
|
$query->bindParam(1,$user );
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$note );
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
|
||||||
|
$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());
|
||||||
|
|
||||||
|
$fic = fopen("result.txt", "w");
|
||||||
|
fwrite($fic, $txt);
|
||||||
|
fclose($fic);*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
<?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();
|
||||||
|
|
||||||
|
//$user = "mehdi";
|
||||||
|
$user = $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
|
if(!isset($_GET['type'])){
|
||||||
|
$query = $db->prepare('SELECT numReponse FROM QcmCorrection WHERE numQuestion=? AND numQcm= ?');
|
||||||
|
$query->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$query->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
while($r = $result->fetchArray() ){
|
||||||
|
$numReponseRow[] = $r['numReponse'];
|
||||||
|
}
|
||||||
|
|
||||||
|
sort($numReponseRow);
|
||||||
|
sort( $_GET['rep']);
|
||||||
|
|
||||||
|
|
||||||
|
if ($numReponseRow == $_GET['rep']){
|
||||||
|
echo "<b>Bonne réponse ! </b>\n";
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestion VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$_GET['numQcm']);
|
||||||
|
$query->bindParam(3,$_GET['numQuestion']);
|
||||||
|
$query->bindParam(4,$_GET['bareme']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
echo "<b>Mauvaise réponse.</b>\n";
|
||||||
|
$zero = 0;
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestion VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$_GET['numQcm']);
|
||||||
|
$query->bindParam(3,$_GET['numQuestion']);
|
||||||
|
$query->bindParam(4,$zero);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('SELECT note FROM NotesParQuestion WHERE numQcm= ? AND idEtudiant = ?');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$query->bindParam(2, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$note = 0;
|
||||||
|
while($r = $result->fetchArray()){
|
||||||
|
$note += $r['note'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO Notes VALUES (?,?,?)');
|
||||||
|
$query->bindParam(1,$user );
|
||||||
|
$query->bindParam(2,$_GET['numQcm']);
|
||||||
|
$query->bindParam(3,$note );
|
||||||
|
$result = $query->execute();
|
||||||
|
//$db->ecrireFichierNotes($_GET['numQcm']);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else{
|
||||||
|
$query = $db->prepare('SELECT count(*) FROM QcmQuestion WHERE numQcm= ? ');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
$nbQuestionRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$total = 0;
|
||||||
|
for($i = 1 ; $i<=$nbQuestionRow['count(*)'] ; $i++ ){
|
||||||
|
$query = $db->prepare('SELECT max(points) FROM QcmReponse WHERE numQcm= ? AND numQuestion=?');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$query->bindParam(2, $i);
|
||||||
|
$result = $query->execute();
|
||||||
|
$totalRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$total += $totalRow['max(points)'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('SELECT * FROM QcmReponse WHERE numQcm= ? ');
|
||||||
|
$query->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $query->execute();
|
||||||
|
$totalRow = $result->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
$points = 0;
|
||||||
|
for ($i = 1 ; $i < sizeof($_GET['rep']) ; $i++){
|
||||||
|
$query = $db->prepare('SELECT * FROM QcmReponse WHERE numQuestion=? AND numQcm= ? AND numReponse= ?');
|
||||||
|
$query->bindParam(1, $i);
|
||||||
|
$query->bindParam(2, $_GET['numQcm']);
|
||||||
|
$query->bindParam(3, $_GET['rep'][$i][0]);
|
||||||
|
$result = $query->execute();
|
||||||
|
$pointRow = $result->fetchArray();
|
||||||
|
$points +=$pointRow['points'];
|
||||||
|
}
|
||||||
|
echo '<b>Résultat : '.$points.' sur '.$total.'</b>';
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../controleur/Controleur.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$debut =str_replace('-', '', $_GET['debut']) ;
|
||||||
|
$fin =str_replace('-', '', $_GET['fin']) ;
|
||||||
|
|
||||||
|
$q = "UPDATE dateTp SET dateDebut=? WHERE numtp=?";
|
||||||
|
$prp=$db->prepare($q);
|
||||||
|
$prp->bindParam(1, $debut );
|
||||||
|
$prp->bindParam(2, $_GET['tp']);
|
||||||
|
$result = $prp->execute();
|
||||||
|
|
||||||
|
$q = "UPDATE dateTp SET dateFin=? WHERE numtp=?";
|
||||||
|
$prp=$db->prepare($q);
|
||||||
|
$prp->bindParam(1, $fin);
|
||||||
|
$prp->bindParam(2,$_GET['tp'] );
|
||||||
|
$result = $prp->execute();
|
||||||
|
|
||||||
|
echo '<strong> Les dates ont été modifiées </strong>';
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
header('Content-type: text/plain');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
$n = new OracleDb();
|
||||||
|
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
|
||||||
|
//$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
|
||||||
|
$conn = $n->getConn();
|
||||||
|
|
||||||
|
$textbox = $_GET['textbox'];
|
||||||
|
$UserQuery = oci_parse($conn, $textbox);
|
||||||
|
$reponseUser = oci_execute($UserQuery);
|
||||||
|
echo 'Table créee';
|
@ -0,0 +1,166 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
if ($_GET['type']=='demo'){
|
||||||
|
$file = fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'demonstration'.DIRECTORY_SEPARATOR.'demo_exportes.txt', "w");
|
||||||
|
$matches = array();
|
||||||
|
$trouve = 0;
|
||||||
|
$reponseQuery = $db->prepare('SELECT * FROM demonstration');
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
while ($r = $reponseResult->fetchArray()){
|
||||||
|
$ligne = $r['bddconcernee'].'**'.$r['chapitre'].'**'.$r['description'].'**'.$r['reponse'];
|
||||||
|
$handle = @fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'demonstration'.DIRECTORY_SEPARATOR.'demo_exportes.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0) fwrite($file, $ligne."\n");
|
||||||
|
$trouve = 0;
|
||||||
|
//fwrite($file, $ligne."\n");
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
|
// file_put_contents('..\imports\demonstration\demo_exportes.txt', rtrim(file_get_contents('..\imports\demonstration\demo_exportes.txt')));
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ($_GET['type']=='tp'){
|
||||||
|
$file = fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'tp'.DIRECTORY_SEPARATOR.'tp_exportes.txt', "w");
|
||||||
|
$matches = array();
|
||||||
|
$trouve = 0;
|
||||||
|
$reponseQuery = $db->prepare('SELECT bddConcernee,numTp,numquestion,question,reponse,points FROM Correct UNION SELECT bddConcernee,numTp,numquestion,question,reponse,points FROM FunctionCorrect');
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
while ($r = $reponseResult->fetchArray()){
|
||||||
|
$questionQuery = 'SELECT type FROM type WHERE numQuestion = ? AND numTp=? ';
|
||||||
|
$questionQuery = $db->prepare($questionQuery);
|
||||||
|
$questionQuery->bindParam(1, $r['numquestion']);
|
||||||
|
$questionQuery->bindParam(2, $r['numTp']);
|
||||||
|
$questionResult = $questionQuery->execute();
|
||||||
|
$typeRow = $questionResult->fetchArray();
|
||||||
|
$reponse = $r['reponse'];
|
||||||
|
if($typeRow['type'] == 'functionCorrect'){
|
||||||
|
$questionQuery = 'SELECT fonctionCorrect FROM functionCorrect WHERE numQuestion = ? AND numTp=? ';
|
||||||
|
$questionQuery = $db->prepare($questionQuery);
|
||||||
|
$questionQuery->bindParam(1, $r['numquestion']);
|
||||||
|
$questionQuery->bindParam(2, $r['numTp']);
|
||||||
|
$questionResult = $questionQuery->execute();
|
||||||
|
$fonctionRow = $questionResult->fetchArray();
|
||||||
|
$type='fonction';
|
||||||
|
|
||||||
|
|
||||||
|
$re = '/^\s*SELECT\s*([a-z0-9])/i';
|
||||||
|
preg_match($re, $reponse, $matches, PREG_OFFSET_CAPTURE);
|
||||||
|
$string = 'f'.$matches[1][0];
|
||||||
|
$freponse = str_replace($matches[1][0],'', $reponse);
|
||||||
|
|
||||||
|
$fonction = $fonctionRow['fonctionCorrect'];
|
||||||
|
$re = '/^\s*CREATE OR REPLACE FUNCTION\s*([a-z0-9])/i';
|
||||||
|
preg_match($re, $fonction, $matches2, PREG_OFFSET_CAPTURE);
|
||||||
|
|
||||||
|
$string2 = 'f'.$matches2[1][0];
|
||||||
|
$ffonction = str_replace($matches2[1][0],'', $fonction);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$freponse = $reponse;
|
||||||
|
$type='requete';
|
||||||
|
}
|
||||||
|
$ligne = $type.'**'.$r['bddConcernee'].'**'.$r['numTp'].'**'.$r['question'].'**'.$freponse.'**'.$r['points'].'**n';
|
||||||
|
|
||||||
|
if($typeRow['type'] == 'functionCorrect'){
|
||||||
|
$ligne = $ligne.'**'.$ffonction;
|
||||||
|
}
|
||||||
|
$handle = @fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'tp'.DIRECTORY_SEPARATOR.'tp_exportes.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0) fwrite($file, $ligne."\n");
|
||||||
|
$trouve = 0;
|
||||||
|
//fwrite($file, $ligne."\n");
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
|
// file_put_contents('..\imports\demonstration\demo_exportes.txt', rtrim(file_get_contents('..\imports\demonstration\demo_exportes.txt')));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else if($_GET['type']=='qcm'){
|
||||||
|
$file = fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'qcm'.DIRECTORY_SEPARATOR.'qcm_exportes.txt', "w");
|
||||||
|
if(!$file) echo 'FILE';
|
||||||
|
$matches = array();
|
||||||
|
$trouve = 0;
|
||||||
|
$reponseQuery = $db->prepare('SELECT * FROM Qcm ORDER By numQcm');
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
while ($qcm = $reponseResult->fetchArray()){
|
||||||
|
|
||||||
|
$ligne = $qcm['numQcm'].'**'.$qcm['nom'].'**'.$qcm['type'];
|
||||||
|
$reponseQuery = $db->prepare('SELECT * FROM QcmQuestion WHERE numQcm=? ORDER By question');
|
||||||
|
$reponseQuery->bindParam(1, $qcm['numQcm']);
|
||||||
|
$questionResult = $reponseQuery->execute();
|
||||||
|
|
||||||
|
while ($question = $questionResult->fetchArray()){
|
||||||
|
$ligne = $qcm['numQcm'].'**'.$qcm['nom'].'**'.$qcm['type'];
|
||||||
|
$ligne = $ligne.'**'.$question['question'];
|
||||||
|
|
||||||
|
$reponseQuery = $db->prepare('SELECT * FROM QcmReponse WHERE numQcm=? AND numQuestion=? ORDER BY numReponse');
|
||||||
|
$reponseQuery->bindParam(1, $qcm['numQcm']);
|
||||||
|
$reponseQuery->bindParam(2, $question['numQuestion']);
|
||||||
|
$reponsResult = $reponseQuery->execute();
|
||||||
|
if($qcm['type'] == 'test'){
|
||||||
|
$ligne = $ligne.'**';
|
||||||
|
while ($reponseTest = $reponsResult->fetchArray()){
|
||||||
|
$ligne = $ligne.$reponseTest['reponse'].'---'.$reponseTest['points'].'+++';
|
||||||
|
}
|
||||||
|
$ligne = substr($ligne, 0, -3);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$ligne = $ligne.'**';
|
||||||
|
while ($reponseV = $reponsResult->fetchArray()){
|
||||||
|
$ligne = $ligne.$reponseV['reponse'].'+++';
|
||||||
|
}
|
||||||
|
$ligne = substr($ligne, 0, -3);
|
||||||
|
$ligne = $ligne.'**';
|
||||||
|
$reponseQuery = $db->prepare('SELECT * FROM QcmCorrection WHERE numQcm=? AND numQuestion=? ORDER BY numQcm,numQuestion');
|
||||||
|
$reponseQuery->bindParam(1, $qcm['numQcm']);
|
||||||
|
$reponseQuery->bindParam(2, $question['numQuestion']);
|
||||||
|
$reponsResult = $reponseQuery->execute();
|
||||||
|
while ($reponse = $reponsResult->fetchArray()){
|
||||||
|
$ligne = $ligne.$reponse['numReponse'].',,';
|
||||||
|
}
|
||||||
|
$ligne = substr($ligne, 0, -2);
|
||||||
|
|
||||||
|
}
|
||||||
|
$ligne = $ligne.'**'.$qcm['introduction'];
|
||||||
|
$trouve = 0;
|
||||||
|
$handle = @fopen('..'.DIRECTORY_SEPARATOR.'imports'.DIRECTORY_SEPARATOR.'qcm'.DIRECTORY_SEPARATOR.'qcm_exportes.txt', "r");
|
||||||
|
if ($handle)
|
||||||
|
{
|
||||||
|
while (!feof($handle))
|
||||||
|
{
|
||||||
|
$buffer = fgets($handle);
|
||||||
|
if(strpos($buffer, $ligne) !== FALSE)
|
||||||
|
$trouve = 1;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
if($trouve==0){
|
||||||
|
fwrite($file, $ligne."\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
|
}
|
@ -0,0 +1,152 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/VueAdmin.css">
|
||||||
|
|
||||||
|
|
||||||
|
<?php require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
|
||||||
|
$typeQuery->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$typeQuery->bindParam(2, $_GET['numTp']);
|
||||||
|
$resultType = $typeQuery->execute();
|
||||||
|
$typeRow = $resultType->fetchArray();
|
||||||
|
|
||||||
|
if($typeRow['type']== 'query')
|
||||||
|
$stmt = $db->prepare('SELECT * FROM Correct WHERE numQuestion= ? AND numTp = ?');
|
||||||
|
else if($typeRow['type']== 'functionCorrect')
|
||||||
|
$stmt = $db->prepare('SELECT question,reponse,fonctionCorrect,points FROM FunctionCorrect WHERE numQuestion= ? AND numTp = ?');
|
||||||
|
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numTp']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$questionRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<form style="border:1px solid #ccc" method="GET" >
|
||||||
|
<div class="container">
|
||||||
|
<h1>Modifier une question</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<label><b>TP n° : </b></label>
|
||||||
|
<input type="text" placeholder="Numéro du TP" id="tp" value="<?php echo $_GET['numTp']; ?>" required disabled>
|
||||||
|
|
||||||
|
<label><b>Numéro de question : </b></label>
|
||||||
|
<input type="text" placeholder="Saisir le numéro de question..." id="num" value="<?php echo $_GET['numQuestion']; ?>" required disabled>
|
||||||
|
|
||||||
|
<label><b>Barème : </b></label>
|
||||||
|
<input type="text" placeholder="Barème..." id="points" value="<?php echo $questionRow['points']; ?>" required>
|
||||||
|
|
||||||
|
<label><b>Consigne : </b></label>
|
||||||
|
<textarea placeholder="Ecrire la consigne..." id="consigne" required><?php echo $questionRow['question']; ?></textarea>
|
||||||
|
|
||||||
|
<label><b>Réponse : </b></label>
|
||||||
|
<textarea placeholder="SELECT ..." id="reponse" required><?php echo $questionRow['reponse']; ?></textarea>
|
||||||
|
|
||||||
|
<input class="executerReponse" type="button" value="Exécuter" onclick="ExecuterReponse();" > <br/><br/>
|
||||||
|
<div id="execute">
|
||||||
|
|
||||||
|
</div><div><br/><br/><br/></div>
|
||||||
|
|
||||||
|
<input type="hidden" id="modif" value="modif" >
|
||||||
|
<div class="clearfix">
|
||||||
|
<input type="button" value="Modifier" onclick="SubmitModifierQuestion()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="erreur">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get" id="frm-tp">
|
||||||
|
<input id="inp-tp" class="bouton" type="submit" name="action" value="Afficher les questions" >
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('input[type="radio"]').click(function() {
|
||||||
|
if($(this).attr('id') == 'btn-fonction') {
|
||||||
|
$('#show-me').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
$('#show-me').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if ($("#btn-fonction").prop("checked")) {
|
||||||
|
$('#show-me').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function ExecuterReponse() {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
var tx = $('#reponse').val() ;
|
||||||
|
var txt = tx.replace(/^\s+/g, "");
|
||||||
|
|
||||||
|
txt = txt.trim();
|
||||||
|
|
||||||
|
if(!(txt.toUpperCase().includes('CREATE') && txt.toUpperCase().includes('FUNCTION'))) {
|
||||||
|
if (txt.charAt(txt.length - 1) == ';') {
|
||||||
|
txt = txt.substr(0, txt.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.get("Traitement/AffichageDemo.php", { textbox: txt},
|
||||||
|
function(data) {
|
||||||
|
$('#execute').empty();
|
||||||
|
setTimeout( function(){ $('#execute').html(data); } , 400 );
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function SubmitModifierQuestion() {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
|
||||||
|
|
||||||
|
var tp = $('#tp').val() ;
|
||||||
|
var num = $('#num').val() ;
|
||||||
|
var points = $('#points').val() ;
|
||||||
|
var consigne = $('#consigne').val() ;
|
||||||
|
var reponse = $('#reponse').val() ;
|
||||||
|
//var type = $("input[name='type']:checked").val();
|
||||||
|
var type = 'requete';
|
||||||
|
var aleatoire= $("input[name='aleatoire']:checked").val();
|
||||||
|
//var bdd = $("input[name='bdd']:checked").val();
|
||||||
|
var bdd = 'NBA';
|
||||||
|
var fonction = $('#fonction').val() ;
|
||||||
|
var modif = $('#modif').val();
|
||||||
|
|
||||||
|
|
||||||
|
var tx = reponse;
|
||||||
|
|
||||||
|
var txt = tx.replace(/^\s+/g, "");
|
||||||
|
|
||||||
|
txt = txt.trim();
|
||||||
|
|
||||||
|
if(!(txt.toUpperCase().includes('CREATE') && txt.toUpperCase().includes('FUNCTION'))) {
|
||||||
|
if (txt.charAt(txt.length - 1) == ';') {
|
||||||
|
txt = txt.substr(0, txt.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reponse = txt;
|
||||||
|
$.get("Traitement/AjoutQuestion.php", { modif: modif, tp: tp,num: num,points: points,consigne: consigne,reponse: reponse,type: type,aleatoire: aleatoire,bdd: bdd, fonction : fonction},
|
||||||
|
function(data) {
|
||||||
|
$('#erreur').html(data);
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function AfficherQuestions(){
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/VueAdmin.css">
|
||||||
|
|
||||||
|
|
||||||
|
<?php require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT * FROM Demonstration WHERE numDemo= ? AND chapitre = ?');
|
||||||
|
$stmt->bindParam(1, $_GET['numDemo']);
|
||||||
|
$stmt->bindParam(2, $_GET['numChapitre']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$questionRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<form style="border:1px solid #ccc" method="GET" >
|
||||||
|
<div class="container">
|
||||||
|
<h1>Modifier une démonstration</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<label><b>Chapitre n° : </b></label>
|
||||||
|
<input type="text" placeholder="Numéro du TP" id="chapitre" value="<?php echo $_GET['numChapitre']; ?>" required disabled>
|
||||||
|
|
||||||
|
<label><b>Numéro de démonstration : </b></label>
|
||||||
|
<input type="text" placeholder="Saisir le numéro de question..." id="numDemo" value="<?php echo $_GET['numDemo']; ?>" required disabled>
|
||||||
|
|
||||||
|
<label><b>Description : </b></label>
|
||||||
|
<textarea placeholder="Ecrire la consigne..." id="description" required><?php echo $questionRow['description']; ?></textarea>
|
||||||
|
|
||||||
|
<label><b>Réponse : </b></label>
|
||||||
|
<textarea placeholder="SELECT ..." id="reponse" required><?php echo $questionRow['reponse']; ?></textarea>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" id="modif" value="modif" >
|
||||||
|
<div class="clearfix">
|
||||||
|
<input type="button" value="Modifier" onclick="SubmitModifierDemonstration()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="result">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get" id="frm-demo">
|
||||||
|
<input id="inp-demo" class="bouton" type="submit" name="action" value="Afficher les demonstrations" >
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function SubmitModifierDemonstration() {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
var chapitre = $('#chapitre').val() ;
|
||||||
|
var numDemo = $('#numDemo').val() ;
|
||||||
|
var description = $('#description').val() ;
|
||||||
|
var reponse = $('#reponse').val() ;
|
||||||
|
//var bdd = $("input[name='bdd']:checked").val();
|
||||||
|
var bdd = 'NBA';
|
||||||
|
var modif = 1;
|
||||||
|
$.get("Traitement/AjoutDemonstration.php", { modif: modif, chapitre: chapitre,numDemo: numDemo,description: description,reponse: reponse,bdd: bdd},
|
||||||
|
function(data) {
|
||||||
|
$('#result').html(data);
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function AfficherDemonstrations(){
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,198 @@
|
|||||||
|
|
||||||
|
<link rel="stylesheet" href="css/VueAdmin.css">
|
||||||
|
|
||||||
|
|
||||||
|
<?php require_once('../BDD/SqliteDb.php');
|
||||||
|
require_once('../BDD/OracleDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT * FROM Qcm WHERE numQcm= ?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQcm']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$qcmRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT * FROM QcmQuestion WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQcm']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$questionRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT reponse FROM QcmReponse WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQcm']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
while($r = $resultQuestion->fetchArray(SQLITE3_NUM)){
|
||||||
|
$reponseRow[] = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT count(*) FROM QcmReponse WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQcm']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$countRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
while($r = $resultQuestion->fetchArray(SQLITE3_NUM)){
|
||||||
|
$reponseRow[] = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT * FROM QcmCorrection WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQcm']);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$correctRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<form style="border:1px solid #ccc" method="GET" action="Traitement/AjoutQuestion.php">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Ajouter une question(QCM)</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<label><b>Numéro du Qcm : </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire le numéro du qcm..." id="numQcm" value="<?php echo $_GET['numQcm']; ?>" disabled>
|
||||||
|
|
||||||
|
<label><b>Nom du Qcm : </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire le nom du qcm..." id="nom" value="<?php echo $qcmRow['nom']; ?>" >
|
||||||
|
|
||||||
|
<label><b>Barème du Qcm : (Pour les questionnaires de type QCM- si nouveau ou si vous souhaitez modifier) </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire le barème du qcm..." id="baremeqcm" value="<?php echo $questionRow['bareme']; ?>" >
|
||||||
|
|
||||||
|
<label><b>Introduction du Qcm : </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire la phrase d'introduction du qcm..." id="intro" value="<?php echo $qcmRow['introduction']; ?>" required>
|
||||||
|
|
||||||
|
<label><b>Numéro de la question : </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire le nom du qcm..." id="numQuestion" value="<?php echo $_GET['numQuestion'];?>" disabled>
|
||||||
|
|
||||||
|
<label><b>Consigne : </b></label>
|
||||||
|
<input type="text" placeholder="Ecrire l'intitulé de la question..." id="consigne" value="<?php echo $questionRow['question'];?>" required>
|
||||||
|
|
||||||
|
<b><label for="type">Type de Qcm ?</label></b><br/><br/><div></div>
|
||||||
|
<select name="type" id="type" class="type" disabled>
|
||||||
|
<option value="vraifaux" label="Vrai ou Faux" <?php if($qcmRow['type'] == 'vraifaux') echo 'selected'; ?>></option>
|
||||||
|
<option value="test" label="enquête" <?php if($qcmRow['type'] == 'test') echo 'selected'; ?>></option>
|
||||||
|
</select>
|
||||||
|
<br/><br/><div></div>
|
||||||
|
|
||||||
|
<b><label for="nb_reponse">Nombre de choix de réponses ?</label></b><br/><br/><div></div>
|
||||||
|
<select name="nb_reponse" id="nbReponses" class="1to100">
|
||||||
|
<?php for($i=1;$i<100;$i++){
|
||||||
|
?><option value="<?php echo $i;?>" <?php if($countRow['count(*)'] == $i) echo 'selected'; ?>><?php echo $i;?></option>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<br/><br/><br/>
|
||||||
|
|
||||||
|
<div id="ireponses">
|
||||||
|
<?php if($qcmRow['type'] !== 'test'){
|
||||||
|
for($i=1 ; $i<=$countRow['count(*)'] ;$i++){ ?>
|
||||||
|
<label><b>Réponse <?php echo $i;?> : </b></label>
|
||||||
|
<?php
|
||||||
|
$stmt = $db->prepare('SELECT reponse FROM QcmReponse WHERE numQcm=? AND numQuestion=? AND numReponse=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQcm']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(3, $i);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$repRow = $resultQuestion->fetchArray();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<input type="text" id="choix<?php echo $i;?>" value="<?php echo $repRow['reponse'];?>" required>
|
||||||
|
<?php }
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for($i=1 ; $i<=$countRow['count(*)'] ;$i++){
|
||||||
|
$stmt = $db->prepare('SELECT reponse,points FROM QcmReponse WHERE numQcm=? AND numQuestion=? AND numReponse=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQcm']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(3, $i);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$repRow = $resultQuestion->fetchArray(); ?>
|
||||||
|
<label><b>Réponse <?php echo $i;?> : </b></label>
|
||||||
|
<input type="text" id="choix<?php echo $i;?>" value="<?php echo $repRow['reponse'];?>" required>
|
||||||
|
<input type="text" id="points<?php echo $i;?>" name="bareme" placeholder="Ecrire le nombre de points pour cette réponse" value="<?php echo $repRow['points'];?>"><br/>
|
||||||
|
<?php }
|
||||||
|
} ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label id="labelBrep"><b>Bonne(s) Réponse(s) ? </b><br/>
|
||||||
|
<div id="breponses">
|
||||||
|
<?php if($qcmRow['type'] !== 'test'){
|
||||||
|
for($i=1 ; $i<=$countRow['count(*)'] ;$i++){
|
||||||
|
$stmt = $db->prepare('SELECT count(*) FROM QcmCorrection WHERE numQuestion= ? AND numQcm=? AND numReponse=?');
|
||||||
|
$stmt->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$stmt->bindParam(2, $_GET['numQcm']);
|
||||||
|
$stmt->bindParam(3, $i);
|
||||||
|
$resultQuestion = $stmt->execute();
|
||||||
|
$BrepRow = $resultQuestion->fetchArray();
|
||||||
|
if($BrepRow['count(*)']==0) $isChecked='';
|
||||||
|
else $isChecked='checked';
|
||||||
|
?>
|
||||||
|
<input type="checkbox" id="rep<?php echo $i;?>" name="reponse" value="<?php echo $i;?>" <?php echo $isChecked;?>><?php echo $i;?><br/>
|
||||||
|
<?php }
|
||||||
|
}?>
|
||||||
|
</div>
|
||||||
|
</label><br/>
|
||||||
|
|
||||||
|
<div >
|
||||||
|
<input type="button" value="Modifier" onclick="SubmitModifierQCM()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="erreur">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get">
|
||||||
|
<input id="inp-qcm" class="bouton" type="submit" name="action" value="QCM" >
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function SubmitModifierQCM() {
|
||||||
|
var reponse = [];
|
||||||
|
var choix = [];
|
||||||
|
var numQcm = $('#numQcm').val();
|
||||||
|
var type = $('#type').val();
|
||||||
|
var nomQcm = $('#nom').val();
|
||||||
|
|
||||||
|
var nbRep = $('#nbReponses').val();
|
||||||
|
|
||||||
|
for( var i = 1 ; i<=nbRep ; i++){
|
||||||
|
if ( $('#rep'+i).is( ":checked" ))
|
||||||
|
reponse.push($('#rep'+i).val());
|
||||||
|
if(type !== 'test')
|
||||||
|
choix.push($('#choix'+i).val());
|
||||||
|
else{
|
||||||
|
choix.push($('#choix'+i).val()+'---'+$('#points'+i).val())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var consigne = $('#consigne').val() ;
|
||||||
|
var modif = 1;
|
||||||
|
var baremequestion='test';
|
||||||
|
if($('#bareme-question')){
|
||||||
|
baremequestion = $('#bareme-question').val();
|
||||||
|
}
|
||||||
|
|
||||||
|
var intro = $('#intro').val() ;
|
||||||
|
var numQuestion = $('#numQuestion').val() ;
|
||||||
|
$.get("Traitement/AjoutQCM.php", {numQuestion : numQuestion,baremequestion : baremequestion,intro : intro, type : type , numQcm : numQcm , nomQcm : nomQcm,consigne: consigne, reponse : reponse, choix : choix ,modif:modif},
|
||||||
|
function(data) {
|
||||||
|
$('#erreur').html(data);
|
||||||
|
if (data.includes("AJOUT") == true){
|
||||||
|
/*var result = confirm("La question a été ajoutée. Afficher les QCM ?");
|
||||||
|
if(result) $('#inp-qcm').trigger("click"); */
|
||||||
|
}
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
$numQuestion = $_GET['numQuestion'];
|
||||||
|
$numTp = $_GET['numTp'];
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
$test = 999;
|
||||||
|
|
||||||
|
$Correct = 'Correct';
|
||||||
|
$function = 'functionCorrect';
|
||||||
|
|
||||||
|
|
||||||
|
if(isset($_GET['des'])){
|
||||||
|
$numQuestion += 1;
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($numQuestion!=1){
|
||||||
|
|
||||||
|
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
|
||||||
|
$typeQuery->bindParam(1, $numQuestion);
|
||||||
|
$typeQuery->bindParam(2, $numTp);
|
||||||
|
$resultType = $typeQuery->execute();
|
||||||
|
$typeRow = $resultType->fetchArray();
|
||||||
|
|
||||||
|
$typeQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion = ? AND numTp= ?');
|
||||||
|
$typeQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$typeQuery->bindParam(2, $numTp);
|
||||||
|
$resultType = $typeQuery->execute();
|
||||||
|
$type2Row = $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, $test);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
//---------
|
||||||
|
if($type2Row['type'] == 'query'){
|
||||||
|
$table2 = 'Correct';
|
||||||
|
$type2 = 'query';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$table2 = 'FunctionCorrect';
|
||||||
|
$type2 = 'functionCorrect';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE '.$table2.' SET numQuestion=? WHERE numQuestion=? AND numTp=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Type SET type=? WHERE numQuestion=? AND numTp=?');
|
||||||
|
$sqliteQuery->bindParam(1, $type2);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
//---------
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE '.$table.' SET numQuestion=? WHERE numQuestion=? AND numTp=?');
|
||||||
|
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(2, $test);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resultp = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Type SET type=? WHERE numQuestion=? AND numTp=?');
|
||||||
|
$sqliteQuery->bindParam(1, $type);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//header("Location: index.php");
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
$numQuestion = $_GET['numDemo'];
|
||||||
|
$numTp = $_GET['numChapitre'];
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
$test = 999;
|
||||||
|
|
||||||
|
if(isset($_GET['des'])){
|
||||||
|
$numQuestion += 1;
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($numQuestion!=1){
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
|
||||||
|
$sqliteQuery->bindParam(1, $test);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(2, $test);
|
||||||
|
$sqliteQuery->bindParam(3, $numTp);
|
||||||
|
$resultp = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//header("Location: index.php");
|
||||||
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
$numQuestion = $_GET['numQuestion'];
|
||||||
|
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
$test = 999;
|
||||||
|
|
||||||
|
if(isset($_GET['des'])){
|
||||||
|
$numQuestion += 1;
|
||||||
|
$numQuestionPrec = $numQuestion-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($numQuestion!=1){
|
||||||
|
//QCM QUestion
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmQuestion SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $test);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmQuestion SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmQuestion SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(2, $test);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resultp = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
//même chose pour qcmreponse
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmReponse SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $test);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmReponse SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmReponse SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(2, $test);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resultp = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
//même chose pour QCMcorrection
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmCorrection SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $test);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmCorrection SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestion);
|
||||||
|
$sqliteQuery->bindParam(2, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resulti = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmCorrection SET numQuestion=? WHERE numQuestion=? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $numQuestionPrec);
|
||||||
|
$sqliteQuery->bindParam(2, $test);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$resultp = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//header("Location: index.php");
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once('../../BDD/SqliteDb.php');
|
||||||
|
|
||||||
|
$db = new SqliteDb('save');
|
||||||
|
|
||||||
|
if(!isset($_GET['tp'])){
|
||||||
|
$query = $db->prepare('SELECT count(*) FROM Qcm ');
|
||||||
|
$result = $query->execute();
|
||||||
|
$r = $result->fetchArray();
|
||||||
|
|
||||||
|
for($numQcm = 1 ; $numQcm <= $r['count(*)'] ; $numQcm++){
|
||||||
|
$db->ecrireFichierNotes($numQcm,'save',"qcm");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$query = $db->prepare('SELECT count(*) FROM Type ');
|
||||||
|
$result = $query->execute();
|
||||||
|
$r = $result->fetchArray();
|
||||||
|
|
||||||
|
for($numTp = 1 ; $numTp <= $r['count(*)'] ; $numTp++){
|
||||||
|
$db->ecrireFichierNotes($numTp,'save',"tp");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once('../../BDD/SqliteDb.php');
|
||||||
|
|
||||||
|
$db = new SqliteDb('save');
|
||||||
|
|
||||||
|
|
||||||
|
$question = str_replace("textbox","", $_GET['id']);
|
||||||
|
$tab = explode('-', $question);
|
||||||
|
|
||||||
|
$numQcm = $tab[0];
|
||||||
|
$numQuestion = $tab[1];
|
||||||
|
$numReponse = $tab[2];
|
||||||
|
|
||||||
|
//$user = "mehdi";
|
||||||
|
$user = $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
|
|
||||||
|
if($_GET['type'] == 'vraifaux'){
|
||||||
|
if($_GET['check'] == 'true'){
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO QcmSauvegarde VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1, $user);
|
||||||
|
$query->bindParam(2,$numQcm);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$numReponse);
|
||||||
|
$result = $query->execute();
|
||||||
|
echo "d";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$query = $db->prepare('DELETE FROM QcmSauvegarde WHERE numQcm=? AND numQuestion=? AND numReponse = ? AND idEtudiant=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$query->bindParam(2,$numQuestion);
|
||||||
|
$query->bindParam(3,$numReponse);
|
||||||
|
$query->bindParam(4, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
echo "e";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//Sauvegarde des notes//
|
||||||
|
$query = $db->prepare('SELECT points FROM QcmReponse WHERE numQuestion=? AND numQcm= ? AND numReponse= ?');
|
||||||
|
$query->bindParam(1, $numQuestion);
|
||||||
|
$query->bindParam(2, $numQcm);
|
||||||
|
$query->bindParam(3,$numReponse);
|
||||||
|
$result = $query->execute();
|
||||||
|
$pointRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO NotesParQuestion VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1,$user);
|
||||||
|
$query->bindParam(2,$numQcm);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$pointRow['points']);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$query = $db->prepare('SELECT note FROM NotesParQuestion WHERE numQcm= ? AND idEtudiant = ?');
|
||||||
|
$query->bindParam(1, $numQcm);
|
||||||
|
$query->bindParam(2, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$note = 0;
|
||||||
|
while($r = $result->fetchArray()){
|
||||||
|
$note += $r['note'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO Notes VALUES (?,?,?)');
|
||||||
|
$query->bindParam(1,$user );
|
||||||
|
$query->bindParam(2,$numQcm);
|
||||||
|
$query->bindParam(3,$note );
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Sauvegarde des REPONSES//
|
||||||
|
$query = $db->prepare('DELETE FROM QcmSauvegarde WHERE numQcm= ? AND numQuestion = ? AND idEtudiant=?');
|
||||||
|
$query->bindParam(1,$numQcm);
|
||||||
|
$query->bindParam(2,$numQuestion);
|
||||||
|
$query->bindParam(3, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO QcmSauvegarde VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1, $user);
|
||||||
|
$query->bindParam(2,$numQcm);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$numReponse);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
//$db->ecrireFichierNotes($numQcm,'save');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once('../../BDD/SqliteDb.php');
|
||||||
|
|
||||||
|
$db = new SqliteDb('save');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$numTp = $_GET['numTp'];
|
||||||
|
$numQuestion = $_GET['numQuestion'];
|
||||||
|
$reponse = $_GET['textbox'];
|
||||||
|
|
||||||
|
|
||||||
|
//$user = "mehdi";
|
||||||
|
$user = $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
|
|
||||||
|
//Sauvegarde des REPONSES//
|
||||||
|
$query = $db->prepare('DELETE FROM TpSauvegarde WHERE numTp= ? AND numQuestion = ? AND idEtudiant=?');
|
||||||
|
$query->bindParam(1,$numTp);
|
||||||
|
$query->bindParam(2,$numQuestion);
|
||||||
|
$query->bindParam(3, $user);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
$query = $db->prepare('INSERT OR REPLACE INTO TpSauvegarde VALUES (?,?,?,?)');
|
||||||
|
$query->bindParam(1, $user);
|
||||||
|
$query->bindParam(2,$numTp);
|
||||||
|
$query->bindParam(3,$numQuestion);
|
||||||
|
$query->bindParam(4,$reponse);
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
//$db->ecrireFichierNotes($numTp,'save');
|
||||||
|
|
||||||
|
echo 'testsave';
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,214 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($_GET['qcm'])){
|
||||||
|
$numQcmSuiv = $_GET['numQuestion']+1;
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('SELECT count(*) FROM QcmQuestion WHERE numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
$nbQuestionsRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM QcmQuestion WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$sqliteQuery->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
for( $iSuiv = $numQcmSuiv, $j=$_GET['numQuestion'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmQuestion SET numQuestion=? WHERE numQuestion=? AND numQcm=? ');
|
||||||
|
$sqliteQuery->bindParam(1, $j);
|
||||||
|
$sqliteQuery->bindParam(2, $iSuiv);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
//même chose pour qcmreponse
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM QcmReponse WHERE numQuestion= ? AND numQcm = ?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$sqliteQuery->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
for( $iSuiv = $numQcmSuiv, $j=$_GET['numQuestion'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmReponse SET numQuestion=? WHERE numQuestion=? AND numQcm = ? ');
|
||||||
|
$sqliteQuery->bindParam(1, $j);
|
||||||
|
$sqliteQuery->bindParam(2, $iSuiv);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
//même chose pour QcmCorrection
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM QcmCorrection WHERE numQuestion= ? AND numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
||||||
|
$sqliteQuery->bindParam(2, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
for( $iSuiv = $numQcmSuiv, $j=$_GET['numQuestion'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE QcmCorrection SET numQuestion=? WHERE numQuestion=? AND numQcm=? ');
|
||||||
|
$sqliteQuery->bindParam(1, $j);
|
||||||
|
$sqliteQuery->bindParam(2, $iSuiv);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($nbQuestionsRow['count(*)'] == 1){
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM Qcm WHERE numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM QcmSauvegarde WHERE numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM Notes WHERE numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM NotesParQuestion WHERE numQcm=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numQcm']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(isset($_GET['demo'])){
|
||||||
|
|
||||||
|
$numDemoSuiv = $_GET['numDemo']+1;
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('SELECT count(*) FROM Demonstration WHERE chapitre=?');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numChapitre']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
$nbQuestionsRow = $result->fetchArray();
|
||||||
|
|
||||||
|
$sqliteQuery = $db->prepare('DELETE FROM Demonstration WHERE numDemo= ? AND chapitre=? ');
|
||||||
|
$sqliteQuery->bindParam(1, $_GET['numDemo']);
|
||||||
|
$sqliteQuery->bindParam(2, $_GET['numChapitre']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
|
||||||
|
|
||||||
|
for( $iSuiv = $numDemoSuiv, $j=$_GET['numDemo'] ; $iSuiv <= $nbQuestionsRow['count(*)'] ; $iSuiv++ , $j++ ){
|
||||||
|
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=? ');
|
||||||
|
$sqliteQuery->bindParam(1, $j);
|
||||||
|
$sqliteQuery->bindParam(2, $iSuiv);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numChapitre']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
|
$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();
|
||||||
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
$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{
|
||||||
|
$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('UPDATE Type SET numQuestion=? WHERE numQuestion=? AND numTp=? ');
|
||||||
|
$sqliteQuery->bindParam(1, $j);
|
||||||
|
$sqliteQuery->bindParam(2, $iSuiv);
|
||||||
|
$sqliteQuery->bindParam(3, $_GET['numTp']);
|
||||||
|
$result = $sqliteQuery->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// fin else type
|
||||||
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form style="border:1px solid #ccc" method="GET">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Modifier les dates de tp</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once('../BDD/SqliteDb.php');
|
||||||
|
|
||||||
|
$db = new SqliteDb('o');
|
||||||
|
|
||||||
|
$reponseQuery = $db->prepare('SELECT dateDebut,dateFin FROM dateTp WHERE numTp=?');
|
||||||
|
$reponseQuery->bindParam(1,$_GET['tp']);
|
||||||
|
$reponseResult = $reponseQuery->execute();
|
||||||
|
$reponseRow = $reponseResult->fetchArray();
|
||||||
|
|
||||||
|
$anneeDebut = substr($reponseRow['dateDebut'],0,4) ;
|
||||||
|
$moisDebut=substr($reponseRow['dateDebut'],4,2);
|
||||||
|
$jourDebut=substr($reponseRow['dateDebut'],6,2);
|
||||||
|
$dateDebut= $anneeDebut.'-'.$moisDebut.'-'.$jourDebut;
|
||||||
|
|
||||||
|
$anneeFin=substr($reponseRow['dateFin'],0,4);
|
||||||
|
$moisFin=substr($reponseRow['dateFin'],4,2);
|
||||||
|
$jourFin=substr($reponseRow['dateFin'],6,2);
|
||||||
|
$dateFin= $anneeFin.'-'.$moisFin.'-'.$jourFin;
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<label><b>TP n° : </b></label>
|
||||||
|
<input type="text" placeholder="Numéro du TP " id="tp" name='tp' value="<?php echo $_GET['tp'];?> " disabled><br/><br/><br/>
|
||||||
|
|
||||||
|
<label><b>Date début de tp </b></label>
|
||||||
|
<input type="date" id="debut" name='debut' value="<?php echo $dateDebut; ?>" required><br/><br/>
|
||||||
|
|
||||||
|
<label><b>Date fin de tp </b></label>
|
||||||
|
<input type="date" id="fin" name='fin' value="<?php echo $dateFin; ?>" required><br/><br/><br/>
|
||||||
|
|
||||||
|
<div >
|
||||||
|
<input type="button" value="Valider" onclick="SubmitAjoutDate()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="erreur">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get">
|
||||||
|
<input id="inp-questions" class="bouton" type="submit" name="action" value="Afficher les questions">
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function SubmitAjoutDate() {
|
||||||
|
$('#erreur').empty();
|
||||||
|
var tp = $('#tp').val();
|
||||||
|
var debut = $('#debut').val();
|
||||||
|
var fin = $('#fin').val();
|
||||||
|
//alert(debut+'____'+fin)
|
||||||
|
$.get("Traitement/DateTp.php", { debut : debut, fin : fin , tp :tp },
|
||||||
|
function(data) {
|
||||||
|
$('#erreur').html(data);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Autoload
|
||||||
|
{
|
||||||
|
private static $_instance = null;
|
||||||
|
public static $limite=3;
|
||||||
|
|
||||||
|
public static function setLimite($valeur){
|
||||||
|
Autoload::$limite=$valeur;
|
||||||
|
}
|
||||||
|
public static function getLimite(){
|
||||||
|
return Autoload::$limite;
|
||||||
|
}
|
||||||
|
public static function charger()
|
||||||
|
{
|
||||||
|
if(null !== self::$_instance) {
|
||||||
|
throw new RuntimeException(sprintf('%s is already started', __CLASS__));
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$_instance = new self();
|
||||||
|
|
||||||
|
|
||||||
|
if(!spl_autoload_register(array(self::$_instance, '_autoload'), false)) {
|
||||||
|
throw RuntimeException(sprintf('%s : Could not start the autoload', __CLASS__));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function shutDown()
|
||||||
|
{
|
||||||
|
if(null !== self::$_instance) {
|
||||||
|
|
||||||
|
if(!spl_autoload_unregister(array(self::$_instance, '_autoload'))) {
|
||||||
|
throw new RuntimeException('Could not stop the autoload');
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$_instance = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function _autoload($class)
|
||||||
|
{
|
||||||
|
global $rep;
|
||||||
|
$filename = $class.'.php';
|
||||||
|
$dir =array('modeles/','./','config/','controleur/','DAL/','metier/','css/','BDD/','Traitement/');
|
||||||
|
foreach ($dir as $d){
|
||||||
|
$file=$rep.$d.$filename;
|
||||||
|
//echo $file;
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//gen
|
||||||
|
$rep=__DIR__.'/../';
|
||||||
|
|
||||||
|
//Vues
|
||||||
|
|
||||||
|
$vues['vuePrincipale']='vues/VuePrincipale.php';
|
||||||
|
$vues['vueLogin']='vues/vueLogin.php';
|
||||||
|
$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['vueLibre']='vues/VueLibre.php';
|
||||||
|
$vues['vueAjoutQCM']='vues/vueAjoutQCM.php';
|
||||||
|
$vues['vueAjoutDemo']='vues/VueAjoutDemo.php';
|
||||||
|
$vues['vueDateTp']='vues/VueGestionTp.php';
|
||||||
|
$vues['vueGestion']='vues/VueGestionTables.php';
|
||||||
|
|
||||||
|
|
||||||
|
$vues['vueBoo']='css/bootstrap.min.css';
|
||||||
|
$css['vuePrincipale']='css/VuePrincipale.php';
|
||||||
|
$css['bootstrap']='css/bootstrap.min.css';
|
@ -0,0 +1,224 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Controleur {
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
global $rep,$vues;
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$dVueEreur = array ();
|
||||||
|
if($this->isAdmin())
|
||||||
|
$_SESSION['typeSession'] = 'LJLf1';
|
||||||
|
else $_SESSION['typeSession'] = 'user';
|
||||||
|
try{
|
||||||
|
$action=$_REQUEST['action'];
|
||||||
|
// echo $action;
|
||||||
|
switch($action) {
|
||||||
|
|
||||||
|
case NULL :
|
||||||
|
//require ($rep.$vues['vueLogin']);
|
||||||
|
//$this->afficherQuestions();
|
||||||
|
require ($rep.$vues['vueAccueil']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Retour au menu principal' :
|
||||||
|
//require ($rep.$vues['vueLogin']);
|
||||||
|
//$this->afficherQuestions();
|
||||||
|
require ($rep.$vues['vueAccueil']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Dates de TP' :
|
||||||
|
require ($rep.$vues['vueDateTp']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Ajouter une question' :
|
||||||
|
require ($rep.$vues['vueAdmin']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'TP':
|
||||||
|
//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']);
|
||||||
|
break;
|
||||||
|
case 'Valider' :
|
||||||
|
$this->Correction();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Demonstrations de cours' :
|
||||||
|
$this->afficherDemonstrations();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Afficher les demonstrations' :
|
||||||
|
//$this->verificationConnexion();
|
||||||
|
$this->afficherDemonstrations();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Ajouter une demonstration' :
|
||||||
|
require ($rep.$vues['vueAjoutDemo']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Générer Base de données aléatoire':
|
||||||
|
$this->resetRandomBdd();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ok' :
|
||||||
|
$this->afficherDemonstrations();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Reintiliser les demonstrations' :
|
||||||
|
$this->resetDemonstrations();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Reintiliser les QCM' :
|
||||||
|
$this->resetQCM();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Réintiliser les TP' :
|
||||||
|
$this->resetQuestions();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'QCM' :
|
||||||
|
$this->afficherQCM();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Ajouter QCM' :
|
||||||
|
require ($rep.$vues['vueAjoutQCM']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Creation de table' :
|
||||||
|
$this->afficherCreationTable();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Gestion de tables' :
|
||||||
|
$this->afficherGestionTable();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$dVueEreur[] ="Erreur d'appel php";
|
||||||
|
require ($rep.$vues['erreur']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (PDOException $e)
|
||||||
|
{
|
||||||
|
$dVueEreur[] = "Erreur inattendue!!! ";
|
||||||
|
//require ($rep.$vues['erreur']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//$this->afficherQuestions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function isAdmin(){
|
||||||
|
switch($_SERVER['REMOTE_USER']){
|
||||||
|
case 'meelaichao':
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case 'palafour' :
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
function resetQCM(){
|
||||||
|
$db = new SqliteDb();
|
||||||
|
$db->createQCM();
|
||||||
|
$db->createNotes();
|
||||||
|
$db->creerSauvegardeQcm();
|
||||||
|
$this->afficherQCM();
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetQuestions(){
|
||||||
|
$db = new SqliteDb();
|
||||||
|
$db->createTable();
|
||||||
|
$this->afficherQuestions();
|
||||||
|
}
|
||||||
|
function resetRandomBdd(){
|
||||||
|
require_once('BDD/OracleDb.php');
|
||||||
|
$oraDb = new OracleDb();
|
||||||
|
$oraDb->createRandomTables();
|
||||||
|
$this->afficherQuestions();
|
||||||
|
}
|
||||||
|
function resetDemonstrations(){
|
||||||
|
$db = new SqliteDb();
|
||||||
|
$db->createDemonstration();
|
||||||
|
$this->afficherDemonstrations();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function afficherQuestions(){
|
||||||
|
global $rep,$vues,$css;
|
||||||
|
|
||||||
|
$model = new Modele();
|
||||||
|
$dVueQuestions = $model->afficherQuestions();
|
||||||
|
$_SESSION['array']=$dVueQuestions;
|
||||||
|
//require ($rep.$vues['vueSupression']);
|
||||||
|
require ($rep.$vues['vuePrincipale']);
|
||||||
|
//require ($rep.$vues['vueNbQuestions']);
|
||||||
|
//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;
|
||||||
|
|
||||||
|
$id = $_POST['identifiant'];
|
||||||
|
$mdp = $_POST['motdepasse'];
|
||||||
|
|
||||||
|
$modele = new Modele();
|
||||||
|
if($modele->connection($id,$mdp)==null){
|
||||||
|
require($rep.$vues['vueLogin']);
|
||||||
|
}
|
||||||
|
else $this->afficherQuestions();
|
||||||
|
}
|
||||||
|
|
||||||
|
function Correction(){
|
||||||
|
require('Correcteur.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
function afficherCreationTable(){
|
||||||
|
global $rep,$vues;
|
||||||
|
|
||||||
|
require ($rep.$vues['vueLibre']);
|
||||||
|
}
|
||||||
|
|
||||||
|
function afficherGestionTable(){
|
||||||
|
global $rep,$vues;
|
||||||
|
|
||||||
|
require ($rep.$vues['vueGestion']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
@ -0,0 +1,49 @@
|
|||||||
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adm:hover{
|
||||||
|
background: #d9534f;
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
|
||||||
|
|
||||||
|
* {box-sizing: border-box}
|
||||||
|
|
||||||
|
input[type=text] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 5px 0 22px 0;
|
||||||
|
display: inline-block;
|
||||||
|
border: none;
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=text]:focus {
|
||||||
|
background-color: #ddd;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 5px 0 22px 0;
|
||||||
|
display: inline-block;
|
||||||
|
border: none;
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea:focus {
|
||||||
|
background-color: #ddd;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: 1px solid #f1f1f1;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
button {
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 14px 20px;
|
||||||
|
margin: 8px 0;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 100%;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
opacity:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnvalider {
|
||||||
|
float: left;
|
||||||
|
width: 25%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 16px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.clearfix::after {
|
||||||
|
content: "";
|
||||||
|
clear: both;
|
||||||
|
display: table;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;}
|
||||||
|
|
||||||
|
@media screen and (max-width: 300px) {
|
||||||
|
.btnvalider {
|
||||||
|
width: 100%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-demo{
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-left: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-demo input{
|
||||||
|
height: 50px;
|
||||||
|
width: 300px;
|
||||||
|
background: #0082b5;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 5px 5px 5px #eee;
|
||||||
|
text-shadow:none;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-demo input:hover{
|
||||||
|
background: #016ABC;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 5px 5px 5px #eee;
|
||||||
|
text-shadow:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-qcm{
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-left: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-qcm input{
|
||||||
|
height: 50px;
|
||||||
|
width: 300px;
|
||||||
|
background: #0082b5;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 5px 5px 5px #eee;
|
||||||
|
text-shadow:none;
|
||||||
|
margin-right: 23%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-qcm input:hover{
|
||||||
|
background: #016ABC;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 5px 5px 5px #eee;
|
||||||
|
text-shadow:none;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
#frm-reset{
|
||||||
|
position:absolute;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-export {
|
||||||
|
margin-left: 75%;
|
||||||
|
|
||||||
|
}
|
||||||
|
#frm-export input{
|
||||||
|
width: 100px;
|
||||||
|
height : 55px;
|
||||||
|
}
|
||||||
|
.adm{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inp-gauche{
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inp-centre{
|
||||||
|
margin-left: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btn-ajout, #inp-ret,#btn-ajout1, #inp-ret1 {
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 26, 2020, 10:36:40 AM
|
||||||
|
Author : Mehdi
|
||||||
|
*/
|
||||||
|
#frm-export, #frm-exportqcm {
|
||||||
|
margin-left: 75%;
|
||||||
|
|
||||||
|
}
|
||||||
|
#frm-export input, #frm-exportqcm input{
|
||||||
|
width: 150px;
|
||||||
|
height : 35px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-exportnoteqcm{
|
||||||
|
margin-left: 75%;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#frm-exportnoteqcm{
|
||||||
|
width: 150px;
|
||||||
|
height : 45px;
|
||||||
|
}
|
||||||
|
.adm{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inp-gauche{
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inp-centre{
|
||||||
|
margin-left: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer{
|
||||||
|
position: relative;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
background-color: red;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
li {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btn-ajout, #inp-ret,#btn-ajout1, #inp-ret1 {
|
||||||
|
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;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,325 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap Reboot v4.5.0 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
|
*/
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif;
|
||||||
|
line-height: 1.15;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #212529;
|
||||||
|
text-align: left;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tabindex="-1"]:focus:not(:focus-visible) {
|
||||||
|
outline: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
box-sizing: content-box;
|
||||||
|
height: 0;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title],
|
||||||
|
abbr[data-original-title] {
|
||||||
|
text-decoration: underline;
|
||||||
|
-webkit-text-decoration: underline dotted;
|
||||||
|
text-decoration: underline dotted;
|
||||||
|
cursor: help;
|
||||||
|
border-bottom: 0;
|
||||||
|
-webkit-text-decoration-skip-ink: none;
|
||||||
|
text-decoration-skip-ink: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
address {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
font-style: normal;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
|
ul,
|
||||||
|
dl {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol ol,
|
||||||
|
ul ul,
|
||||||
|
ol ul,
|
||||||
|
ul ol {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
position: relative;
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #007bff;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #0056b3;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not([href]) {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not([href]):hover {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre,
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
samp {
|
||||||
|
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
overflow: auto;
|
||||||
|
-ms-overflow-style: scrollbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
vertical-align: middle;
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
overflow: hidden;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
caption {
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
color: #6c757d;
|
||||||
|
text-align: left;
|
||||||
|
caption-side: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
|
outline: 1px dotted;
|
||||||
|
outline: 5px auto -webkit-focus-ring-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button,
|
||||||
|
select,
|
||||||
|
optgroup,
|
||||||
|
textarea {
|
||||||
|
margin: 0;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
[role="button"] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
word-wrap: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
[type="button"],
|
||||||
|
[type="reset"],
|
||||||
|
[type="submit"] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:not(:disabled),
|
||||||
|
[type="button"]:not(:disabled),
|
||||||
|
[type="reset"]:not(:disabled),
|
||||||
|
[type="submit"]:not(:disabled) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
[type="button"]::-moz-focus-inner,
|
||||||
|
[type="reset"]::-moz-focus-inner,
|
||||||
|
[type="submit"]::-moz-focus-inner {
|
||||||
|
padding: 0;
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="radio"],
|
||||||
|
input[type="checkbox"] {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
min-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
line-height: inherit;
|
||||||
|
color: inherit;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress {
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="number"]::-webkit-inner-spin-button,
|
||||||
|
[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="search"] {
|
||||||
|
outline-offset: -2px;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-file-upload-button {
|
||||||
|
font: inherit;
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
|
||||||
|
output {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,8 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap Reboot v4.5.0 (https://getbootstrap.com/)
|
||||||
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
|
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||||
|
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.form-signin {
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 0 auto;
|
||||||
|
color: #017572;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .form-signin-heading,
|
||||||
|
.form-signin .checkbox {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .checkbox {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .form-control {
|
||||||
|
position: relative;
|
||||||
|
height: auto;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .form-control:focus {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border-color:#017572;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-color:#017572;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2{
|
||||||
|
text-align: right;
|
||||||
|
color: blue;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,46 @@
|
|||||||
|
html,body {
|
||||||
|
height:100%;
|
||||||
|
width:100%;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
display:flex;
|
||||||
|
}
|
||||||
|
form {
|
||||||
|
margin:auto;/* nice thing of auto margin if display:flex; it center both horizontal and vertical :) */
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
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;
|
||||||
|
height: 10px;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table JOUEUR**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table STATS**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**2**Exemple de requête pour selectionner ers lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**Exemple de requête pour selectionner les 2 )))))))) lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3NBA**2**Exemple de requête pour selectionner les 2 premières lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**aaaaaaaaaaaaaaaaaa**aaaaaaaaaaaaaaaaaa
|
@ -0,0 +1,28 @@
|
|||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table JOUEUR**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table STATS**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**2**Exemple de requête pour selectionner ers lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**Exemple de requête pour selectionner les 2 premières lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**Exemple de requête pour selectionner les 2 )))))))) lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**aaaaaaaaaaaaaaaaaa**aaaaaaaaaaaaaaaaaa
|
||||||
|
NBA**2**sd**qsd
|
||||||
|
NBA**2**Exemple de requête pour selectionner les 2 )))))))) lignes de la table GAME**SELECT * FROM GAME WHERE rownum<3NBA
|
||||||
|
NBA**2**aaaaaaaaaaaaaaaaaa**aaaaaaaaaaaaaaaaaaNBA
|
||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table dqsdqsd**SELECT * FROM STATS WHERE rownum<5
|
||||||
|
NBA**2**oipoipo**SELECT * from JOUEUR WHERE rownum<2
|
||||||
|
NBA**2**aaaaaaaa**SELECT * from JOUEUR WHERE rownum<2
|
||||||
|
NBA**2**BBBBBBBBBB**SELECT * from JOUEUR WHERE rownum<2
|
||||||
|
NBA**2**oipoipo**SELECT * from JOUEUR WHERE rownum<6
|
||||||
|
NBA**2**2222**SELECT * from JOUEUR WHERE rownum<2
|
||||||
|
NBA**2**aj1**SELECT * FROM GAME WHERE rownum<3
|
||||||
|
NBA**2**aj1**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**2**aj1**SELECT * FROM JOUEUR WHERE rownum<5
|
||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table JO**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1**Exemple de requête pour selectionner les 2 premières lignes de la table okkkk2**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**1**qzdq**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1** STATS**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**1** STATS**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**1** STATS**SELECT * FROM STATS WHERE rownum<2
|
||||||
|
NBA**1**STATS**SELECT * FROM STATS WHERE rownum<3
|
||||||
|
NBA**1** JOUEUR**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1**JOUEUR**SELECT * FROM JOUEUR WHERE rownum<3
|
||||||
|
NBA**1** JOUEURQSDqsd**SELECT * FROM JOUEUR WHERE rownum<3
|
@ -0,0 +1,4 @@
|
|||||||
|
requete**NBA**2**Déterminer pou**SELECT nom FROM EQUIPE, STATS WHERE datematch = '30-OCT-17' AND prenomnoms = 'Kevin Durant' AND idequipe = CASE WHEN locationjoueur = 'Away' THEN equipeadverse WHEN locationjoueur = 'Home' THEN equipejoueur END **1**n
|
||||||
|
requete**NBA**2**Trouver le nombre de matchs joués par Kevin Durant**SELECT count(*) FROM STATS WHERE prenomnoms='Kevin Durant' **4**n
|
||||||
|
requete**NBA**2**pppp**SELECT * FROM JOUEUR WHERE rownum<3**4**n
|
||||||
|
requete**NBA**1**AZ**SELECT * FROM JOUEUR WHERE rownum<3**3**n
|
@ -0,0 +1,3 @@
|
|||||||
|
requete**NBA**1**1**Lister les joueurs de la table Equipe**SELECT * FROM EQUIPE**10**o
|
||||||
|
requete**NBA**1**2**Lister les joueurs de la table JOUEUR**SELECT * FROM JOUEUR**10**o
|
||||||
|
fonction**NBA**1**2**Lister les jofsdfsdfsdf la table JOUEUR**SELECT * FROM JOUEUR**10**o**createfsdf
|
@ -0,0 +1,55 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php //chargement config
|
||||||
|
//phpinfo();
|
||||||
|
/*$remote_user = $_SERVER['REMOTE_USER'];
|
||||||
|
echo $remote_user;*/
|
||||||
|
|
||||||
|
|
||||||
|
// 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...";
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
ini_set('display_errors',1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
require_once(__DIR__.'/config/config.php');
|
||||||
|
|
||||||
|
//chargement autoloader pour autochargement des classes
|
||||||
|
require_once(__DIR__.'/config/Autoload.php');
|
||||||
|
Autoload::charger();
|
||||||
|
|
||||||
|
//$oraDb = new OracleDb;
|
||||||
|
$cont = new Controleur();
|
||||||
|
//phpinfo();*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,75 @@
|
|||||||
|
<?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 QCM
|
||||||
|
*
|
||||||
|
* @author Mehdi
|
||||||
|
*/
|
||||||
|
class QCM {
|
||||||
|
private $num;
|
||||||
|
private $nom;
|
||||||
|
private $type;
|
||||||
|
private $questions = array();
|
||||||
|
private $introduction;
|
||||||
|
|
||||||
|
function __construct($numQuestion,$nom,$type,$questions,$introduction){
|
||||||
|
$this->num = $numQuestion;
|
||||||
|
$this->nom = $nom;
|
||||||
|
$this->type = $type;
|
||||||
|
$this->questions = $questions;
|
||||||
|
$this->introduction = $introduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
|
||||||
|
function getNum() {
|
||||||
|
return $this->num;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNom() {
|
||||||
|
return $this->nom;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getType() {
|
||||||
|
return $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getQuestions() {
|
||||||
|
return $this->questions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getIntroduction() {
|
||||||
|
return $this->introduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
function setIntroduction($introduction) {
|
||||||
|
$this->introduction = $introduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setNum($num) {
|
||||||
|
$this->num = $num;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNom($nom) {
|
||||||
|
$this->nom = $nom;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setType($type) {
|
||||||
|
$this->type = $type;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setQuestions($questions) {
|
||||||
|
$this->questions = $questions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Question {
|
||||||
|
|
||||||
|
private $numQuestion;
|
||||||
|
private $question;
|
||||||
|
private $reponse;
|
||||||
|
private $numTp;
|
||||||
|
|
||||||
|
function __construct($numTp,$numQuestion,$question,$reponse){
|
||||||
|
$this->numQuestion = $numQuestion;
|
||||||
|
$this->question = $question;
|
||||||
|
$this->reponse = $reponse;
|
||||||
|
$this->numTp = $numTp ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
function getNumQuestion() {
|
||||||
|
return $this->numQuestion;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getQuestion() {
|
||||||
|
return $this->question;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReponse() {
|
||||||
|
return $this->reponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNumTp() {
|
||||||
|
return $this->numTp;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
function setNumQuestion($numQuestion) {
|
||||||
|
$this->numQuestion = $numQuestion;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setQuestion($question) {
|
||||||
|
$this->question = $question;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setReponse($reponse) {
|
||||||
|
$this->reponse = $reponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
<?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 QuestionNote
|
||||||
|
*
|
||||||
|
* @author Mehdi
|
||||||
|
*/
|
||||||
|
class QuestionNote extends Question {
|
||||||
|
private $bareme;
|
||||||
|
|
||||||
|
function __construct($numTp, $numQuestion, $question, $reponse,$bareme) {
|
||||||
|
parent::__construct($numTp, $numQuestion, $question, $reponse);
|
||||||
|
$this->bareme = $bareme;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBareme(){
|
||||||
|
return $this->bareme;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class QuestionQCM {
|
||||||
|
|
||||||
|
|
||||||
|
private $numQuestion;
|
||||||
|
private $question;
|
||||||
|
private $bareme;
|
||||||
|
private $reponse = array();
|
||||||
|
|
||||||
|
function __construct($numQuestion,$question,$reponse,$bareme){
|
||||||
|
$this->numQuestion = $numQuestion;
|
||||||
|
$this->question = $question;
|
||||||
|
$this->reponse = $reponse;
|
||||||
|
$this->bareme= $bareme;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
function getNumQuestion() {
|
||||||
|
return $this->numQuestion;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getQuestion() {
|
||||||
|
return $this->question;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReponse() {
|
||||||
|
return $this->reponse;
|
||||||
|
}
|
||||||
|
function getBareme() {
|
||||||
|
return $this->bareme;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
function setNumQuestion($numQuestion) {
|
||||||
|
$this->numQuestion = $numQuestion;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setQuestion($question) {
|
||||||
|
$this->question = $question;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setReponse($reponse) {
|
||||||
|
$this->reponse = $reponse;
|
||||||
|
}
|
||||||
|
function setBareme($bareme) {
|
||||||
|
$this->bareme = $bareme;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class Modele {
|
||||||
|
|
||||||
|
function afficherQuestions(){
|
||||||
|
$db = new SqliteDb();
|
||||||
|
//$db->createTable();
|
||||||
|
$qg = new QuestionsGateway($db);
|
||||||
|
|
||||||
|
$tabQuestions = $qg->afficherQuestions();
|
||||||
|
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);
|
||||||
|
if(!password_verify($mdp, $vraiMdp)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
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
|
||||||
|
index.file=index.php
|
||||||
|
run.as=LOCAL
|
||||||
|
url=http://localhost/BddCorrect/
|
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
|
<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/Traitement/ModificationQCM.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/metier/QuestionQCM.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/BDD/SqliteDb.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/Traitement/Export.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/vues/vueAjoutQCM.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/Traitement/AjoutQCM.php</file>
|
||||||
|
<file>file:/C:/xampp/htdocs/BddCorrect/Traitement/CorrectionQCM.php</file>
|
||||||
|
</group>
|
||||||
|
</open-files>
|
||||||
|
</project-private>
|
@ -0,0 +1,7 @@
|
|||||||
|
include.path=${php.global.include.path}
|
||||||
|
php.version=PHP_70
|
||||||
|
source.encoding=UTF-8
|
||||||
|
src.dir=.
|
||||||
|
tags.asp=false
|
||||||
|
tags.short=false
|
||||||
|
web.root=.
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.php.project</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||||
|
<name>BddCorrect</name>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
@ -0,0 +1,30 @@
|
|||||||
|
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 />
|
||||||
|
<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 />
|
||||||
|
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 : 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
|
@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"><style><?php global $rep,$vues,$css; include $rep.$css['bootstrap']; ?></style>
|
||||||
|
<title></title>
|
||||||
|
<script src="css/jquery-3.5.1.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/VueAccueil.css">
|
||||||
|
</head>
|
||||||
|
<body id="vuep">
|
||||||
|
<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">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>
|
||||||
|
</nav>
|
||||||
|
<header class="bg-primary text-white">
|
||||||
|
<div class="container text-center">
|
||||||
|
|
||||||
|
<p class="lead"></p>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div id='allp'>
|
||||||
|
|
||||||
|
<form method="get" role="form">
|
||||||
|
<input class="bouton" type="submit" name="action" value="Demonstrations de cours" ><br/>
|
||||||
|
<input class="bouton" type="submit" name="action" value="QCM" ><br/>
|
||||||
|
<input class="bouton" type="submit" name="action" value="TP"><br/>
|
||||||
|
<input class="bouton adm" type="submit" name="action" value="Creation de table"><br/>
|
||||||
|
<input class="bouton adm" type="submit" name="action" value="Gestion de tables"><br/>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="text" id="verif-ad" value="<?php echo $_SESSION['typeSession'];?>" hidden/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer
|
||||||
|
<footer class="py-5 bg-dark">
|
||||||
|
<div class="container">
|
||||||
|
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
var ad = $('#verif-ad').val();
|
||||||
|
|
||||||
|
if(ad == 'LJLf1')
|
||||||
|
$( ".adm").show();
|
||||||
|
else $( ".adm").remove();
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
@ -0,0 +1,198 @@
|
|||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
<script src="css/jquery-3.5.1.js"></script>
|
||||||
|
<link rel="stylesheet" href="css/VueAdmin.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form style="border:1px solid #ccc" method="GET" action="../Traitement/AjoutQuestion.php">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Ajouter une question</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<label><b>TP n° : </b></label>
|
||||||
|
<input type="text" placeholder="Numéro du TP" id="tp" name='tp' required>
|
||||||
|
|
||||||
|
<label><b>Barème : </b></label>
|
||||||
|
<input type="text" placeholder="Barème..." id="points" required>
|
||||||
|
|
||||||
|
<label><b>Consigne : </b></label>
|
||||||
|
<textarea placeholder="Ecrire la consigne..." id="consigne" required></textarea>
|
||||||
|
|
||||||
|
<label><b>Réponse : </b></label>
|
||||||
|
<textarea placeholder="SELECT ..." id="reponse" required></textarea> <br/><br/>
|
||||||
|
|
||||||
|
<input class="executerReponse" type="button" value="Exécuter" onclick="ExecuterReponse();" > <br/><br/>
|
||||||
|
<div id="execute">
|
||||||
|
|
||||||
|
</div> <div><br/><br/><br/></div>
|
||||||
|
|
||||||
|
<label><b>Verification avec BDD aléatoire? </b><br/>
|
||||||
|
<input type="radio" name="aleatoire" value="o" style="margin-bottom:15px" checked> oui
|
||||||
|
<input type="radio" name="aleatoire" value="n" style="margin-bottom:15px"> non
|
||||||
|
</label><br/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div >
|
||||||
|
<input type="button" value="Ajouter" onclick="SubmitAjoutQuestion()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="erreur">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get" id="frm-demo">
|
||||||
|
<input id="inp-demo" class="bouton" type="submit" name="action" value="Afficher les questions" >
|
||||||
|
</form><br/>
|
||||||
|
|
||||||
|
<input type="file" id="fileInput"> <br/>
|
||||||
|
<label>Requête sous forme : <strong> type(requete\fonction)**NBA**NumeroDeQuestion**Consigne**requete(SELECT...)**barème**verificationAvecBddAleatoire(o\n)**fonction(create function ...) -optionnel</strong> </label>
|
||||||
|
<p> Tous les noms de table doivent être en majuscule</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('input[type="radio"]').click(function() {
|
||||||
|
if($(this).attr('id') == 'btn-fonction') {
|
||||||
|
$('#show-me').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
$('#show-me').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function ExecuterReponse() {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
var tx = $('#reponse').val() ;
|
||||||
|
var txt = tx.replace(/^\s+/g, "");
|
||||||
|
|
||||||
|
txt = txt.trim();
|
||||||
|
|
||||||
|
if(!(txt.toUpperCase().includes('CREATE') && txt.toUpperCase().includes('FUNCTION'))) {
|
||||||
|
if (txt.charAt(txt.length - 1) == ';') {
|
||||||
|
txt = txt.substr(0, txt.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.get("Traitement/AffichageDemo.php", { textbox: txt},
|
||||||
|
function(data) {
|
||||||
|
$('#execute').empty();
|
||||||
|
setTimeout( function(){ $('#execute').html(data); } , 400 );
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function SubmitAjoutQuestion(mot = 0) {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
$('#erreur').empty();
|
||||||
|
wait(1500);
|
||||||
|
|
||||||
|
if(mot == 0){
|
||||||
|
var tp = $('#tp').val() ;
|
||||||
|
var points = $('#points').val() ;
|
||||||
|
var consigne = $('#consigne').val() ;
|
||||||
|
var reponse = $('#reponse').val() ;
|
||||||
|
var type = $("input[name='type']:checked").val();
|
||||||
|
var type = 'requete';
|
||||||
|
var aleatoire= $("input[name='aleatoire']:checked").val();
|
||||||
|
//var bdd = $("input[name='bdd']:checked").val();
|
||||||
|
var bdd = 'NBA';
|
||||||
|
var fonction = $('#fonction').val() ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var type = mot[0];
|
||||||
|
var bdd = mot[1];
|
||||||
|
var tp = mot[2];
|
||||||
|
var consigne = mot[3];
|
||||||
|
var reponse = mot[4];
|
||||||
|
var points = mot[5];
|
||||||
|
var aleatoire = mot[6];
|
||||||
|
var fonction = mot[7];
|
||||||
|
if(fonction != null){
|
||||||
|
//alert(type+'-'+bdd+'-'+tp+'-'+num+'-'+consigne+'-'+reponse+'-'+points+'-'+aleatoire+'-'+fonction);
|
||||||
|
//alert()
|
||||||
|
//alert('ok');
|
||||||
|
}
|
||||||
|
//else alert(type+'-'+bdd+'-'+tp+'-'+num+'-'+consigne+'-'+reponse+'-'+points+'-'+aleatoire);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var tx = reponse;
|
||||||
|
var txt = tx.replace(/^\s+/g, "");
|
||||||
|
|
||||||
|
txt = txt.trim();
|
||||||
|
|
||||||
|
if(!(txt.toUpperCase().includes('CREATE') && txt.toUpperCase().includes('FUNCTION'))) {
|
||||||
|
if (txt.charAt(txt.length - 1) == ';') {
|
||||||
|
txt = txt.substr(0, txt.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reponse = txt;
|
||||||
|
$.get("Traitement/AjoutQuestion.php", { tp: tp,points: points,consigne: consigne,reponse: reponse,type: type,aleatoire: aleatoire,bdd: bdd, fonction : fonction},
|
||||||
|
function(data) {
|
||||||
|
if(mot != 0){
|
||||||
|
$('#erreur').append('<div class="err">'+data+'</div>');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#erreur').empty();
|
||||||
|
setTimeout( function(){ $('#erreur').html(data); } , 400 );
|
||||||
|
}
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function wait(ms){
|
||||||
|
var start = new Date().getTime();
|
||||||
|
var end = start;
|
||||||
|
while(end < start + ms) {
|
||||||
|
end = new Date().getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileInput = document.getElementById('fileInput');
|
||||||
|
var fileDisplayArea = document.getElementById('fileDisplayArea');
|
||||||
|
var mot = [];
|
||||||
|
fileInput.addEventListener('change', function(e) {
|
||||||
|
var file = fileInput.files[0];
|
||||||
|
var textType = /text.*/;
|
||||||
|
|
||||||
|
if (file.type.match(textType)) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = function(e) {
|
||||||
|
var content = reader.result;
|
||||||
|
//Here the content has been read successfuly
|
||||||
|
//alert(content);
|
||||||
|
|
||||||
|
var lignes = content.split('\n');
|
||||||
|
for(var line = 0; line < lignes.length; line++){
|
||||||
|
var mot = lignes[line].split('**');
|
||||||
|
if (mot != "") SubmitAjoutQuestion(mot);
|
||||||
|
//mots.push(mot);
|
||||||
|
|
||||||
|
console.log(mot[0]);console.log(mot[1]);console.log(mot[2]);console.log(mot[3]);
|
||||||
|
}
|
||||||
|
//$('#inp-questions').trigger("click");
|
||||||
|
}
|
||||||
|
|
||||||
|
reader.readAsText(file);
|
||||||
|
} else {
|
||||||
|
fileDisplayArea.innerText = "fichier non supporté"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
@ -0,0 +1,120 @@
|
|||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
<script src="css/jquery-3.5.1.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/VueAdmin.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form style="border:1px solid #ccc" method="GET" action="Traitement/AjoutQuestion.php">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Ajouter une Démonstration</h1>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<label><b>Chapitre n° : </b></label>
|
||||||
|
<input type="text" placeholder="Numéro du chapitre" id="chapitre" name='chapitre' required>
|
||||||
|
|
||||||
|
<label><b>Description : </b></label>
|
||||||
|
<textarea placeholder="Ecrire l'intitulé de la démonstration..." id="description" required></textarea>
|
||||||
|
|
||||||
|
<label><b>Réponse : </b></label>
|
||||||
|
<textarea placeholder="SELECT ..." id="reponse" required></textarea>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<input type="button" value="Ajouter" onclick="SubmitAjoutDemo()" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="erreur">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="get" id="frm-demo">
|
||||||
|
<input id="inp-demo" class="bouton" type="submit" name="action" value="Afficher les demonstrations" >
|
||||||
|
</form><br/>
|
||||||
|
|
||||||
|
<input type="file" id="fileInput"><br/>
|
||||||
|
<div>Format : <strong>NBA**numéro de chapitre**description**requete</strong></div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function SubmitAjoutDemo(mot=0) {
|
||||||
|
|
||||||
|
//err = jQuery('<p class')
|
||||||
|
if(mot == 0){
|
||||||
|
var chapitre = $('#chapitre').val() ;
|
||||||
|
var description = $('#description').val() ;
|
||||||
|
var reponse = $('#reponse').val() ;
|
||||||
|
//var bdd = $("input[name='bdd']:checked").val();
|
||||||
|
var bdd ='NBA';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var bdd =mot[0];
|
||||||
|
var chapitre = mot[1];
|
||||||
|
var description = mot[2];
|
||||||
|
var reponse = mot[3];
|
||||||
|
}
|
||||||
|
$.get("Traitement/AjoutDemonstration.php", { chapitre: chapitre,description: description,reponse: reponse,bdd: bdd},
|
||||||
|
function(data) {
|
||||||
|
if(mot != 0){
|
||||||
|
|
||||||
|
$('#erreur').append('<div class="err">'+data+'</div>');
|
||||||
|
//$('.err').html(data);
|
||||||
|
/*var result = confirm("La demonstration a été ajoutée. Afficher les Demonstrations ?");
|
||||||
|
if(result) $('#inp-demo').trigger("click"); */
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#erreur').empty();
|
||||||
|
setTimeout( function(){ $('#erreur').html(data); } , 400 );
|
||||||
|
}
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var fileInput = document.getElementById('fileInput');
|
||||||
|
var fileDisplayArea = document.getElementById('fileDisplayArea');
|
||||||
|
fileInput.addEventListener('change', function(e) {
|
||||||
|
var file = fileInput.files[0];
|
||||||
|
var textType = /text.*/;
|
||||||
|
|
||||||
|
if (file.type.match(textType)) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = function(e) {
|
||||||
|
var content = reader.result;
|
||||||
|
//Here the content has been read successfuly
|
||||||
|
//alert(content);
|
||||||
|
|
||||||
|
var lignes = content.split('\n');
|
||||||
|
for(var line = 0; line < lignes.length; line++){
|
||||||
|
var mot = lignes[line].split('**');
|
||||||
|
if (mot != "")
|
||||||
|
SubmitAjoutDemo(mot);
|
||||||
|
//mots.push(mot);
|
||||||
|
|
||||||
|
//console.log(mot[0]);console.log(mot[1]);console.log(mot[2]);console.log(mot[3]);
|
||||||
|
}
|
||||||
|
//$('#inp-demo').trigger("click");
|
||||||
|
}
|
||||||
|
|
||||||
|
reader.readAsText(file);
|
||||||
|
} else {
|
||||||
|
fileDisplayArea.innerText = "fichier non supporté"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
@ -0,0 +1,219 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
<script src="css/jquery-3.5.1.js"></script>
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="css/VueDemonstration.css">
|
||||||
|
</head>
|
||||||
|
<?php
|
||||||
|
$tp_str = implode(",", array_keys($dVueDemonstrations));
|
||||||
|
//die($tp_str);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<body id="vued">
|
||||||
|
<input type="text" id='tp_keys' value="<?php echo $tp_str; ?>" hidden>
|
||||||
|
<div id="content">
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" id="mainNav">
|
||||||
|
<div class="container">
|
||||||
|
<a class="navbar-brand js-scroll-trigger" href="#page-top" onclick="scrollToTop">Base De Données</a>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||||
|
<ul class="navbar-nav ml-auto">
|
||||||
|
<?php foreach ($dVueDemonstrations as $tp => $question){ ?>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a style = "text-transform:uppercase;" class="nav-link js-scroll-trigger" id="<?php echo $tp; ?>" onclick="changerSection('<?php echo $tp;?>','<?php echo $tp_str ;?>')" ><?php echo $tp; ?></a>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<header class="bg-primary text-white">
|
||||||
|
<div class="container text-center">
|
||||||
|
<h1>Demonstrations</h1>
|
||||||
|
<p class="lead"></p>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<form method="get" class="adm">
|
||||||
|
<input id="btn-ajout1" type="submit" name="action" value="Ajouter une demonstration" />
|
||||||
|
<input id="inp-ret1" type="submit" name="action" value="Retour au menu principal" >
|
||||||
|
</form>
|
||||||
|
<?php foreach ($dVueDemonstrations as $tp => $questions){ ?>
|
||||||
|
|
||||||
|
<section id="<?php echo 'c'.$tp; ?>">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-8 mx-auto">
|
||||||
|
<h2 style = "text-transform:uppercase;"><?php echo $tp; ?></h2>
|
||||||
|
|
||||||
|
<form class="demoForm" method="get" >
|
||||||
|
<?php $i=0;
|
||||||
|
foreach ($questions as $q) {
|
||||||
|
?>
|
||||||
|
<?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
|
||||||
|
<textarea rows="5" cols="70" name="demo<?php echo $q->getNumQuestion(); ?>" id="demo<?php echo $q->getNumQuestion().$q->getNumTp(); ?>" >
|
||||||
|
<?php echo $q->getReponse(); ?>
|
||||||
|
</textarea>
|
||||||
|
<p>
|
||||||
|
<input class="submitDemoData" type="button" value="Exécuter" onclick="SubmitDemoData(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" >
|
||||||
|
<span id="inp-centre"> <input class="modifierDemonstration adm" type="button" value="Modifier" onclick="ModifierDemonstration(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" >
|
||||||
|
<input class="supprimerDemonstration adm" type="button" value="Supprimer" onclick="SupprimerDemonstration(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" ></span>
|
||||||
|
<span id="inp-gauche"><input class="monterDemonstration adm" type="button" value="Monter" onclick="MonterDemonstration(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" >
|
||||||
|
<input class="descendreDemonstration adm" type="button" value="Descendre" onclick="DescendreDemonstration(<?php echo sizeof($questions); ?>,<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" ></span>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div id="results<?php echo $q->getNumQuestion().$q->getNumTp(); ?>">
|
||||||
|
<!-- les résultats s'affichent içi -->
|
||||||
|
</div><br/>
|
||||||
|
<?php $i++; } //fin foreach ?>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section> <?php } ?>
|
||||||
|
<!-- <form method="get" id="frm-reset">
|
||||||
|
<input type="submit" name="action" id="regenererDemo" value="Reintiliser les demonstrations" /><br/>
|
||||||
|
</form>-->
|
||||||
|
|
||||||
|
<form method="get" class="adm">
|
||||||
|
<input id="btn-ajout" type="submit" name="action" value="Ajouter une demonstration" />
|
||||||
|
<input id="inp-ret" type="submit" name="action" value="Retour au menu principal" >
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="get" role="form">
|
||||||
|
<input type="submit" name="action" id="afficher-demo" value="Afficher les demonstrations" style='display:none'>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form id="frm-export" class="adm">
|
||||||
|
<input type="button" value="Exporter" onclick="ExporterDemonstrations()" />
|
||||||
|
</form>
|
||||||
|
<input type="text" id="verif-ad" value="<?php echo $_SESSION['typeSession'];?>" hidden/>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function scrollToTop() {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
var ad = $('#verif-ad').val();
|
||||||
|
|
||||||
|
if(ad == 'LJLf1')
|
||||||
|
$( ".adm").show();
|
||||||
|
else $( ".adm").remove();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function SubmitDemoData(numQuestion,numChapitre) {
|
||||||
|
//document.write($('#demo'+numQuestion).val());
|
||||||
|
var txt = $('#demo'+numQuestion+numChapitre).val() ;
|
||||||
|
$.get("Traitement/AffichageDemo.php", { textbox: txt},
|
||||||
|
function(data) {
|
||||||
|
$('#results'+numQuestion+numChapitre).html(data);
|
||||||
|
//$('#demoForm')[0].reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function MonterDemonstration(numDemo, numChapitre) {
|
||||||
|
if(numDemo > 1){
|
||||||
|
$.get("Traitement/OrdreDemo.php", { numDemo : numDemo, numChapitre : numChapitre },
|
||||||
|
function(data) {
|
||||||
|
|
||||||
|
//$('#questionsForm')[0].reset();
|
||||||
|
//$('#erreur').html(data);
|
||||||
|
$("#afficher-demo").trigger("click");
|
||||||
|
//window.location.replace("index.php");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function DescendreDemonstration(nbQuestions,numQuestion, numTp) {
|
||||||
|
//alert(nbQuestions);
|
||||||
|
|
||||||
|
var des = 1;
|
||||||
|
if(numQuestion < nbQuestions){
|
||||||
|
$.get("Traitement/OrdreDemo.php", { des : des , numDemo : numQuestion, numChapitre : numTp },
|
||||||
|
function(data) {
|
||||||
|
|
||||||
|
//$('#questionsForm')[0].reset();
|
||||||
|
$("#afficher-demo").trigger("click");
|
||||||
|
//window.location.replace("index.php");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function SupprimerDemonstration(numDemo,numChapitre) {
|
||||||
|
var result = confirm("Êtes-vous sûr de vouloir supprimer la démonstration "+numDemo+" du chapitre "+numChapitre+" ?");
|
||||||
|
if(result){
|
||||||
|
var type = "demo";
|
||||||
|
$.get("Traitement/Suppression.php", { numChapitre : numChapitre, numDemo : numDemo,demo : type},
|
||||||
|
function(data) {
|
||||||
|
//$('#results'+numDemo+numChapitre).html(data);
|
||||||
|
//$('#questionsForm')[0].reset();
|
||||||
|
$("#afficher-demo").trigger("click");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*$(document).ready(function() {
|
||||||
|
var tps = $('#tp_keys').val();
|
||||||
|
var i = 0;
|
||||||
|
tpk = tps.split(",");
|
||||||
|
tpk.forEach(function(entry) {
|
||||||
|
if(i==0) $("#c"+entry).show();
|
||||||
|
else $("#c"+entry).hide();
|
||||||
|
i++;
|
||||||
|
console.log(entry);
|
||||||
|
});
|
||||||
|
});*/
|
||||||
|
function changerSection(tp,keys){
|
||||||
|
|
||||||
|
tpk = keys.split(",");
|
||||||
|
tpk.forEach(function(entry) {
|
||||||
|
$("#c"+entry).hide();
|
||||||
|
console.log(entry);
|
||||||
|
});
|
||||||
|
$("#c"+tp).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ModifierDemonstration(numDemo, numChapitre) {
|
||||||
|
$.get("Traitement/ModificationDemonstration.php", { numDemo : numDemo, numChapitre : numChapitre },
|
||||||
|
function(data) {
|
||||||
|
$('#vued').empty();
|
||||||
|
$('#vued').html(data);
|
||||||
|
//$('#questionsForm')[0].reset();
|
||||||
|
//location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function ExporterDemonstrations(){
|
||||||
|
type = 'demo';
|
||||||
|
$.get("Traitement/Export.php", { type:type}, function(data) {
|
||||||
|
alert(data+"Les Demonstrations ont été exportées vers ;/var/www/html/Methodologie/imports/demonstration/demo_exportes.txt");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('scroll',function() {
|
||||||
|
localStorage.setItem('scrollPosition',window.scrollY);
|
||||||
|
},false);
|
||||||
|
window.addEventListener('load',function() {
|
||||||
|
if(localStorage.getItem('scrollPosition') !== null)
|
||||||
|
window.scrollTo(0, localStorage.getItem('scrollPosition'));
|
||||||
|
},false);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<!-- Footer -->
|
||||||
|
<footer class="py-5 bg-dark">
|
||||||
|
<div class="container">
|
||||||
|
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,134 @@
|
|||||||
|
<!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;
|
||||||
|
|
||||||
|
foreach ($dVueQuestions 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 (isset($_SESSION['fi'][$i]) ? $_SESSION['fi'][$i] : '') ?>
|
||||||
|
</textarea>
|
||||||
|
<input>
|
||||||
|
<strong>TEST</strong>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php } //fin foreach ?>
|
||||||
|
<p><input type="submit" ></p>
|
||||||
|
|
||||||
|
|
||||||
|
</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>
|
||||||
|
|
||||||
|
|
||||||
|
<?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 type="text/javascript">
|
||||||
|
var tempsMin =50 ;
|
||||||
|
var total_secondes =60*tempsMin;
|
||||||
|
tempsMin = parseInt(total_secondes/60);
|
||||||
|
secondes = parseInt(total_secondes%60);
|
||||||
|
document.getElementById("Temps-Restant").innerHTML='Temps restant: ' + tempsMin + ' minutes ' + secondes + ' secondes';
|
||||||
|
function init(){
|
||||||
|
document.getElementById("Temps-Restant").innerHTML='Temps restant: ' + tempsMin + ' minutes ' + secondes + ' secondes';
|
||||||
|
setTimeout("TempsRestant()",999);
|
||||||
|
}
|
||||||
|
function TempsRestant(){
|
||||||
|
document.getElementById("Temps-Restant").innerHTML='Temps restant: ' + tempsMin + ' minutes ' + secondes + ' secondes' ;
|
||||||
|
if(total_secondes <=0){
|
||||||
|
setTimeout('document.Exam.submit()',1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
total_secondes = total_secondes -1;
|
||||||
|
tempsMin = parseInt(total_secondes/60);
|
||||||
|
secondes = parseInt(total_secondes%60);
|
||||||
|
setTimeout("TempsRestant()",999);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
init();
|
||||||
|
</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>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue