rahul_10

Untitled

Mar 2nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>E-LAT</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  9. <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  10. <link rel="stylesheet" type="text/css" href="aa.css">
  11. </head>
  12.  
  13. <!---------- to disable right click ---------------------------->
  14. <script language="javascript">
  15. document.onmousedown=disableclick;
  16. status="Right Click Disabled";
  17. function disableclick(event)
  18. {
  19. if(event.button==2)
  20. {
  21. return false;
  22. }
  23. }
  24. </script>
  25.  
  26. <!---------- to disable copy ---------------------------->
  27. <script language=JavaScript>
  28. function ieClicked() {
  29. if (document.all) {
  30. return false;
  31. }
  32. }
  33. function firefoxClicked(e) {
  34. if(document.layers||(document.getElementById&&!document.all)) {
  35. if (e.which==2||e.which==3) {
  36. return false;
  37. }
  38. }
  39. }
  40. if (document.layers){
  41. document.captureEvents(Event.MOUSEDOWN);
  42. document.onmousedown=firefoxClicked;
  43. }else{
  44. document.onmouseup=firefoxClicked;
  45. document.oncontextmenu=ieClicked;
  46. }
  47. document.oncontextmenu=new Function("return false")
  48. function disableselect(e){
  49. return false
  50. }
  51. function reEnable(){
  52. return true
  53. }
  54. document.onselectstart=new Function ("return false")
  55. if (window.sidebar){
  56. document.onmousedown=disableselect
  57. document.onclick=reEnable
  58. }
  59. </script>
  60.  
  61. <body oncontextmenu="return false" oncopy="return false" oncut="return false" onpaste="return false" >
  62.  
  63.  
  64. <!------------------------------------------ connection----------------------------->
  65.  
  66. <?php
  67. $servername = "127.0.0.1";
  68. $username = "root";
  69. $password = "123456";
  70. $dbname = "my_proj";
  71.  
  72. // Create connection
  73. $conn = new mysqli($servername, $username, $password, $dbname);
  74. // Check connection
  75. if ($conn->connect_error) {
  76. die("Connection failed: " . $conn->connect_error);
  77. }
  78. $sql = "SELECT * FROM question";
  79. $result = $conn->query($sql);
  80.  
  81. //$row = $result->fetch_assoc() ;
  82.  
  83. /* if ($result->num_rows > 0)
  84. {
  85. // output data of each row
  86. while($row = $result->fetch_assoc())
  87. {
  88. echo "id: " . $row["q_id"]. "<br>";
  89. }
  90. }
  91. else {
  92. echo "0 results";
  93. }*/
  94.  
  95.  
  96. ?>
  97.  
  98. <nav class="navbar navbar-inverse" >
  99. <div class="container-fluid" >
  100. <div class="navbar-header">
  101. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
  102. <span class="icon-bar"></span>
  103. <span class="icon-bar"></span>
  104. <span class="icon-bar"></span>
  105. </button>
  106. <!-- <a class="navbar-brand" href="#">Logo</a>-->
  107. </div>
  108.  
  109.  
  110.  
  111. <div class="collapse navbar-collapse" id="myNavbar">
  112. <ul class="nav navbar-nav">
  113. <li class="active"><a href="#">E-Lat Online Test Portal</a></li>
  114. </ul>
  115. <!-- Trigger the modal with a button -->
  116. <ul class="nav navbar-nav navbar-right">
  117. <li><a href="#" data-toggle="modal" data-target="#myModal"><span class="glyphicon glyphicon-list-alt"></span> Instructions</a></li>
  118.  
  119. <div class="modal fade" id="myModal" role="dialog">
  120. <div class="modal-dialog modal-lg">
  121. <div class="modal-content">
  122. <div class="modal-header">
  123. <button type="button" class="close" data-dismiss="modal">&times;</button>
  124. <h4 class="modal-title">Instructions to follow</h4>
  125. </div>
  126. <div class="modal-body">
  127. <p>Keep on doing the good work.</p>
  128. </div>
  129. <div class="modal-footer">
  130. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </ul>
  136. </div>
  137. </div>
  138. </nav>
  139.  
  140. <div class="container-fluid text-center">
  141. <div class="row content">
  142.  
  143. <!-------------------- Left ------------------------>
  144.  
  145. <div class="col-sm-3 sidenav">
  146. <div style="background-color:#555;border-radius:10px;padding-bottom:1px;padding-top:5px">
  147. <p class= "text-center" style="font-size:14px; color: #ffffff"><strong>Question list</strong></p>
  148. </div>
  149. <div style="margin-top:10px;">
  150. <p style="color:black ">Logical Reasoning</p>
  151. </div>
  152. <div class="pre-scrollable" style="height:700px;padding-bottom:30px;border-radius:10px;">
  153.  
  154. <?php if ($result->num_rows > 0)
  155. {
  156. $i = 1;
  157. while($row = $result->fetch_assoc())
  158. {
  159. $p = $row["description"] ;
  160. echo '<div onclick="myOverFunction(\''. $p .'\')" align="left" class="j" role="group" aria-label="..." > <button id = "btnl'.$i.'" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">'.$i.'</button><p class="question" style ="display:inline; ">'.$p.'</p></div>';
  161.  
  162. $i=$i+1;
  163. }
  164. }
  165. ?>
  166. <!-----------------------
  167. <div onclick="myOverFunction(<?= $i ?>)" align="left" class="j" role="group" aria-label="..." > <button id = "btnl<?=$i?>" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;"><?= $i ?></button>
  168.  
  169. </div>
  170.  
  171. //echo $row["q_id"] ;
  172.  
  173. <?= $i++; ?>
  174. }
  175. }
  176. else {
  177. <?php echo "Please insert rowsw in the database. "; ?>
  178. }
  179. ------------------------------------>
  180.  
  181. <!--------------------------------------------------------------------------------------------------------
  182. <div onclick="myOverFunction(2)" class="j" role="group" aria-label="...">
  183. <button id = "btnl2" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">2</button>
  184. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  185. </div>
  186.  
  187.  
  188. <div onclick="myOverFunction(3)" class="j" role="group" aria-label="...">
  189. <button id = "btnl3" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">3</button>
  190. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  191. </div>
  192.  
  193. <div onclick="myOverFunction(4)" class="j" role="group" aria-label="...">
  194. <button id = "btnl4" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">4</button>
  195. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  196. </div>
  197. --------------------------------------------------------------------------------------------------------------------------------->
  198. <div onclick="myOverFunction(5)" class="j" role="group" aria-label="...">
  199. <button id = "btnl5" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">5</button>
  200. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  201. </div>
  202.  
  203. <div class="j" role="group" aria-label="...">
  204. <button id = "btnl6" type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">6</button>
  205. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  206. </div>
  207.  
  208. <div class="j" role="group" aria-label="...">
  209. <button type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">7</button>
  210. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  211. </div>
  212.  
  213. <div class="j" role="group" aria-label="...">
  214. <button type="button" class="btn btn-default btn-xs btn-round" style="border-radius:10px;">18</button>
  215. <p class="question" style ="display:inline;">Question one is going to be here which is connected to AJAX for display in latter sections</p>
  216. </div>
  217.  
  218. </div>
  219. </div>
  220.  
  221. <!------------- Middle ------------------------>
  222. <div class="col-sm-6 text-left">
  223.  
  224. <div class="well well-sm" style="background-color:#FFFFFF;margin-top:10px;">
  225. <button type="button" class="btn btn-primary" style="border-radius:5px;width:140px;">Logical Reasoning</button>
  226. <button type="button" class="btn btn-info disabled" style="border-radius:5px;width:140px;">Quanti</button>
  227. <button type="button" class="btn btn-info disabled"style="border-radius:5px;width:140px;">English</button>
  228. </div>
  229.  
  230.  
  231. <div class="pre-scrollable" style="height:300px;background-color:#FFFFFF;border-radius:10px;padding-bottom:40px;margin-top:20px;">
  232.  
  233. <p>Directions for question:</p>
  234. <?php
  235. $sql = "SELECT * FROM question";
  236. $result = $conn->query($sql);
  237. $row = $result->fetch_assoc();
  238.  
  239. ?>
  240. <p id= "demo"> <?= $row["description"]; ?> </p>
  241.  
  242. <p>Question:</p>
  243. <div class="question_box">
  244. <p> <?= $row["question"]; ?></p>
  245. </div>
  246.  
  247. <form action="">
  248. <input type="radio" name="option" value="A"> A. <?= $row["op1"]; ?></br>
  249. <input type="radio" name="option" value="B"> B. <?= $row["op2"]; ?><br>
  250. <input type="radio" name="option" value="C"> C. <?= $row["op3"]; ?><br>
  251. <input type="radio" name="option" value="D"> D. <?= $row["op4"]; ?>
  252. </form>
  253.  
  254.  
  255. </div>
  256.  
  257. <div style="margin-top:20px;">
  258. <button type="button" class="btn btn-primary" style="border-radius:5px;width:150px;">Mark for Review</button>
  259. <button type="button" class="btn btn-primary" style="border-radius:5px;width:150px;display:inline;margin-left:3px;">Clear Response</button>
  260. <button type="button" class="btn btn-success " style="border-radius:5px;width:150px;display:inline;margin-left:50px;">Save & Next <span class="glyphicon glyphicon-arrow-right"></span></button>
  261.  
  262.  
  263. </div>
  264.  
  265. </div>
  266.  
  267. <!------------- Right----------------------->
  268. <div class="col-sm-3 sidenav">
  269. <div class="pre-scrollable" style="height:55% ;" >
  270. <p style="color:black">ANSWER SHEET</p>
  271. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">1</button>
  272. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">2</button>
  273. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">3</button>
  274. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">4</button>
  275. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">5</button>
  276. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">6</button>
  277. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">7</button>
  278. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">8</button>
  279. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">9</button>
  280. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">10</button>
  281. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">11</button>
  282. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">12</button>
  283. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">13</button>
  284. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">14</button>
  285. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">15</button>
  286. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">16</button>
  287. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">17</button>
  288. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">18</button>
  289. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">19</button>
  290. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">20</button>
  291. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">8</button>
  292. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">9</button>
  293. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">10</button>
  294. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">11</button>
  295. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">12</button>
  296. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">13</button>
  297. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">14</button>
  298. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">15</button>
  299. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">16</button>
  300. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">17</button>
  301. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">18</button>
  302. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">19</button>
  303. <button type="button" class="btn btn-default" style="border-radius:20px;width:40px;margin-left:7px;margin-top:7px;">20</button>
  304.  
  305.  
  306. </div>
  307.  
  308. <div class="jumb">
  309.  
  310. <button type="button" class="btn btn-default" style="mrgin-left:0px;" ><p style="font-size:10px;"> Not Visited</p></button>
  311. <button type="button" class="btn btn-success"style="mrgin-left:3px;"><p style="font-size:10px;">Answered</p></button>
  312. <button type="button" class="btn btn-danger" style="display:inline"><p style="font-size:10px;">Not Answered</p></button>
  313. <button type="button" class="btn btn-primary" style="display:inline"><p style="font-size:10px;">Marked</p></button>
  314. <button type="button" class="btn btn-warning" style="display:inline"><p style="font-size:10px;">Marked & Answered</p></button>
  315.  
  316. </div>
  317. <div style="margin-top:20px;">
  318.  
  319. <button type="button" class="btn btn-danger"><span class="glyphicon glyphicon-off"></span> Finish Test</button>
  320. <div>
  321. </div>
  322. </div>
  323. </div>
  324.  
  325. <script>
  326. function myOverFunction(\''. $p .'\') {
  327. console.log($p);
  328. document.getElementById("demo").innerHTML = "dfhdf";
  329. document.getElementById("btnl"+x).style.backgroundColor = "#d9534f";
  330. }
  331. </script>
  332.  
  333. <?php
  334. $conn->close();
  335. ?>
  336.  
  337. </body>
  338. </html>
Add Comment
Please, Sign In to add comment