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.
138 lines
6.1 KiB
138 lines
6.1 KiB
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<script src="css/jquery-3.5.1.min.js"></script>
|
|
|
|
<link rel="stylesheet" href="css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="css/VuePrincipale.css">
|
|
</head>
|
|
<body id="vueqcm">
|
|
<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">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">
|
|
<h1>QCM</h1>
|
|
<p class="lead"></p>
|
|
</div>
|
|
</header>
|
|
|
|
|
|
<section id="TP2">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-8 mx-auto">
|
|
<h2>QCM</h2>
|
|
<form id="QCMForm" method="get" >
|
|
<?php $i=0; //shuffle($dVueQuestions);
|
|
foreach ($tabQCM as $qcm) {
|
|
?>
|
|
<p><?php echo $qcm->getNumQuestion() .'.'.$qcm->getQuestion(); ?> <br/>
|
|
<?php
|
|
foreach ($qcm->getReponse() as $r ) { ?>
|
|
|
|
<input type="radio" id="textbox<?php echo $r->getNumReponse(); ?>" name="radiobox<?php echo $qcm->getNumQuestion();?>" value="<?php echo $r->getReponse();?>" style="margin-bottom:15px"> <?php echo $r->getNumReponse().'.'.$r->getReponse(); ?> <br/>
|
|
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<p> <input class="SubmitQCMData" type="button" value="Valider" onclick="SubmitQCMData(<?php echo $qcm->getNumQuestion(); ?>)" >
|
|
<input class="monterQCM" type="button" value="Monter" onclick="MonterQCM(<?php echo $qcm->getNumQuestion(); ?>)" >
|
|
<input class="supprimerQCM" type="button" value="Supprimer" onclick="SupprimerQCM(<?php echo $qcm->getNumQuestion(); ?>);" >
|
|
<input class="descendreQCM" type="button" value="Descendre" onclick="DescendreQCM(<?php echo sizeof($tabQCM); ?>,<?php echo $qcm->getNumQuestion(); ?>)" >
|
|
<input class="modifierQCM" type="button" value="Modifier" onclick="ModifierQCM(<?php echo $qcm->getNumQuestion(); ?>);" ></p>
|
|
<div id="results<?php echo $qcm->getNumQuestion(); ?>">
|
|
<!-- les résultats s'affichent içi -->
|
|
</div><br/>
|
|
<?php } //fin foreach ?>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<form method="get" >
|
|
<input id="btn-ajout" type="submit" name="action" value="Ajouter QCM" />
|
|
</form>
|
|
<form method="get" role="form">
|
|
<input id="inp-questions" class="bouton" type="submit" name="action" value="QCM" hidden>
|
|
<input id="inp-ret" type="submit" name="action" value="Retour au menu principal" >
|
|
</form>
|
|
|
|
<script>
|
|
function SubmitQCMData(numQuestion) {
|
|
//document.write($('#textbox'+numQuestion).val());
|
|
var name = "radiobox"+numQuestion;
|
|
var txt = $("input[name="+name+"]:checked").val();
|
|
|
|
$.get("Traitement/CorrectionQCM.php", { textbox: txt , numQuestion: numQuestion},
|
|
function(data) {
|
|
$('#results'+numQuestion).html(data);
|
|
//$('#QCMForm')[0].reset();
|
|
});
|
|
}
|
|
|
|
function MonterQCM(numQuestion) {
|
|
if(numQuestion > 1){
|
|
$.get("Traitement/OrdreQCM.php", { numQuestion : numQuestion },
|
|
function(data) {
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
//$('#erreur').html(data);
|
|
$("#inp-questions").trigger("click");
|
|
//window.location.replace("index.php");
|
|
});
|
|
}
|
|
}
|
|
|
|
function DescendreQCM(nbQuestions,numQuestion) {
|
|
//alert(nbQuestions);
|
|
var des = 1;
|
|
if(numQuestion < nbQuestions){
|
|
$.get("Traitement/OrdreQCM.php", { des : des , numQuestion : numQuestion },
|
|
function(data) {
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
$("#inp-questions").trigger("click");
|
|
//window.location.replace("index.php");
|
|
});
|
|
}
|
|
}
|
|
|
|
function SupprimerQCM(numQuestion)
|
|
{
|
|
var type = "qcm";
|
|
$.get("Traitement/Suppression.php", { numQuestion : numQuestion ,qcm : type},
|
|
function(data) {
|
|
//$('#results'+numDemo+numChapitre).html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
$("#inp-questions").trigger("click");
|
|
});
|
|
|
|
}
|
|
function ModifierQCM(numQuestion) {
|
|
$.get("Traitement/ModificationQCM.php", { numQuestion : numQuestion },
|
|
function(data) {
|
|
$('#vueqcm').empty();
|
|
$('#vueqcm').html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
//location.reload();
|
|
});
|
|
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|