313.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?
  2. session_start();
  3. echo "<meta charset=utf8>";
  4. if ($_SESSION['id'] == '' || $_SESSION['id'] == null) {
  5. echo '您尚未登入';
  6. exit;
  7. }
  8. include "connect.php";
  9. $userid = $_SESSION['name'];
  10. $sql = "SELECT User_ID,p313 FROM coursepagecount WHERE User_ID = '" . $userid . "'";
  11. $result = mysql_query($sql) or die('MySQL query error');
  12. $row = mysql_fetch_array($result);
  13. $num = $row[1] + 1;
  14. if ($num < 10) {
  15. $count = "0" . (string) ($num);
  16. } else {
  17. $count = "" . (string) ($num);
  18. }
  19. $sql = "UPDATE coursepagecount SET p313= '" . $num . "' WHERE User_ID='" . $userid . "'";
  20. $result = mysql_query($sql) or die('MySQL query error');
  21. mysql_close($link);
  22. ?>
  23. <html>
  24. <head>
  25. <title>Exam</title>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  28. <meta name="mobile-web-app-capable" content="yes">
  29. <meta name="apple-mobile-web-app-capable" content="yes" />
  30. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  31. <META http-equiv="Cache-Control" content="no-cache">
  32. <META http-equiv="Pragma" content="no-cache">
  33. <META http-equiv="Expires" content="0">
  34. <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  35. <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  36. <script src="./fingers.js"></script>
  37. <script src="./function2.js"></script>
  38. <script src="../public/js/layui/layui.js"></script>
  39. <script src="layer.js"></script>
  40. <script type="text/javascript">
  41. saveRecord("33111<?echo $count ?>");
  42. </script>
  43. <script>
  44. var arrow;
  45. var i = 0;
  46. function checkCorrect(){
  47. var correct=document.getElementById("correct");
  48. var wrong=document.getElementById("wrong");
  49. var check=document.getElementById("check");
  50. var blank=document.getElementById("blank");
  51. var next=document.getElementById("next");
  52. var back=document.getElementById("back");
  53. var checkButton29 = document.getElementById("checkButton29");
  54. if(arrow.checkRes()){
  55. setTimeout(
  56. function(){
  57. correct.style.display = "inline";
  58. //correct.style.left =600;
  59. //correct.style.top = -250;
  60. back.style.display = "inline";
  61. //back.style.left = 560;
  62. //back.style.top = -150;
  63. next.style.display = "inline";
  64. //next.style.left = 690;
  65. //next.style.top = -150;
  66. },3000)
  67. saveRecord(100);
  68. }
  69. else{
  70. setTimeout(
  71. function(){
  72. wrong.style.display = "inline";
  73. //wrong.style.left = 600;
  74. //wrong.style.top = -250;
  75. back.style.display = "inline";
  76. //back.style.left = 560;
  77. //back.style.top = -150;
  78. next.style.display = "inline";
  79. //next.style.left = 690;
  80. //next.style.top = -150;
  81. },3000)
  82. saveRecord(200);
  83. }
  84. //blank.className="hidden";
  85. }
  86. this.onload = function() {
  87. arrow=new FingerComponent(["left-item"],"right-item");
  88. }
  89. </script>
  90. <style>
  91. .defaultHideBtn{
  92. position:absolute;
  93. display: none;
  94. z-index: 5;
  95. }
  96. .contentDiv{
  97. position:relative;
  98. margin: 0px auto;
  99. width: 800px;
  100. height: 720px;
  101. }
  102. .defaultPage{
  103. position:relative;
  104. display: inline;
  105. left: 0px;
  106. top: 0px;
  107. }
  108. .hidden{
  109. position:absolute;
  110. display :none;
  111. }
  112. .right-container{
  113. position: relative;
  114. left: 520px;
  115. top: -500px;
  116. width: 190px;
  117. height: 165px;
  118. overflow: hidden;
  119. z-index: 4;
  120. }
  121. .right-item{
  122. width: 195;
  123. height: 259;
  124. }
  125. .left-item{
  126. width: 195;
  127. height: 259;
  128. position:absolute;
  129. left: 300px;
  130. top: -350px;
  131. z-index: 2;
  132. }
  133. .checkAnswer{
  134. position:absolute;
  135. display: inline;
  136. left: 350px;
  137. top: -200px;
  138. width: 150px;
  139. z-index: 4;
  140. }
  141. /**修改内容 */
  142. #check{
  143. top: 50;
  144. left:100;
  145. }
  146. #correct{
  147. top: 50;
  148. left:100;
  149. }
  150. #wrong{
  151. top: 50;
  152. left:100;
  153. }
  154. #back{
  155. top: 700;
  156. left:400
  157. }
  158. #next{
  159. top: 700;
  160. left:550;
  161. }
  162. .btns{
  163. position:absolute;
  164. display: inline;
  165. width: 150px;
  166. z-index: 4;
  167. }
  168. .checkAnswer{
  169. top:600;
  170. left: 550;
  171. }
  172. #tooltip1
  173. {
  174. left: 150;
  175. top:600;
  176. }
  177. #tooltip2
  178. {
  179. left: 350;
  180. top:600;
  181. }
  182. .tooltipPhoto{
  183. position:absolute;
  184. display: none;
  185. left: 0;
  186. top: -500;
  187. z-index: 101;
  188. transform:scale(1);
  189. }
  190. .left-item{
  191. top: -250px;
  192. }
  193. </style>
  194. </head>
  195. <body>
  196. <div class="contentDiv">
  197. <div class="defaultPage" id="contentDiv">
  198. <img class="tooltipPhoto" id="tooltipPhoto" src="img/313a_1.png"/>
  199. <img id="blank" src="img/313pq.png" style="width:800;height:600">
  200. <img id="check" src="image/check.jpg" class="hidden"/>
  201. <img id="correct" src="image/correct.jpg" class="hidden"/>
  202. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  203. <img id="left-item" src="img/313p.png" class="left-item">
  204. <div class="right-container">
  205. <img id="right-item" src="img/313p.png" class="right-item">
  206. </div>
  207. </div>
  208. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(33419<?echo $count ?>,312)"/>
  209. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(33419<?echo $count ?>,'313A')"/>
  210. <button class="checkbutton btns" id="tooltip1" onclick="tooltipPhoto()">圖形提示</button>
  211. <button class="checkbutton btns" id="tooltip2" onclick="tooltip('313a_2.png',2)">文字提示</button>
  212. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect2(checkCorrect());">確認答案</button>
  213. </div>
  214. <script>
  215. showtooltipPhoto = false;
  216. </script>
  217. </body>
  218. </html>