Advertisement
Guest User

Miki.html

a guest
Apr 20th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.38 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!--Template HTML page: copypasta; do NOT modify this file directly!-->
  3.   <html xmlns="http://www.w3.org/1999/xhtml">
  4.     <head>
  5.       <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
  6.       <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  7.         <title>Sample Quiz</title>
  8.       <style type="text/css">
  9.       </style>
  10.       <script type="text/javascript">
  11.         var questions = [
  12.             {
  13.                 question: "Q1 blah blah blah",
  14.                 answers: [ "ans1.1", "ans1.2", "ans1.3", "ans1.4" ]
  15.             },
  16.             {
  17.                 question: "Q2 blah blah blah",
  18.                 answers: [ "ans2.1", "ans2.2", "ans2.3", "ans2.4" ]
  19.             },
  20.             {
  21.                 question: "Q3 blah blah blah",
  22.                 answers: [ "ans3.1", "ans3.2", "ans3.3", "ans3.4" ]
  23.             },
  24.             {
  25.                 question: "Q4 blah blah blah",
  26.                 answers: [ "ans4.1", "ans4.2", "ans4.3", "ans4.4" ]
  27.             },
  28.             {
  29.                 question: "Q5 blah blah blah",
  30.                 answers: [ "ans5.1", "ans5.2", "ans5.3", "ans5.4" ]
  31.             },
  32.             {
  33.                 question: "Q6 blah blah blah",
  34.                 answers: [ "ans6.1", "ans6.2", "ans6.3", "ans6.4" ]
  35.             },
  36.             {
  37.                 question: "Q7 blah blah blah",
  38.                 answers: [ "ans7.1", "ans7.2", "ans7.3", "ans7.4" ]
  39.             },
  40.             {
  41.                 question: "Q8 blah blah blah",
  42.                 answers: [ "ans8.1", "ans8.2", "ans8.3", "ans8.4" ]
  43.             },
  44.             {
  45.                 question: "Q9 blah blah blah",
  46.                 answers: [ "ans9.1", "ans9.2", "ans9.3", "ans9.4" ]
  47.             },
  48.             {
  49.                 question: "Q10 blah blah blah",
  50.                 answers: [ "ans10.1", "ans10.2", "ans10.3", "ans10.4" ]
  51.             }
  52.         ];
  53.  
  54.         var qnum = 1;
  55.  
  56.         while (true) {
  57.             document.write("blah blah blah","<br/>");
  58.             var reply = prompt("Response?");
  59.             if (reply == "no") {
  60.                 break;
  61.             }
  62.             else if (reply == "yes") {
  63.                 while (qnum <= 10) {
  64.                     document.write ("<table border = 1>");
  65.                     // Generate random question
  66.                     var rand = Math.floor(Math.random() * 10);
  67.                     document.write(qnum,". ");
  68.                     document.write(questions[rand].question,"<br/>");
  69.                     for (i = 0; i < questions[rand].answers.length; i++) {
  70.                         document.write("<td>",questions[rand].answers[i],"</td>");
  71.                     }
  72.                     document.write("</table>");
  73.                     var answer = prompt("Answer goes here");
  74.                     qnum++;
  75.                 }
  76.             }
  77.             if (qnum == 10) {
  78.                 break;
  79.             }
  80.         }
  81.       </script>
  82.     </head>
  83.     <body>
  84.     </body>
  85.   </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement