20 Avril
This commit is contained in:
4
BACKEND/PHP/tp2/ex4/css/style.css
Normal file
4
BACKEND/PHP/tp2/ex4/css/style.css
Normal file
@@ -0,0 +1,4 @@
|
||||
button{
|
||||
|
||||
float:right;
|
||||
}
|
57
BACKEND/PHP/tp2/ex4/quizz.html
Normal file
57
BACKEND/PHP/tp2/ex4/quizz.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.*/css/pico.min.css">
|
||||
<link rel="stylesheet" href="./css/style.css">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<h3>Quizz</h3>
|
||||
<form action="score.php" method="post">
|
||||
<fieldset>
|
||||
Quelle est la capitale de la France ?
|
||||
|
||||
<label class="radio">
|
||||
<input type="radio" name="question1" value="faux" > Lyon
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="question1" value="vrai"> Paris
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="question1" value="faux"> Marseille
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
Quelle est le nombre suivant de la suite 1,2,4,8 ?
|
||||
|
||||
<label class="radio">
|
||||
<input type="radio" name="question2" value="vrai" > 16
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="question2" value="faux"> 32
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
La bataille de Marignan a eu lieu en
|
||||
<label class="radio">
|
||||
<input type="radio" name="question3" value="faux" > 1492
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="question3" value="vrai"> 1515
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="question3" value="faux"> 1789
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Envoyer</button>
|
||||
</fieldset>
|
||||
<input type="hidden" value="3" name="nbq">
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
37
BACKEND/PHP/tp2/ex4/score.php
Normal file
37
BACKEND/PHP/tp2/ex4/score.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./css/style.css">
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.*/css/pico.min.css">
|
||||
<meta charset="UTF-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<h4>Réponses</h4>
|
||||
<?php
|
||||
$rep1=$_POST['question1'];
|
||||
$rep2=$_POST['question2'];
|
||||
$rep3=$_POST['question3'];
|
||||
$score=0;
|
||||
if($rep1=="vrai"){
|
||||
echo "<li> Question 1 : <p style=\"color:green\"> Bonne réponse </p></li>";
|
||||
$score++;
|
||||
}else{
|
||||
echo "<li> Question 1 : <p style=\"color:red\"> Mauvaise réponse </p></li>";
|
||||
} if($rep2=="vrai"){
|
||||
echo "<li> Question 2 : <p style=\"color:green\"> Bonne réponse </p></li>";
|
||||
$score++;
|
||||
}else{
|
||||
echo "<li> Question 2 : <p style=\"color:red\"> Mauvaise réponse </p></li>";
|
||||
} if($rep3=="vrai"){
|
||||
echo "<li> Question 3 : <p style=\"color:green\"> Bonne réponse </p></li>";
|
||||
$score++;
|
||||
}else{
|
||||
echo "<li> Question 3 : <p style=\"color:red\"> Mauvaise réponse </p></li>";
|
||||
} echo "<br><h2> Score : $score </h2>"
|
||||
?>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user