parent
1e3f3a7ce0
commit
494d036377
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once('SqliteDb.php');
|
||||
require_once('OracleDb.php');
|
||||
header('Content-type: text/plain');
|
||||
$db = new SqliteDb();
|
||||
|
||||
//$conn = oci_connect('u_prems', '123456','localhost/orcl');
|
||||
$conn = oci_connect('meelaichao', 'meelaichao', 'kirov:1521/kirov');
|
||||
|
||||
$textbox = $_POST['textbox'];
|
||||
|
||||
$UserQuery = oci_parse($conn, $textbox);
|
||||
$reponseUser = oci_execute($UserQuery);
|
||||
$numLigne = 0;
|
||||
while( ($oracleRow = oci_fetch_array($UserQuery, OCI_NUM))) {
|
||||
$numLigne++;
|
||||
echo '<strong> Ligne '.$numLigne.' : </strong>';
|
||||
for($i=0 ; $i< sizeof($oracleRow) ; $i++){
|
||||
echo $oracleRow[$i].' ; ';
|
||||
}
|
||||
echo '</br>';
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
//require_once ('Question.php');
|
||||
class QCMGateway {
|
||||
private $db;
|
||||
|
||||
|
||||
function __construct(SqliteDb $db) {
|
||||
$this->db=$db;
|
||||
}
|
||||
|
||||
public function afficherQCM() {
|
||||
$i = 0;
|
||||
$query = 'SELECT * FROM QcmQuestion';
|
||||
$query = $this->db->prepare($query);
|
||||
$result = $query->execute();
|
||||
$tabReponses =array();
|
||||
$tabQuestions = array();
|
||||
//$resultats = $this->db->query('SELECT found_rows()');
|
||||
while($q = $result->fetchArray()){
|
||||
$i= $i+1;
|
||||
$reponseQuery = 'SELECT * FROM QcmReponse WHERE numQuestion=?';
|
||||
$stmt = $this->db->prepare($reponseQuery);
|
||||
$stmt->bindParam(1, $q['numQuestion']);
|
||||
$reponseResult = $stmt->execute();
|
||||
$i=0;
|
||||
while ($r = $reponseResult->fetchArray()){
|
||||
|
||||
$i++;
|
||||
$tabReponses[] = new ReponseQCM($r['numReponse'], $r['reponse'], $r['numQuestion']) ;
|
||||
|
||||
}
|
||||
//die(print_r($i, true ));
|
||||
$tabQuestions[] = new QCM($q['numQuestion'],$q['question'],$tabReponses);
|
||||
}
|
||||
//die(print_r($tabQuestions, true ));
|
||||
return $tabQuestions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of ValidationQCM
|
||||
*
|
||||
* @author Mehdi
|
||||
*/
|
||||
class ValidationQCM {
|
||||
//put your code here
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
class QCM {
|
||||
|
||||
private $numQuestion;
|
||||
private $question;
|
||||
private $reponse = array();
|
||||
|
||||
function __construct($numQuestion,$question,$reponse){
|
||||
$this->numQuestion = $numQuestion;
|
||||
$this->question = $question;
|
||||
$this->reponse = $reponse;
|
||||
}
|
||||
|
||||
// Getters
|
||||
function getNumQuestion() {
|
||||
return $this->numQuestion;
|
||||
}
|
||||
|
||||
function getQuestion() {
|
||||
return $this->question;
|
||||
}
|
||||
|
||||
function getReponse() {
|
||||
return $this->reponse;
|
||||
}
|
||||
|
||||
// Setters
|
||||
function setNumQuestion($numQuestion) {
|
||||
$this->numQuestion = $numQuestion;
|
||||
}
|
||||
|
||||
function setQuestion($question) {
|
||||
$this->question = $question;
|
||||
}
|
||||
|
||||
function setReponse($reponse) {
|
||||
$this->reponse = $reponse;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
class ReponseQCM {
|
||||
|
||||
private $numReponse;
|
||||
private $reponse;
|
||||
private $numQuestion;
|
||||
|
||||
function __construct($numReponse,$reponse,$numQuestion){
|
||||
$this->numReponse = $numReponse;
|
||||
$this->reponse = $reponse;
|
||||
$this->numQuestion = $numQuestion;
|
||||
}
|
||||
|
||||
function getNumReponse() {
|
||||
return $this->numReponse;
|
||||
}
|
||||
|
||||
function getReponse() {
|
||||
|
||||
return $this->reponse;
|
||||
}
|
||||
|
||||
function getNumQuestion() {
|
||||
return $this->numQuestion;
|
||||
}
|
||||
|
||||
public function __toString(){
|
||||
$output = ''.$this->getReponse();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/VuePrincipale.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
|
||||
<div class="container">
|
||||
<a class="navbar-brand js-scroll-trigger" href="#page-top">TP de Base De Données</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP2">TP2</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP3">TP3</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP4">TP4</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP5">TP5</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<header class="bg-primary text-white">
|
||||
<div class="container text-center">
|
||||
<h1>Demonstrations</h1>
|
||||
<p class="lead">TEST</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div style="font-weight: bold" id="Temps-Restant"></div>
|
||||
|
||||
<section id="TP2">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<h2>TP 2</h2>
|
||||
|
||||
<form id="myForm" method="post" name="Exam" >
|
||||
<?php $i=0; //shuffle($dVueQuestions);
|
||||
$nbQ=1;
|
||||
foreach ($dVueDemonstrations as $q) {
|
||||
?>
|
||||
<p><?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
|
||||
<textarea rows="5" cols="70" name="textbox<?php echo $q->getNumQuestion(); ?>" id="textbox<?php echo $q->getNumQuestion(); ?>" >
|
||||
<?php echo $q->getReponse(); ?>
|
||||
</textarea>
|
||||
<p><input class="submitFormData" type="button" value="Exécuter" onclick="SubmitFormData(<?php echo $q->getNumQuestion(); ?>);" ></p>
|
||||
</p>
|
||||
<div id="results<?php echo $q->getNumQuestion(); ?>">
|
||||
<!-- les résultats s'affichent içi -->
|
||||
</div><br/>
|
||||
<?php $i++; $nbQ++; } //fin foreach ?>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<form method="post" class="frm">
|
||||
<input type="submit" name="test" id="test" value="Générer Base de données aléatoire" /><br/>
|
||||
<input type="submit" name="regenerer" id="test" value="Réintiliser les questions" /><br/>
|
||||
</form>
|
||||
<a href="vues/VueAdmin.php"><button>Ajouter Une Question</button></a>
|
||||
<a href="vues/VueLibre.php"><button>Creation table</button></a>
|
||||
<a href="vues/VueSupression.php"><button>vue suppression</button></a>
|
||||
|
||||
<form method="post" role="form">
|
||||
<input type="submit" name="action" value="Afficher les questions" /><br/>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if(array_key_exists('test',$_POST)){
|
||||
$oraDb = new OracleDb;
|
||||
}
|
||||
if(array_key_exists('regenerer',$_POST)){
|
||||
$db = new SqliteDb();
|
||||
$db->createTable();
|
||||
$URL="index.php";
|
||||
echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<script>
|
||||
function SubmitFormData(numQuestion) {
|
||||
var l= [];
|
||||
//document.write($('#textbox'+numQuestion).val());
|
||||
var txt = $('#textbox'+numQuestion).val() ;
|
||||
/*$('textarea[name^="textbox"]').each(function() {
|
||||
l.push($(this).val());
|
||||
});*/
|
||||
$.post("AffichageDemo.php", { textbox: txt},
|
||||
function(data) {
|
||||
$('#results'+numQuestion).html(data);
|
||||
$('#myForm')[0].reset();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- Footer -->
|
||||
<footer class="py-5 bg-dark">
|
||||
<div class="container">
|
||||
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap core JavaScript -->
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Plugin JavaScript -->
|
||||
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
|
||||
|
||||
<!-- Custom JavaScript for this theme -->
|
||||
<script src="js/scrolling-nav.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/VuePrincipale.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
|
||||
<div class="container">
|
||||
<a class="navbar-brand js-scroll-trigger" href="#page-top">TP de Base De Données</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarResponsive">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP2">TP2</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP3">TP3</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP4">TP4</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-scroll-trigger" href="#TP5">TP5</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<header class="bg-primary text-white">
|
||||
<div class="container text-center">
|
||||
<h1>test</h1>
|
||||
<p class="lead">TEST</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div style="font-weight: bold" id="Temps-Restant"></div>
|
||||
|
||||
<section id="TP2">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<h2>TP 2</h2>
|
||||
|
||||
<form method="post" action="Correcteur.php" name="Exam">
|
||||
<?php $i=0; //shuffle($dVueQuestions);
|
||||
$nbQ=1;
|
||||
foreach ($tabQCM as $qcm) {
|
||||
?>
|
||||
<p><?php $i++; echo $qcm->getNumQuestion() .'.'.$qcm->getQuestion(); ?> <br/>
|
||||
<?php
|
||||
foreach ($qcm->getReponse() as $r ) { ?>
|
||||
|
||||
<input type="radio" name="<?php echo $qcm->getQuestion();?>" value="<?php echo $r->getReponse();?>" style="margin-bottom:15px"> <?php echo $r->getNumReponse().'.'.$r->getReponse(); ?> <br/>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</p>
|
||||
|
||||
<?php $i++; $nbQ++; } //fin foreach ?>
|
||||
<p><input type="submit" ></p>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<a href="vues/VueAdmin.php"><button>Ajouter Une Question</button></a>
|
||||
<a href="vues/VueLibre.php"><button>Creation table</button></a>
|
||||
<a href="vues/VueSupression.php"><button>vue suppression</button></a>
|
||||
|
||||
<form method="post" role="form">
|
||||
<input type="submit" name="action" value="Afficher les demonstrations" ><br/>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-5 bg-dark">
|
||||
<div class="container">
|
||||
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap core JavaScript -->
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Plugin JavaScript -->
|
||||
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
|
||||
|
||||
<!-- Custom JavaScript for this theme -->
|
||||
<script src="js/scrolling-nav.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue