Advertisement
RokiAdhytama

Quiz 2 - Chapter 12-1

Jul 4th, 2022
661
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html xmlns = "http://www.w3.org/1999/xhtml">
  2. <head>
  3. <title>Online Quiz</title>
  4.  
  5. <script type = "text/JavaScript">
  6.    <!--
  7.    function checkAnswers()
  8.    {
  9.       // determine whether the answer is correct
  10.       if ( myQuiz.radiobutton[ 1 ].checked )
  11.          window.opener.quizSpot.innerText =
  12.             "Congratulations, your answer is correct";
  13.       else // if the answer is incorrect
  14.          window.opener.quizSpot.innerHTML= "Your answer is incorrect." +
  15.             " Please try again <br /> <a href= \" JavaScript:openQuiz()" +
  16.             " \" > Please take our quiz</a>";
  17.      
  18.       window.opener.focus();
  19.      window.close();
  20.    } // end checkAnswers function
  21.    //-->
  22. </script>
  23.  
  24. </head>
  25.  
  26. <body>
  27.    <form id = "myQuiz" action = "JavaScript:checkAnswers()">
  28.    <p>Select the name of the tip that goes with the image shown:<br />
  29.    <img src = "EPT.gif" width = "108" height = "100"
  30.       alt = "mystery tip"/>
  31.       <br />
  32.  
  33.       <input type = "radio" name = "radiobutton" value = "CPE" />
  34.       <label>Common Programming Error</label>
  35.  
  36.       <input type = "radio" name = "radiobutton" value = "EPT" />
  37.       <label>Error-Prevention Tip</label>
  38.  
  39.       <input type = "radio" name = "radiobutton" value = "PERF" />
  40.       <label>Performance Tip</label>
  41.  
  42.       <input type = "radio" name = "radiobutton" value = "PORT" />
  43.       <label>Portability Tip</label><br />
  44.  
  45.       <input type = "submit" name = "submit" value = "Submit" />
  46.       <input type = "reset" name = "reset" value = "Reset" />
  47.    </p>
  48.    </form>
  49. </body>
  50. </html>
Advertisement
RAW Paste Data Copied
Advertisement