Advertisement
Guest User

quiz taking code

a guest
Jul 30th, 2014
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <meta charset="utf-8" />
  5.         <title>TakeQuiz - My ASP.NET MVC Application</title>
  6.         <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  7.         <meta name="viewport" content="width=device-width" />
  8.        
  9.     <link href="style.css" rel="stylesheet" type="text/css" />
  10.  
  11.     <style type="text/css">
  12.  
  13.  
  14.  
  15. #category1 { display: none; }#category2 { display: none; }
  16.         #allcorrect
  17.         {
  18.             display: none;
  19.         }
  20.  
  21.  
  22.  
  23.     </style>
  24.  
  25.         <link href="/Content/site.css" rel="stylesheet"/>
  26.  
  27.         <script src="/Scripts/modernizr-2.5.3.js"></script>
  28.  
  29.     </head>
  30.     <body>
  31.         <header>
  32.             <div class="content-wrapper">
  33.                 <div class="float-left">
  34.                     <p class="site-title"><a href="/">your logo here</a></p>
  35.                 </div>
  36.                 <div class="float-right">
  37.                     <section id="login">
  38.                             <ul>
  39.         <li><a href="/Account/Register" id="registerLink">Register</a></li>
  40.         <li><a href="/Account/Login" id="loginLink">Log in</a></li>
  41.     </ul>
  42.  
  43.                     </section>
  44.                     <nav>
  45.                         <ul id="menu">
  46.                             <li><a href="/">Home</a></li>
  47.                             <li><a href="/Home/About">About</a></li>
  48.                             <li><a href="/Home/Contact">Contact</a></li>
  49.                         </ul>
  50.                     </nav>
  51.                 </div>
  52.             </div>
  53.         </header>
  54.         <div id="body">
  55.            
  56.             <section class="content-wrapper main-content clear-fix">
  57.                
  58.  
  59. <script src="jquery.js"></script>
  60. <script type="">
  61. $(document).ready(function () {
  62. $("#results").click(function () {
  63. if (
  64.  
  65.  
  66. !$("input[@name=q1]:checked").val()||!$("input[@name=q2]:checked").val()
  67.    
  68. )
  69. {
  70. alert("You're not done yet!");
  71. }
  72. else{
  73.  
  74. var cat1name = "1";
  75. var cat2name = "2";
  76.  
  77. var cat1 = ($("input[@name=q1]:checked").val() != "a");
  78. var cat2 = ($("input[@name=q2]:checked").val() != "b");
  79.    
  80. var cat11 = (!cat1 && !cat2);
  81.  
  82. var categories = [];
  83.  
  84. if (cat1) { categories.push(cat1name) };          
  85. if (cat2) { categories.push(cat2name) };            
  86.  
  87. $("#category1").hide()
  88. $("#category2").hide()
  89.  
  90. if (cat1) { $("#category1").show("slow"); };          
  91. if (cat2) { $("#category2").show("slow"); };          
  92.  
  93. }
  94. });
  95. });
  96.    
  97. </script>
  98.  
  99. <h2>Take Quiz:  first private quiz</h2>
  100.  
  101.  
  102.  
  103.                 <p class="question">1. how many woodchucks chuck??</p>  
  104.                 <ul class="answers">
  105.  
  106.  
  107.                     <input type="radio" name="q1" value="a" id="q1a" ><label for="q1a">1000</label><br/>
  108.                     <input type="radio" name="q1" value="b" id="q1b" ><label for="q1b">many</label><br/>
  109.                 </ul>
  110.                 <p class="question">2. why is this private??</p>  
  111.                 <ul class="answers">
  112.  
  113.  
  114.                     <input type="radio" name="q2" value="a" id="q2a" ><label for="q2a">because it contains top secret stuff</label><br/>
  115.                     <input type="radio" name="q2" value="b" id="q2b" ><label for="q2b">because its silly</label><br/>
  116.                 </ul>
  117.  
  118. <br/>
  119. <div id="results">            
  120. Show me the answers!      
  121. </div>      
  122.  
  123.  
  124.  
  125.             <div id="category1">
  126.                 <p>
  127.                     <strong>Question 1:</strong> The correct answer is <strong>1000</strong>
  128.                 </p>
  129.             </div>
  130.             <div id="category2">
  131.                 <p>
  132.                     <strong>Question 2:</strong> The correct answer is <strong>because it contains top secret stuff</strong>
  133.                 </p>
  134.             </div>
  135.  
  136. <div id="allcorrect">            
  137. <p>                
  138. You answered them all right!</p>        
  139. </div>
  140.             </section>
  141.         </div>
  142.         <footer>
  143.             <div class="content-wrapper">
  144.                 <div class="float-left">
  145.                     <p>&copy; 2014 - My ASP.NET MVC Application</p>
  146.                 </div>
  147.             </div>
  148.         </footer>
  149.  
  150.         <script src="/Scripts/jquery-1.7.1.js"></script>
  151.  
  152.        
  153.     </body>
  154. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement