parent
e01b6493f7
commit
0ac27fb95c
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
require_once('../BDD/SqliteDb.php');
|
||||
require_once('../controleur/Controleur.php');
|
||||
|
||||
|
||||
$db = new SqliteDb('o');
|
||||
|
||||
$isAdd = $db->ajouterQCM($_GET['numQuestion'],$_GET['consigne'],$_GET['choix1'],$_GET['choix2'],$_GET['choix3'], $_GET['reponse']);
|
||||
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>';
|
||||
|
Binary file not shown.
@ -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,2 @@
|
||||
NBA**1**3**5 premières lignes de la table EQUIPE** SELECT * FROM EQUIPE WHERE rownum<6
|
||||
NBA**1**4**5 premières lignes de la table GAME** SELECT * FROM GAME WHERE rownum<6
|
@ -0,0 +1,2 @@
|
||||
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
|
@ -0,0 +1,28 @@
|
||||
<!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/vueGestionTables.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">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>
|
||||
<form method="get" class="frm">
|
||||
<input class="inp-reset" type="submit" name="action" value="Générer Base de données aléatoire" />
|
||||
<input class="inp-reset" type="submit" name="action" value="Réintiliser les questions" />
|
||||
<input class="inp-reset" type="submit" name="action" value="Reintiliser les QCM" />
|
||||
<input class="inp-reset" type="submit" name="action" id="regenererDemo" value="Reintiliser les demonstrations" /><br/>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,83 @@
|
||||
|
||||
<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(QCM)</h1>
|
||||
<hr>
|
||||
|
||||
<label><b>Numéro de question : </b></label>
|
||||
<input type="text" placeholder="Saisir le numéro de la démonstration..." id="numQuestion" required>
|
||||
|
||||
|
||||
<label><b>Consigne : </b></label>
|
||||
<input type="text" placeholder="Ecrire l'intitulé de la démonstration..." id="consigne" required>
|
||||
|
||||
<label><b>Réponse 1 : </b></label>
|
||||
<input type="text" id="choix1" required>
|
||||
|
||||
<label><b>Réponse 2 : </b></label>
|
||||
<input type="text" id="choix2" required>
|
||||
|
||||
<label><b>Réponse 3 : </b></label>
|
||||
<input type="text" id="choix3" required>
|
||||
|
||||
<label><b>Bonne Réponse ? </b><br/>
|
||||
<input type="radio" name="reponse" value="1" style="margin-bottom:15px" checked> 1
|
||||
<input type="radio" name="reponse" value="2" style="margin-bottom:15px"> 2
|
||||
<input type="radio" name="reponse" value="3" style="margin-bottom:15px"> 3
|
||||
</label><br/>
|
||||
|
||||
<div >
|
||||
<input type="button" value="Ajouter" onclick="SubmitAjoutQCM()" />
|
||||
</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 SubmitAjoutQCM() {
|
||||
|
||||
//var chapitre = $('#chapitre').val() ;
|
||||
var numQuestion = $('#numQuestion').val() ;
|
||||
var consigne = $('#consigne').val() ;
|
||||
var choix1= $('#choix1').val() ;
|
||||
var choix2= $('#choix2').val() ;
|
||||
var choix3= $('#choix3').val() ;
|
||||
//var reponse = $('#reponse').val() ;
|
||||
var reponse = $("input[name='reponse']:checked").val();
|
||||
|
||||
|
||||
$.get("Traitement/AjoutQCM.php", {numQuestion: numQuestion,consigne: consigne,choix1: choix1,choix2: choix2,choix3: choix3,reponse: reponse},
|
||||
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>
|
Loading…
Reference in new issue