HTML - Broken Quiz
I've copied this from a site's source code, but it doesn't work on mine.
It directs you to the next page, whatever you answer. Here is the page: http://www.freewebs.com/jaceyanimation/ebook.htm Here is the code i made: HTML Code: <table align=center width='97%' cellspacing=10 cellpadding=2 border=0> <form action='/signup_basic.php' method=post> <tr> <td><b>1. What is the street number of the orders headquarters ?</b></td> <td><select name='5'> <option value=1 SELECTED>9</option> <option value=2>10</option> <option value=3>11</option> <option value=4>12</option> <option value=5>13</option> <option value=6>14</option> <option value=7>15</option> </select></td> </tr> <tr> <td><b>2. What is Luna's last name ?</b></td> <td><select name='5'> <option value=1 SELECTED>Lonely</option> <option value=2>Lilac</option> <option value=3>Leona</option> <option value=4>Lee</option> <option value=5>Lovegood</option> <option value=6>Lier</option> <option value=7>Lehman</option> </select></td> </tr> <tr> <td><b>3. How much is a Unicorn Horn ?</b></td> <td><select name='2'> <option value=1 SELECTED>24 Galleons</option> <option value=2>26 Galleons</option> <option value=3>28 Galleons</option> <option value=4>30 Galleons</option> <option value=5>32 Galleons</option> <option value=6>9 Sickles</option> <option value=7>1 Knut</option> </select></td> </tr> <tr><td colspan=2 align=center><br><br> <input type=hidden name=action value=agree> <input type=button value=' Go Back ' onClick="location.href='javascript:javascript:history.go(-1)';"> <input type=button value=' Download ' onClick="location.href='http://www.freewebs.com/jaceyanimation/downloadebook.htm';"></td></tr> </form></table> The answers a 12 Lovegood 26 Can Someone please fix this Similar Tutorialshi all im trying to make a quiz on this..here is my code but cant seem to get it to work Grrrrrrrrr ---------------------------------------------------------- it gives the user a mark on how he/she performed. This should be time limited and when finished should also display whether the given answers were wrong or correct. The user will get 2 marks for each correct answer, and -1 for each wrong answer. The quiz should consist of 10 questions. The background colour of the page should change according to the awarded mark. ---------------------------------------------------------- Code: <html><head> <title>Sports Quiz</title><script> //highlight color of answer - can change this color to a hex code or recognized color namevar highlightColor = "#00ff00"; //this should not be changedfunction checkQuestionDropDown(selectGroup) { if (selectGroup[selectGroup.selectedIndex].value == "correct") { return 1; } else { return 0; }} //this should not be changedfunction checkQuestionRadio(radioGroup) { //go through the radio group sent in and determine if radio button//checked is "correct". //return 1 for correct value, 0 for incorrect for (i=0; i<radioGroup.length; i++) { if (radioGroup[i].checked) { if (radioGroup[i].value == "correct") { return 1; } else { return 0; } } }return 0;} //this should not be changedfunction highlightCorrectButton(radioButton) { document.getElementById(radioButton).style.backgroundColor = highlightColor;} function checkQuiz() { //check each question to see if it's right. //The orange highlighted code may need to be changed //you will need to match these question types(Radio/DropDown) //and names (q1, q2, ...) to the ones in your quiz numCorrect = 0; numCorrect += checkQuestionRadio( document.quiz.q1); numCorrect += checkQuestionRadio( document.quiz.q2); numCorrect += checkQuestionRadio( document.quiz.q3); numCorrect += checkQuestionDropDown( document.quiz.q4); //highlight correct answers from radio button groups...use span id name highlightCorrectButton('correct1'); highlightCorrectButton('correct2'); highlightCorrectButton('correct3'); //produce output in textarea. document.quiz.output.value += "You got " + numCorrect + " out of 4 questions correct.\n" + "Your grade is " + Math.round(100*numCorrect/4) + "%\n" + "The answer to question 1 is HyperText Markup Language\n" + "The answer to question 2 is Jefferson City\n" + "The answer to question 3 is talking\n" + "The answer to question 4 is mass\n"; } setTimeout('submitForm()', 1*60*1000);function submitForm() { document.getElementById('form_id').submit();} </script></head><body> <form name="counter"><input type="text" size="8" name="d2"></form> <script> <!-- // var milisec=0 var seconds=30 document.counter.d2.value='60' function display(){ if (milisec<=0){ milisec=9 seconds-=1 } if (seconds<=-1){ milisec=0 seconds+=1 } else milisec-=1 document.counter.d2.value=seconds+"."+milisec setTimeout("display()",100) } display() --> </script> <form name="quiz"><ol><li><b>HTML stands for</b>:<br> <input type="radio" name="q1" value="wrong">How To Make Lines <br><input type="radio" name="q1" value="wrong">Hungry Men Talk Lots <span id="correct1"><br><input type="radio" name="q1" value="correct">HyperText Markup Language</span> <br><input type="radio" name="q1" value="wrong">Hyper Talk Machine Language</li><br><br><li><b>The capital of Missourri is</b>: <br><input type="radio" name="q2" value="wrong">St. Louis <span id="correct2"><br><input type="radio" name="q2" value="correct">Jefferson City</span> <br><input type="radio" name="q2" value="wrong">Missourri City <br><input type="radio" name="q2" value="wrong">Omaha</li><br><br><li><b> What is capital of wales:</b> <span id="correct3"><br><input type="radio" name="q3" value="correct">Cardiff</span> <br><input type="radio" name="q3" value="wrong">hankuva <br><input type="radio" name="q3" value="wrong">hong kong <br><input type="radio" name="q3" value="wrong">egypt</li><br></li><br><li><b> What is capital of spain:</b> <span id="correct3"><br><input type="radio" name="q3" value="correct">Ahuhu</span> <br><input type="radio" name="q3" value="wrong">Bchec <br><input type="radio" name="q3" value="wrong">Cdoddoe <br><input type="radio" name="q3" value="wrong">quebec</li><br></ol><br><br> <center><input type="button" onClick="checkQuiz()" value="check quiz"><hr><textarea cols="80" rows="10" name="output"></textarea></center></form></body></html><html> <head> <title>Sports Quiz</title> <script> //highlight color of answer - can change this color to a hex code or recognized color name var highlightColor = "#00ff00"; //this should not be changed function checkQuestionDropDown(selectGroup) { if (selectGroup[selectGroup.selectedIndex].value == "correct") { return 1; } else { return 0; } } //this should not be changed function checkQuestionRadio(radioGroup) { //go through the radio group sent in and determine if radio button //checked is "correct". //return 1 for correct value, 0 for incorrect for (i=0; i<radioGroup.length; i++) { if (radioGroup[i].checked) { if (radioGroup[i].value == "correct") { return 1; } else { return 0; } } } return 0; } //this should not be changed function highlightCorrectButton(radioButton) { document.getElementById(radioButton).style.backgroundColor = highlightColor; } function checkQuiz() { //check each question to see if it's right. //The orange highlighted code may need to be changed //you will need to match these question types(Radio/DropDown) //and names (q1, q2, ...) to the ones in your quiz numCorrect = 0; numCorrect += checkQuestionRadio( document.quiz.q1); numCorrect += checkQuestionRadio( document.quiz.q2); numCorrect += checkQuestionRadio( document.quiz.q3); numCorrect += checkQuestionDropDown( document.quiz.q4); //highlight correct answers from radio button groups...use span id name highlightCorrectButton('correct1'); highlightCorrectButton('correct2'); highlightCorrectButton('correct3'); //produce output in textarea. document.quiz.output.value += "You got " + numCorrect + " out of 4 questions correct.\n" + "Your grade is " + Math.round(100*numCorrect/4) + "%\n" + "The answer to question 1 is HyperText Markup Language\n" + "The answer to question 2 is Jefferson City\n" + "The answer to question 3 is talking\n" + "The answer to question 4 is mass\n"; } setTimeout('submitForm()', 1*60*1000); function submitForm() { document.getElementById('form_id').submit(); } </script> </head> <body> <form name="counter"><input type="text" size="8" name="d2"></form> <script> <!-- // var milisec=0 var seconds=30 document.counter.d2.value='60' function display(){ if (milisec<=0){ milisec=9 seconds-=1 } if (seconds<=-1){ milisec=0 seconds+=1 } else milisec-=1 document.counter.d2.value=seconds+"."+milisec setTimeout("display()",100) } display() --> </script> <form name="quiz"> <ol> <li><b>HTML stands for</b>:<br> <input type="radio" name="q1" value="wrong">How To Make Lines <br><input type="radio" name="q1" value="wrong">Hungry Men Talk Lots <span id="correct1"><br><input type="radio" name="q1" value="correct">HyperText Markup Language</span> <br><input type="radio" name="q1" value="wrong">Hyper Talk Machine Language </li><br><br> <li><b>The capital of Missourri is</b>: <br><input type="radio" name="q2" value="wrong">St. Louis <span id="correct2"><br><input type="radio" name="q2" value="correct">Jefferson City</span> <br><input type="radio" name="q2" value="wrong">Missourri City <br><input type="radio" name="q2" value="wrong">Omaha </li><br><br> <li><b> What is capital of wales:</b> <span id="correct3"><br><input type="radio" name="q3" value="correct">Cardiff</span> <br><input type="radio" name="q3" value="wrong">hankuva <br><input type="radio" name="q3" value="wrong">hong kong <br><input type="radio" name="q3" value="wrong">egypt </li><br> </li><br><li><b> What is capital of spain:</b> <span id="correct3"><br><input type="radio" name="q3" value="correct">Ahuhu</span> <br><input type="radio" name="q3" value="wrong">Bchec <br><input type="radio" name="q3" value="wrong">Cdoddoe <br><input type="radio" name="q3" value="wrong">quebec </li><br> </ol><br><br> <center><input type="button" onClick="checkQuiz()" value="check quiz"> <hr> <textarea cols="80" rows="10" name="output"></textarea></center> </form> </body> </html> Hello, i really need help making a quiz in html. I want to make a site where users can answer questions...but...i am on new ground here. I managed to do some cool things using ap div (thanks to dreaweaver, apdiv is a relatively simple tool for users like me) but now comes the hard part. I made a wrapper in wich i want to put my questions. But i do not know the code, can someone make an example for me? I also want to give grades to users after the test is finished. How do i do this? Let say i have the question : " The color of the sky is?" a. blue b. orange c. purple d. brown How do i write the code for this, and how do i write the code to give grades to the users after the test is finished. Please, please, please do not tell me to look on google because my head is going to explode. I am sorry for my bad english, it is not my first language. <div class="form" onkeypress="function" style="cursor:pointer"> <div class="float"' ><img src="images/Icon.png" alt="<bean:message key="button.ex" /></div> <div class="float"' ><img src="images/Icon.png" alt="<bean:message key="button.ex" /></div> </div> Writing this code three time will creat 3 buttons with text content.First two is corectly generated but third one is broken where java is on first line and package on another line while corect one is java package should be in same line withing third button.any idea? Please excuse my ignorance, I am very new and teaching myself! I have placed an image on my server but it's not displaying when i view the web page. I know it has something to do with where the picture is placed on the server so i am obviously asking it to look in the wrong place. The reason I know this is if I place the image directly in the public_html folder on the server the picture shows up fine, but when i ask it to look in /images/"picturename.jpg" it displays the red cross. Can I just leave it in the public_html folder for the website? or is this not recommended? Sorry again if I am being stupid! I just uploaded my site to a new host (my onld one closed down) and I'm having a problem with on of the internal links. It works fine on with the files on my computer, but when it got uploaded, it stoped working.... Ive deleted and re-uploaded both the target page and the one with the link and i cant figure it out.... any help would be much appresheated (sp?) http://dragons-lair.ifastnet.com/ the "cool links" on the navigation bar is the one im having trouble with. Also If anyone has time, could you check thre whoel site for broken links..... im one dial-up (crappy dial-up at that) and the pages load VERY slowly Hello, This would be my first post here, but I require some assistance. I'm sure it's a very basic problem, and I'm sure I'm just not looking at it hard enough (I'm also aware the coding is sloppy), but can anyone possibly explain why the images are appearing as broken? It seems to me that they aren't broken...but it's stumping me. Code: <center> <table width="549" border="1" bordercolor="#ffffff" cellpadding="0" cellspacing="0"> <tr bgcolor="#ffffff"> <td width="549" class="style2"><center><font color="#000000"><font color="#000000"><font face="Verdana" size="1"> <table align = center> <tr> <td width = 150> <b> <center> <font color="#000000"> '66 Astros <td width = 150> <i> <b> <center> <font color="#000000"> <font size = 2> First Round <td width = 150> <b> <center> <font color="#000000"> '92 Blue Jays <tr> <td width = 150 height = 100> <center> <img src="http://img247.imageshack.us/my.php?image=9yawe88ejagf9jthh3h3lf1.gif"> <td width = 150> <center> <font size = 3> <b><font color="#000000"> @ <td width= 150 height = 100> <center> <img src="http://img247.imageshack.us/my.php?image=1415so1.gif"> <tr> <td width = 150> <b> <center> <font color="#000000"> <font size = 4> 2 <td width = 150> <center> <font color="#000000"> <font size = 2> <b> <i> Skydome<br> Toronto, ON <td width = 150> <b> <center> <font color="#000000"> <font size = 4> 6 </table> </table> i have a website that has a few broken links on the footer (and only the footer of the page), i have the same footer / navigation bar (top and side) on every page, and all the links work on every page except the index. if you can help me find what's wrong with the index, please reply here i dont want to give out the source to my page to everyone. Thank's, -shannon (also the footer is the only navigation bar that has broken link's) Hello! I'm a real beginner when it comes to html, so sorry for my stupid questions. I've started making a logic quiz for my students using the following quiz code that I found online http://student.ccbcmd.edu/~abeiderm/.../quizCode.html http://student.ccbcmd.edu/~abeiderm/tims2005/quiz.html But I have encountered two problems. 1. When I write logical symbols that I want to appear in the textarea for the answer it doesn't print the symbol, only the code. How am I suppose to write the code to get the symbol? My code is now: //produce output in textarea. document.quiz.output.value += "The answer to question 1 is A ∨ ¬ A \n"; 2. I would like to be able to print peoples (in particular my students) answers to a file, so I can use the quiz as a test. Is this possible? Is there any sample of such a code, that I can just copy? thanks in advance! This is the webpage I'm updating for someone: http://savannahrhythms.ca/events.html In Firefox it looks perfect but in IE, two random images on the left side cannot show and the big poster on the right isn't flush with the top... WHAT DO I DO TO FIX THIS PLEASE?? Help. I made this page for a client but he tells me it is misaligned when he browses the page on his mac(both firefox and safari) http://www.freewebs.com/fernandosdesign/detox.html It looks perfectly fine on a pc (firefox and ie) any idea whats happening and how I can correct this issue? Thanks guys http://www.freewebs.com/fernandosdesign/detox.html Hey, i want to have a button which when pressed notifies me, it is to tell me if a link is broken. I dont want it to open a new page though. Thanks in advance. I understand this is the HTML section and I'll be posting a little Java. Let's say you're going to take an online quiz to see your IQ. To 'check' the answer your query has to be sent and checked with an existing copy/data, right? If I wanted to see the answer to question three on the IQ test where would I find the existing copy/data? For instance, how would I figure out the answer? HTML Code: <p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="bLight" nowrap valign="middle"> <!-- Screen Reader Anchor--> <a name="question_34"><img src="/images/spacer.gif" width=1 height=1 alt="Question 34 text" border="0"></a> <span class="questionNumber"> Question 34</span> </td> <td class="bLight" align="right" colspan="5" nowrap valign="middle"> <span class="points">2 points</span> </td> <td class="bLight" align="right" nowrap valign="middle"> <a href="javascript:saveItem('_12398139_1','34')" class="inlineAction">Save</a> </td> </tr> <tr> <td valign="middle" align="center" rowspan="2"> </td> <td colspan=2 valign="top" width="100%"> <label for="True/False-_4495108_1"><!--RsQ_002-->The sky is blue.</label> </td> </tr> <tr> <td colspan=2 valign="top"> <a name="question_34_answers"><img src="/images/spacer.gif" width=1 height=1 alt="Question 34 answers" border="0"></a> <table> <script type="text/javascript"> formCheckList.addElement(new Check_Answer({ref_label:"34",name:"tf-ans-_12398139_1"})); </script> <tr> <td> <input type=radio name="tf-ans-_12398139_1" id="tf-ans-_12398139_1_1" value="true" > </td> <td><label for="tf-ans-_12398139_1_1">True</label></td> </tr> <tr> <td> <input type=radio name="tf-ans-_12398139_1" id="tf-ans-_12398139_1_2" value="false" > </td> <td><label for="tf-ans-_12398139_1_2">False</label></td> </tr> </table> </td> </tr> </table> I'm new to HTML, so take it easy on me. I have just developed a series of quizzes to post on my Bible Web site. It works fine, but I'm wondering if there are any alternative ways of doing what I want. Here's how I designed each quiz. There is a "main" html file that creates two frames: <frameset rows="70%,30%"> <frame src="1SamuelQuiz.html" name="QuizFrame"> <frame src="BlankAnswerPage.html" name="AnswerFrame"> </frameset> Then I created an html file with all the quiz questions in a numbered list (1SamuelQuiz.html). Here's an example of one item from the list: <p>Who was David's father?</p> <p><a href="1SamuelAnswer1.html" target="AnswerFrame">Click here for answer.</a></p> When the user clicks for the answer, it appears in the lower frame, while the questions remain visible in the upper frame. As I said, everything works fine, just as designed. However, this method does require a separate html file for each individual answer. The more quizzes I create like this, the number of files increases at an alarming rate! Is there any alternative design that would still allow the user to click to see an answer while keeping the quiz questions visible? Thanks. Bill I finished building my roll-out menus for firefox, but they're not working in IE. Moreover they get stacked on top of eachother instead of next to eachother. http://www.problem-solving.be/dir0 Can anyone help me how to solve it? Here's the related CSS: Code: /* Drop-down menu */ .nav2 {} .nav2 ul { list-style-type:none; } .nav2 ul li { float:left; position:relative; z-index:auto !important /*Non-IE6*/; z-index:1000 /*IE6*/; background: #C7D0D7; /*url(images/css/css_cat_light.jpg) repeat-x;*/ left:-20; } .nav2 ul li a { float:none !important /*Non-IE6*/; float:left /*IE-6*/; display:block; height:28px; width:90px; line-height:28px; padding:0 20px 0 20px; text-decoration:none; font-weight:bold; color: #006699; } .nav2 ul li ul { display:none; border:none; } /* Non-IE6 hovering */ .nav2 ul li:hover a { text-decoration: none; } .nav2 ul li:hover ul { display:block; position:absolute; z-index:999; top:3.0em-6; left:-20; } .nav2 ul li:hover ul li a { display:block; width:88px; height:auto; line-height:1em; /*margin-left:50px;*/ padding:2px 20px 2px 20px; border-left:solid 1px rgb(175,175,175); border-right:solid 1px rgb(175,175,175); border-bottom: solid 1px rgb(175,175,175); background-color:#EFEFEF; font-weight:normal; color:rgb(50,50,50); } .nav2 ul li:hover ul li a:hover { background-color:#FFFFFF; } .nav2 ul li a:hover { /*background: #DFDFEF;*/ /*#006699;*/ /*url(images/css/css_cat.jpg) repeat-x; */ /*color:#DEEEF3;*/ } .nav2 table {position:absolute; top:0; left:0; border-collapse:collapse;} .nav2 ul li a:hover ul {display:block; position:absolute; z-index:999; top:3.1em; t\op:3.0em; left:0; marg\in-top:0.1em;} .nav2 ul li a:hover ul li a {display:block; height:1px; line-height:1.3em; padding:4px 16px 4px 16px; border-left:solid 1px rgb(175,175,175); border-bottom: solid 1px rgb(175,175,175); background-color:rgb(237,237,237); font-weight:normal; color:rgb(50,50,50);} /*Color subcells normal mode*/ .nav2 ul li a:hover ul li a:hover {background-color:rgb(210,210,210); text-decoration:none;} /*Color subcells hovering mode*/ Thanks! Hello webMasters!! I had a problem with my website the other day and someone helped me fix it almost immediately! THANK YOU! I came across another problem, this one is particularly tricky because I cannot find where the code is broken. . . under my website on this link. .. http://www.rentxotic.com/?page=exotic-car-fleet you will see some pictures of cars. Originally if you were to mouse over the cars, some specs would pop up. Now for some reason I do not know why the specs dont pop up when you mouse over. I saw all the code, I am a novice but nothing pops out at me that looks wrong. Would appreciate any help!!!! - Ryan On our website, when it switches to HTTPS, some images are broken... but it is at random. The next page load, the broken images are just fine... but others that were fine are now broken. Any idea how this happens? Everything works fine on FireFox, this is only on IE. I am using IE6.0 on WinXP. Perhaps it is just my browser settings causing this issue? To see it, you can access our website: www.frpgames.com add any product to your shopping cart, click on the checkout cart, then click the checkout button, then click "Checkout without account". That should be the first secure page. Any help would be great! This issue is driving me crazy. Hi Im new on here but am posting because my webmaster bailed on me and Im trying to fix a problem on my website. . . On my homepage I have a footer that is not appearing in the bottom of the page, it's in the middle and is very annoying because my HOME page looks unprofessional. . . Can anyone help me on how to fix this. My home page is www.rentxotic.com when you go there you will see what I mean. . . Thanks for any help. Hello everyone. Below is the html code for a quiz i want to use for my website. What I want to do is, upon completion of the quiz, have 2 new text-entry forms and 1 "submit" button form appear at the bottom of the page asking the user to input one's name and email address before they can submit the results of their quiz. Both fields would be required.. <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Knowledge Assessment Tool</title> <script src="assessment.js" type="text/javascript"></script> <script src="quiz.js" type="text/javascript"></script> <link rel="stylesheet" href="quiz.css" type="text/css"> </head> <body bgcolor="#FFFFFF"> <p><font color="#2431A2"><u><b>10 Point Quiz</b></u></font></p> <div id="quiz1"></div> <div id="quiz2"></div> ** </body> </html> ** denotes where the text and submit button would show up after the quiz is completed asking the user for name/email address. As you can tell I have no clue how to acheive this. Any help is greatly appreciated. Thank you. Hello everyone, I've been racing to learn html/css in the past couple weeks to throw up a website, and so far so good. But: I've searched the internet and I cannot find an answer to my questions. The page in question is: http://www.andrew.cmu.edu/user/jonmille/projects.html style sheet (relevant section is in the "Programming: List Settings" section) http://www.andrew.cmu.edu/user/jonmille/style.css You can see that the gray borders under the text/images have a small break in them. I assume it has something to do with the fact that I'm using two columns. How do I fix this and make a solid border (in a non hackish way)? Note: if you say "use css/divs," I wrestled with those for about two hours before I gave up and made a table. Secondly, in IE7, all the images/text are completely flushed left, ignoring the table padding. How can I fix this? Note, I've never checked this site in IE6 or below, and never will, so if it looks wrong in IE6, then the user doesn't deserve to see my site anyway. Thanks for your time! Jon Hello there, My index page validates completely since I tidied it up using html tidy, but when i run it through browsershots it is still completely broken in firefox, opera, etc. basically anything other than MSIE it displays incorrectly. If anyone could shed any potential light on the situation it would be greatly appreciated. As you can no doubt tell, I'm no expert on creating web pages using html and css and if a page validates but still doesn't work I can't even begin to try and work out what is going on I did run my css through a validator and it came up with 30 or so instances of the same error, I hadn't ended a dimension value with px, i had just left the number, could this be the culprit? I have since corrected my style sheet so that it validates completely but I cannot upload from my FTP on the PC i'm currently using to see if it affects the browsershots results. I just wanted to put it out there and see what the ideas were of people who know a lot more about website building than I do. Bottom line: if i have an html page and a css page that validate 100% using the w3c standard is it guaranteed to work in all browsers, or are there quirky little things I need to be aware of when wanting my site to display correctly in less popular browsers such as safari etc.? Any feedback is greatly appreciated. :-) Sincere thanks in advance, Alex Browser screenshots - http://browsershots.org/http://www.alexhaines.co.uk/ HTML Validity results - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.alexhaines.co.uk%2Findex.html&charset=%28detect+automatically%29&doctype= Inline&group=0 CSS Validity results - http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.alexhaines.co.uk%2Fstyle.css&profile=css21&usermedium=all&warning=1&l ang=en My site - http://www.alexhaines.co.uk |