Aide pour un formulaire

nsri Messages postés 3 Statut Membre -  
nsri Messages postés 3 Statut Membre -
voilà ce que j'ai réussi, à faire un petit test de calcul mental avec un compte à rebours pour mes élèves (cm1) le truc c'est que j'aimerai recevoir leur résultat sur ma boite, donc est il possible d'ajouter une sorte de formulaire qui me donne le nombre de bon résultat ainsi que le temps total qu'ils ont mis pour faire le test.
voici le code :
merci d'avance.

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>test</title>
</head>
<body
style="background-color: rgb(102, 204, 204); color: rgb(0, 0, 0);"
alink="#ee0000" link="#0000ee" vlink="#551a8b">
<table
style="background-color: rgb(51, 51, 255); width: 100%; text-align: left; margin-left: auto; margin-right: auto;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td
style="background-color: rgb(255, 255, 204); text-align: center;"><big><big><big><big><big><span
style="font-weight: bold;">Cerebral King Academy</span></big></big></big></big></big></td>
</tr>
</tbody>
</table>
<br>
<table
style="text-align: left; background-color: rgb(51, 51, 255); width: 100%;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(255, 255, 204);"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<link rel="stylesheet" type="text/css"
href="css/style.css">
<style type="text/css"> .pro{ border:solid blue 1px; position:absolute; top:20px; left:300px; font:normal 12px sans-serif; padding:5px; background-color:gray; display:"none"; } a { color : blue; } a:hover { color : red; } #formulaire { width : 282px; height : 210px; text-align : center; border : 1px solid; border-color : #999999; border-style : inset; margin-right : auto; margin-left : auto; } .start { width : 60px; height : 30px; margin-top : 4px; } .nb1 { text-align : center; border : 1px solid; border-color : #999999; border-style : inset; } .nb2 { text-align : center; border : 1px solid; border-color : #999999; border-style : inset; } .commentaires { width : 260px; height : 78px; margin-top : 6px; color : red; font-size : 15px; } .backmenu { text-align : center; font-family : arial; } </style>
<div id="principal">
<div id="header"> </div>
<div id="left">
<p
style="font-family: arial; font-size: 18px; text-align: center; text-decoration: underline;"></p>
<form name="test" id="formulaire"> <input
value="demarrer" class="start" onclick="Test();"
type="button"><br>
<br>
<input name="champs1" class="nb1" size="6"
onfocus="this.blur()"> + <input name="champs2"
class="nb2" size="6" onfocus="this.blur()"> = <span
style="font-size: 18px; font-weight: bold;">?</span><br>
<br>
<span
style="font-family: arial; text-decoration: underline; font-size: 18px;">Voici
vos résultats</span> <input name="comments"
class="commentaires" onfocus="this.blur()"
type="textarea"> </form>
<div id="question" class="pro">
<form name="form"> Quel est votre réponse
? <br>
Question : <span id="nQuestion"></span> <br>
<input name="reponse" type="text"> <br>
Il te reste <span id="nSeconde">30</span> s <br>
<input value="Valider" onclick="valider();"
type="button"> </form>
</div>

<p class="backmenu"></p>
</div>
<div id="footer">
<div id="copyright">
<p></p>
</div>
</div>

</body>
</html>

2 réponses

miramaze Messages postés 1468 Statut Contributeur 92
 
