html - How to convert Javascript quiz to show a button after a a combination of buttons are chosen -


i'm trying figure out how change code around when answers questions, certain link or button depending on combination of questions asked. prefer use javascript , html because that's know.

<html> <head>  <style type="text/css"> <!-- .bgclr {background-color: white; color: black; font-weight: bold;} --> </style>  <script language="javascript">   script , many more available free online @   javascript source!! http://www.javascriptsource.com   <!-- begin // insert number of questions var numques = 4;  // insert number of choices in each question var numchoi = 3;  // insert number of questions displayed in answer area var answers = new array(4);  // insert answers questions answers[0] = "cascading style sheets"; answers[1] = "dynamic html"; answers[2] = "netscape"; answers[3] = "common gateway interface";  // not change below here ... function getscore(form) { var score = 0; var currelt; var currselection; (i=0; i<numques; i++) { currelt = i*numchoi; (j=0; j<numchoi; j++) {   currselection = form.elements[currelt + j];   if (currselection.checked) {     if (currselection.value == answers[i]) {       score++;       break;     }   } } } score = math.round(score/numques*100); form.percentage.value = score + "%"; var correctanswers = ""; (i=1; i<=numques; i++) { correctanswers += + ". " + answers[i-1] + "\r\n"; } form.solutions.value = correctanswers; } //  end --> </script>   </head> <body>      <h3>web design quiz</h3>  <form name="quiz"> 1.  css stand for? <ul style="margin-top: 1pt"> <li><input type="radio" name="q1" value="colorful style symbols"/>colorful style   symbols</li> <li><input type="radio" name="q1" value="cascading style sheets"/>cascading style     sheets</li> <li><input type="radio" name="q1" value="computer style symbols"/>computer style   symbols</li> </ul>  2. dhtml stand for? <ul style="margin-top: 1pt"> <li><input type="radio" name="q2" value="dramatic html"/>dramatic html</li> <li><input type="radio" name="q2" value="design html"/>design html</li> <li><input type="radio" name="q2" value="dynamic html"/>dynamic html</li> </ul> 3. created javascript? <ul style="margin-top: 1pt"> <li><input type="radio" name="q3" value="microsoft"/>microsoft</li> <li><input type="radio" name="q3" value="netscape"/>netscape</li> <li><input type="radio" name="q3" value="sun micro systems"/>sun micro systems</li> </ul> 4. cgi stand for? <ul style="margin-top: 1pt"> <li><input type="radio" name="q4" value="cascading gate interaction"/>cascading gate    interaction</li> <li><input type="radio" name="q4" value="common gif interface"/>common gif  interface</li> <li><input type="radio" name="q4" value="common gateway interface"/>common gateway  interface</li> </ul>  <input type="button" value="get score" onclick="getscore(this.form)"/> <input type="reset" value="clear answers"/> <p> score = <strong><input class="bgclr" type="text" size="5" name="percentage"   disabled="disabled"/></strong><br/><br/> correct answers:<br/> <textarea class="bgclr" name="solutions" wrap="virtual" rows="4" cols="30"     disabled="disabled"> </textarea> </p></form>   </body>   </html>` 

jsfiddle: http://jsfiddle.net/thqmr/


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -