Accueil > > > PETIT QUIZ
PETIT QUIZ
Information sur la source
Description
Petit quiz avec 10 questions et résultat
Source
- <html>
- <head>
- <title>GameQuiz</title>
-
- <script>
-
- //script nicolas (nicolas@abacho.fr)
-
-
- var ans = new Array;
- var done = new Array;
- var score = 0;
-
-
- ans[1] = "#";
- ans[2] = "#";
- ans[3] = "#";
- ans[4] = "#";
- ans[5] = "#";
- ans[6] = "#";
- ans[7] = "#";
- ans[8] = "#";
- ans[9] = "#";
- ans[10] = "#";
-
- function Engine(question, answer) {
-
- if (answer != ans[question]) {
- if (!done[question]) {
- done[question] = -1;
- alert("Faux, votre score: " + score);
- }
- else {
- alert("Vous avez déjà répondu");
- }
- }
- else {
- if (!done[question]) {
- done[question] = -1;
- score++;
- alert("Bonne réponse, score " + score);
- }
- else {
- alert("Vous avez déjà répondu");
- }
- }
- }
-
- function NextLevel () {
- if (score > 10) {
- alert("Cheater!");
- }
- if (score >= 7 && score <= 11) {
- alert("Bravo")
-
- }
- else {
- alert("Pas terrible!")
- }
- }
-
-
- </script>
- <BODY BGCOLOR="#FFFFFF">
- <center><font size=6 face=Arial>Quiz</font><br>
- </center>
- <noscript>JavaScript is <b><i>disabled</b></i>. Get Netscape 3.0 or turn it on!</noscript>
-
- <form>
- 1.<p>
- <input type=radio value="a" onClick="Engine(1, this.value)"><br>
- <input type=radio value="b" onClick="Engine(1, this.value)"><br>
- <input type=radio value="c" onClick="Engine(1, this.value)"><br>
- <input type=radio value="d" onClick="Engine(1, this.value)"><p>
-
- 2.<p>
- <input type=radio value="a" onClick="Engine(2, this.value)"><br>
- <input type=radio value="b" onClick="Engine(2, this.value)"><br>
- <input type=radio value="c" onClick="Engine(2, this.value)"><br>
- <input type=radio value="d" onClick="Engine(2, this.value)"><p>
-
- 3.<p>
- <input type=radio value="a" onClick="Engine(3, this.value)"><br>
- <input type=radio value="b" onClick="Engine(3, this.value)"><br>
- <input type=radio value="c" onClick="Engine(3, this.value)"><br>
- <input type=radio value="d" onClick="Engine(3, this.value)"><p>
-
- 4.<p>
- <input type=radio value="a" onClick="Engine(4, this.value)"><br>
- <input type=radio value="b" onClick="Engine(4, this.value)"><br>
- <input type=radio value="c" onClick="Engine(4, this.value)"><br>
- <input type=radio value="d" onClick="Engine(4, this.value)"><p>
-
- 5.<p>
- <input type=radio value="a" onClick="Engine(5, this.value)"><br>
- <input type=radio value="b" onClick="Engine(5, this.value)"><br>
- <input type=radio value="c" onClick="Engine(5, this.value)"><br>
- <input type=radio value="d" onClick="Engine(5, this.value)"><p>
-
- 6.<p>
- <input type=radio value="a" onClick="Engine(6, this.value)"><br>
- <input type=radio value="b" onClick="Engine(6, this.value)"><br>
- <input type=radio value="c" onClick="Engine(6, this.value)"><br>
- <input type=radio value="d" onClick="Engine(6, this.value)"><p>
-
- 7.<p>
- <input type=radio value="a" onClick="Engine(7, this.value)"><br>
- <input type=radio value="b" onClick="Engine(7, this.value)"><br>
- <input type=radio value="c" onClick="Engine(7, this.value)"><br>
- <input type=radio value="d" onClick="Engine(7, this.value)"><p>
-
- 8.<p>
- <input type=radio value="a" onClick="Engine(8, this.value)"><br>
- <input type=radio value="b" onClick="Engine(8, this.value)"><br>
- <input type=radio value="c" onClick="Engine(8, this.value)"><br>
- <input type=radio value="d" onClick="Engine(8, this.value)"><p>
-
- 9.<p>
- <input type=radio value="a" onClick="Engine(9, this.value)"><br>
- <input type=radio value="b" onClick="Engine(9, this.value)"><br>
- <input type=radio value="c" onClick="Engine(9, this.value)"><br>
- <input type=radio value="d" onClick="Engine(9, this.value)"><p>
-
- 10.<p>
- <input type=radio value="a" onClick="Engine(10, this.value)"><br>
- <input type=radio value="b" onClick="Engine(10, this.value)"><br>
- <input type=radio value="c" onClick="Engine(10, this.value)"><br>
- <input type=radio value="d" onClick="Engine(10, this.value)"><p>
-
- <center>
- <input type=button onClick="NextLevel()" value="Résultat">
- </center>
- </form>
- <!-- END OF SCRIPT -->
-
-
- </body>
- </html>
<html>
<head>
<title>GameQuiz</title>
<script>
//script nicolas (nicolas@abacho.fr)
var ans = new Array;
var done = new Array;
var score = 0;
ans[1] = "#";
ans[2] = "#";
ans[3] = "#";
ans[4] = "#";
ans[5] = "#";
ans[6] = "#";
ans[7] = "#";
ans[8] = "#";
ans[9] = "#";
ans[10] = "#";
function Engine(question, answer) {
if (answer != ans[question]) {
if (!done[question]) {
done[question] = -1;
alert("Faux, votre score: " + score);
}
else {
alert("Vous avez déjà répondu");
}
}
else {
if (!done[question]) {
done[question] = -1;
score++;
alert("Bonne réponse, score " + score);
}
else {
alert("Vous avez déjà répondu");
}
}
}
function NextLevel () {
if (score > 10) {
alert("Cheater!");
}
if (score >= 7 && score <= 11) {
alert("Bravo")
}
else {
alert("Pas terrible!")
}
}
</script>
<BODY BGCOLOR="#FFFFFF">
<center><font size=6 face=Arial>Quiz</font><br>
</center>
<noscript>JavaScript is <b><i>disabled</b></i>. Get Netscape 3.0 or turn it on!</noscript>
<form>
1.<p>
<input type=radio value="a" onClick="Engine(1, this.value)"><br>
<input type=radio value="b" onClick="Engine(1, this.value)"><br>
<input type=radio value="c" onClick="Engine(1, this.value)"><br>
<input type=radio value="d" onClick="Engine(1, this.value)"><p>
2.<p>
<input type=radio value="a" onClick="Engine(2, this.value)"><br>
<input type=radio value="b" onClick="Engine(2, this.value)"><br>
<input type=radio value="c" onClick="Engine(2, this.value)"><br>
<input type=radio value="d" onClick="Engine(2, this.value)"><p>
3.<p>
<input type=radio value="a" onClick="Engine(3, this.value)"><br>
<input type=radio value="b" onClick="Engine(3, this.value)"><br>
<input type=radio value="c" onClick="Engine(3, this.value)"><br>
<input type=radio value="d" onClick="Engine(3, this.value)"><p>
4.<p>
<input type=radio value="a" onClick="Engine(4, this.value)"><br>
<input type=radio value="b" onClick="Engine(4, this.value)"><br>
<input type=radio value="c" onClick="Engine(4, this.value)"><br>
<input type=radio value="d" onClick="Engine(4, this.value)"><p>
5.<p>
<input type=radio value="a" onClick="Engine(5, this.value)"><br>
<input type=radio value="b" onClick="Engine(5, this.value)"><br>
<input type=radio value="c" onClick="Engine(5, this.value)"><br>
<input type=radio value="d" onClick="Engine(5, this.value)"><p>
6.<p>
<input type=radio value="a" onClick="Engine(6, this.value)"><br>
<input type=radio value="b" onClick="Engine(6, this.value)"><br>
<input type=radio value="c" onClick="Engine(6, this.value)"><br>
<input type=radio value="d" onClick="Engine(6, this.value)"><p>
7.<p>
<input type=radio value="a" onClick="Engine(7, this.value)"><br>
<input type=radio value="b" onClick="Engine(7, this.value)"><br>
<input type=radio value="c" onClick="Engine(7, this.value)"><br>
<input type=radio value="d" onClick="Engine(7, this.value)"><p>
8.<p>
<input type=radio value="a" onClick="Engine(8, this.value)"><br>
<input type=radio value="b" onClick="Engine(8, this.value)"><br>
<input type=radio value="c" onClick="Engine(8, this.value)"><br>
<input type=radio value="d" onClick="Engine(8, this.value)"><p>
9.<p>
<input type=radio value="a" onClick="Engine(9, this.value)"><br>
<input type=radio value="b" onClick="Engine(9, this.value)"><br>
<input type=radio value="c" onClick="Engine(9, this.value)"><br>
<input type=radio value="d" onClick="Engine(9, this.value)"><p>
10.<p>
<input type=radio value="a" onClick="Engine(10, this.value)"><br>
<input type=radio value="b" onClick="Engine(10, this.value)"><br>
<input type=radio value="c" onClick="Engine(10, this.value)"><br>
<input type=radio value="d" onClick="Engine(10, this.value)"><p>
<center>
<input type=button onClick="NextLevel()" value="Résultat">
</center>
</form>
<!-- END OF SCRIPT -->
</body>
</html>
Conclusion
Explications :
Trouvez ces lignes :
1.QUESTION A POSER<p> <input type=radio value="a" onClick="Engine(1, this.value)">REPONSE A<br> <input type=radio value="b" onClick="Engine(1, this.value)">REPONSE B<br> <input type=radio value="c" onClick="Engine(1, this.value)">REPONSE C<br> <input type=radio value="d" onClick="Engine(1, this.value)">REPONSE D<p>
Mettons que pour la question 1, la bonne réponse est "C", Mettre dans le javascript :
ans[1] = "c"; //la réponse de la question 1 est "c" comme indiqué dans le js ans[2] = "#";//faire de même avec les autres questions ans[3] = "#"; ans[4] = "#"; ans[5] = "#"; ans[6] = "#"; ans[7] = "#"; ans[8] = "#"; ans[9] = "#"; ans[10] = "#";
Faire de même avec les autres questions
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Forum
UTILISER UN .JSUTILISER UN .JS par zaikoe
Cliquez pour lire la suite par zaikoe
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|