You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
205 lines
8.9 KiB
205 lines
8.9 KiB
<!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/VuePrincipale.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">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 id='allp'>
|
|
<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="questionsForm" method="get" name="Exam">
|
|
<?php $i=0; //shuffle($dVueQuestions);
|
|
foreach ($dVueQuestions as $q) {
|
|
/*if($nbQ > $_SESSION['nbQuestions'])
|
|
break; */ ?>
|
|
<p><?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
|
|
<textarea name="question<?php echo $q->getNumQuestion(); ?>" id="question<?php echo $q->getNumQuestion(); ?>" rows="5" cols="70">
|
|
<?php echo (isset($_SESSION['fi'][$i]) ? $_SESSION['fi'][$i] : '') ?>
|
|
</textarea>
|
|
<p><input class="submitQuestionData" type="button" value="Valider" onclick="SubmitQuestionData(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" >
|
|
<input class="supprimerQuestion" type="button" value="Supprimer" onclick="SupprimerQuestion(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" >
|
|
<input class="modifierQuestion" type="button" value="Modifier" onclick="ModifierQuestion(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" >
|
|
<input class="monterQuestion" type="button" value="Monter" onclick="MonterQuestion(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" ></p>
|
|
</p>
|
|
<div id="resultatsQuestions<?php echo $q->getNumQuestion(); ?>">
|
|
<!-- les résultats s'affichent içi -->
|
|
</div><br/>
|
|
<?php $i++; } //fin foreach ?>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
|
|
<form method="get" class="frm">
|
|
<input type="submit" name="action" id="test" value="Générer Base de données aléatoire" />
|
|
<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>
|
|
|
|
<form method="get" role="form">
|
|
<input type="submit" name="action" value="Afficher les demonstrations" >
|
|
<input type="submit" name="action" value="Afficher les QCM" ><br/>
|
|
</form>
|
|
|
|
<?php
|
|
|
|
|
|
if(array_key_exists('regenerer',$_GET)){
|
|
|
|
$db = new SqliteDb();
|
|
$db->createTable();
|
|
$URL="index.php";
|
|
echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">';
|
|
}
|
|
|
|
|
|
?>
|
|
<div id="resultats">
|
|
<!-- les résultats s'affichent içi -->
|
|
</div><br/>
|
|
|
|
</div>
|
|
<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();
|
|
|
|
|
|
function SubmitQuestionData(numQuestion, numTp) {
|
|
//document.write($('#demo'+numQuestion).val());
|
|
var txt = $('#question'+numQuestion).val() ;
|
|
|
|
$.get("Traitement/Correcteur.php", { textbox : txt, numQuestion : numQuestion, numTp : numTp},
|
|
function(data) {
|
|
$('#resultatsQuestions'+numQuestion).html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
});
|
|
|
|
}
|
|
|
|
function SupprimerQuestion(numQuestion,numTp) {
|
|
$.get("Traitement/Suppression.php", { numQuestion : numQuestion, numTp : numTp},
|
|
function(data) {
|
|
$('#resultatsQuestions'+numQuestion).html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
location.reload();
|
|
});
|
|
|
|
}
|
|
|
|
function ModifierQuestion(numQuestion, numTp) {
|
|
|
|
$.get("Traitement/Modification.php", { numQuestion : numQuestion, numTp : numTp },
|
|
function(data) {
|
|
$('#vuep').empty();
|
|
$('#vuep').html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
//location.reload();
|
|
});
|
|
|
|
}
|
|
|
|
function MonterQuestion(numQuestion, numTp) {
|
|
if(numQuestion > 1){
|
|
$.get("Traitement/Ordre.php", { numQuestion : numQuestion, numTp : numTp },
|
|
function(data) {
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
|
|
window.location.replace("index.php");
|
|
});
|
|
}
|
|
}
|
|
|
|
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>
|
|
<!-- 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>
|