Tu pourrais envoyer le javascript aussi ?
0
nsri Messages postés 3 Statut Membre
 
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>test</title>
</head>
<body
style="background-color: rgb(102, 204, 204); color: rgb(0, 0, 0);"
alink="#ee0000" link="#0000ee" vlink="#551a8b">
<table
style="background-color: rgb(51, 51, 255); width: 100%; text-align: left; margin-left: auto; margin-right: auto;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td
style="background-color: rgb(255, 255, 204); text-align: center;"><big><big><big><big><big><span
style="font-weight: bold;">Cerebral King Academy</span></big></big></big></big></big></td>
</tr>
</tbody>
</table>
<br>
<table
style="text-align: left; background-color: rgb(51, 51, 255); width: 100%;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(255, 255, 204);"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<link rel="stylesheet" type="text/css"
href="css/style.css">
<style type="text/css"> .pro{ border:solid blue 1px; position:absolute; top:20px; left:300px; font:normal 12px sans-serif; padding:5px; background-color:gray; display:"none"; } a { color : blue; } a:hover { color : red; } #formulaire { width : 282px; height : 210px; text-align : center; border : 1px solid; border-color : #999999; border-style : inset; margin-right : auto; margin-left : auto; } .start { width : 60px; height : 30px; margin-top : 4px; } .nb1 { text-align : center; border : 1px solid; border-color : #999999; border-style : inset; } .nb2 { text-align : center; border : 1px solid; border-color : #999999; border-style : inset; } .commentaires { width : 260px; height : 78px; margin-top : 6px; color : red; font-size : 15px; } .backmenu { text-align : center; font-family : arial; } </style>
<div id="principal">
<div id="header"> </div>
<div id="left">
<p
style="font-family: arial; font-size: 18px; text-align: center; text-decoration: underline;"></p>
<form name="test" id="formulaire"> <input
value="demarrer" class="start" onclick="Test();"
type="button"><br>
<br>
<input name="champs1" class="nb1" size="6"
onfocus="this.blur()"> + <input name="champs2"
class="nb2" size="6" onfocus="this.blur()"> = <span
style="font-size: 18px; font-weight: bold;">?</span><br>
<br>
<span
style="font-family: arial; text-decoration: underline; font-size: 18px;">Voici
vos résultats</span> <input name="comments"
class="commentaires" onfocus="this.blur()"
type="textarea"> </form>
<div id="question" class="pro">
<form name="form"> Quel est votre réponse
? <br>
Question : <span id="nQuestion"></span> <br>
<input name="reponse" type="text"> <br>
Il vous reste <span id="nSeconde">20</span> s <br>
<input value="Valider" onclick="valider();"
type="button"> </form>
</div>
<script type="text/javascript" language="javascript"> obj=document.getElementById('question'); objnQ=document.getElementById('nQuestion'); objnS=document.getElementById('nSeconde'); cpt=1; i=0; f=0; sec=20; function rebours() { objnS.innerHTML=sec; sec=sec-1; if(sec>=-1) {reb=setTimeout("rebours()",1000);} else { sec=20; valider();} } function Test() { obj.style.display="inline"; document.test.comments.value=''; a=0; b=0; s=0; c=0; objnQ.innerHTML=cpt; c=000+(Math.round(Math.random()*100)); b=00+(Math.round(Math.random()*100)); a=-b+c; document.test.champs1.value=a; document.test.champs2.value=b; rebours(); } function valider() { clearTimeout(reb); vReponse=document.form.reponse.value; obj.style.display="none"; if(vReponse==+c) { alert("Bonne réponse"); s=s+1; cpt++; } else { alert("Mauvaise réponse\nla bonne réponse était : "+c); s=s+0; cpt++; } document.form.reponse.value=''; if(cpt<=20) {sec=20; Test();} else {annuler();} } function annuler() { clearTimeout(reb); sec=20; obj.style.display="none"; alert("C\'est terminé...\nRegardez les commentaires"); document.test.comments.value = "Votre score sur 20 est de "+s; cpt=1; document.form.reponse.value=''; } </script>
<p class="backmenu"></p>
</div>
<div id="footer">
<div id="copyright">
<p></p>
</div>
</div>
<script language='javascript'>document.write('<img src="https://www.118712.fr/sortir.html + Math.round(Math.random()*100000) + '" width=1 height=1>'); </script>
<script language='javascript'>document.write('<img src="http://e.voila.fr/cgi-bin/ft/10000033638?&page=cerebralkingacademy_test.html&n=' + Math.round(Math.random()*100000) + '" width=1 height=1>');</script></body>
</html>
0