|
|
|
@ -40,7 +40,7 @@
|
|
|
|
|
<?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/>
|
|
|
|
|
<input type="checkbox" id="textbox<?php echo $qcm->getNumQuestion().$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
|
|
|
|
@ -48,10 +48,12 @@
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
<span id="inp-centre"><input class="modifierQCM" type="button" value="Modifier" onclick="ModifierQCM(<?php echo $qcm->getNumQuestion(); ?>);" >
|
|
|
|
|
<input class="supprimerQCM" type="button" value="Supprimer" onclick="SupprimerQCM(<?php echo $qcm->getNumQuestion(); ?>);" ></span>
|
|
|
|
|
<span id="inp-gauche"><input class="monterQCM" type="button" value="Monter" onclick="MonterQCM(<?php echo $qcm->getNumQuestion(); ?>)" >
|
|
|
|
|
<input class="descendreQCM" type="button" value="Descendre" onclick="DescendreQCM(<?php echo sizeof($tabQCM); ?>,<?php echo $qcm->getNumQuestion(); ?>)" ></span>
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
<div id="results<?php echo $qcm->getNumQuestion(); ?>">
|
|
|
|
|
<!-- les résultats s'affichent içi -->
|
|
|
|
|
</div><br/>
|
|
|
|
@ -74,9 +76,12 @@
|
|
|
|
|
function SubmitQCMData(numQuestion) {
|
|
|
|
|
//document.write($('#textbox'+numQuestion).val());
|
|
|
|
|
var name = "radiobox"+numQuestion;
|
|
|
|
|
var txt = $("input[name="+name+"]:checked").val();
|
|
|
|
|
//var txt = $("input[name="+name+"]:checked").val();
|
|
|
|
|
|
|
|
|
|
$.get("Traitement/CorrectionQCM.php", { textbox: txt , numQuestion: numQuestion},
|
|
|
|
|
var rep1 = $('#textbox'+numQuestion+1).is(':checked');
|
|
|
|
|
var rep2 = $('#textbox'+numQuestion+2).is(':checked');
|
|
|
|
|
var rep3 = $('#textbox'+numQuestion+3).is(':checked');
|
|
|
|
|
$.get("Traitement/CorrectionQCM.php", { numQuestion: numQuestion, rep1 : rep1, rep2 : rep2, rep3 : rep3},
|
|
|
|
|
function(data) {
|
|
|
|
|
$('#results'+numQuestion).html(data);
|
|
|
|
|
//$('#QCMForm')[0].reset();
|
|
|
|
@ -112,6 +117,8 @@
|
|
|
|
|
|
|
|
|
|
function SupprimerQCM(numQuestion)
|
|
|
|
|
{
|
|
|
|
|
var result = confirm("Êtes-vous sûr de vouloir supprimer la question "+numQuestion+" ?");
|
|
|
|
|
if(result){
|
|
|
|
|
var type = "qcm";
|
|
|
|
|
$.get("Traitement/Suppression.php", { numQuestion : numQuestion ,qcm : type},
|
|
|
|
|
function(data) {
|
|
|
|
@ -119,7 +126,7 @@
|
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
|
|
|
$("#inp-questions").trigger("click");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function ModifierQCM(numQuestion) {
|
|
|
|
|
$.get("Traitement/ModificationQCM.php", { numQuestion : numQuestion },
|
|
|
|
@ -131,6 +138,14 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|