1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| <!DOCTYPE html>
<!--Ton score est de "+score+" -->
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="guitare.css" />
<title> Quizz sur Federer ! </title>
<script type="text/javascript">
//<![CDATA[
var nombre_question;
var q;
window.onload = function(){
nombre_question=document.getElementsByClassName('question').length;
q = new Array( nombre_question+1 );
for( i=1, score=0; i<=nombre_question; i++ ) q[i] = 0; // on met tout les scores a 0
}
//calcul du score
function calcul(){
for( i=1, score=0; i<=nombre_question; i++ )
score += q[i];
return score;
}
//commentaire du résultat
function resultat(){
score = calcul();
if ( score = 4 ) alert("Ton score est de "+score+" sur 4 ! Bravo !");
else alert("Ton score est de "+score+", il y a eu une ou plusieurs mauvaises réponses...");
}
//]]>
</script>
<style type="text/css">
body{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:small;
}
.titre{
font-family: Arial; font-weight: bold;
color: rgb(102, 51, 102);
font-size:large;
font-style:italic;
}
.question{
color: rgb(102, 51, 102);
}
</style>
</head>
<body>
<div align="center">
<br/>
<font class="titre">Quizz sur le tennis</font>
</div>
<div>
<hr align="center" noshade="noshade"/>
<font class="question"><b>Question 1 :</b></font>
<br/>Qui détient actuellement le record de Grand Chelem gagné (17)? <br/>
<label><input name="question1" type="radio" onclick='q[1]=0'/>Rafael Nadal</label><br/><!--le joueur gagne 0 points -->
<label><input name="question1" type="radio" onclick='q[1]=1'/>Roger Federer</label><br/><!--le joueur gagne 1 points -->
<label><input name="question1" type="radio" onclick='q[1]=0'/>Pete Sampras</label><br/><!--le joueur gagne 0 points -->
<hr align="center" noshade="noshade"/>
<font class="question"><b>Question 2 :</b></font>
<br/>Combien de Roland-Garros Nadal a-t-il remporté ?<br/>
<label><input name="question2" type="radio" onclick='q[2]=0'/>7</label><br/><!--le joueur gagne 0 points -->
<label><input name="question2" type="radio" onclick='q[2]=0'/>8</label><br/><!--le joueur gagne 0 points -->
<label><input name="question2" type="radio" onclick='q[2]=1'/>9</label><br/><!--le joueur gagne 1 points -->
<hr align="center" noshade="noshade"/>
<font class="question"><b>Question 3 :</b></font>
<br/>Sur quelle surface se déroule l'US Open?<br/>
<label><input name="question3" type="radio" onclick='q[2]=0'/></label>Terre-Battue<br/><!--le joueur gagne 0 points -->
<label><input name="question3" type="radio" onclick='q[2]=1'/></label>Dur<br/><!--le joueur gagne 1 points -->
<label><input name="question3" type="radio" onclick='q[2]=0'/></label>Herbe<br/><!--le joueur gagne 0 points -->
<hr align="center" noshade="noshade"/>
<font class="question"><b>Question 4 :</b></font>
<br/>Quand Stan Wawrinka a-t-il remporté son premier Grand Chelem ?<br/>
<label><input name="question4" type="radio" onclick='q[2]=1'/></label>2014<br/><!--le joueur gagne 1 points -->
<label><input name="question4" type="radio" onclick='q[2]=0'/></label>2015<br/><!--le joueur gagne 0 points -->
<label><input name="question4" type="radio" onclick='q[2]=0'/></label>2012<br/><!--le joueur gagne 0 points -->
<!--tu peux mettre autant de réponses que tu veux-->
<p align="center">
<input value="Score ?" onclick="resultat()" type="button"/>
</p>
</div>
</body>
</html> |