310.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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,p310 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 p310 = '" . $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="jquery.ui.touch-punch.min.js"></script>
  37. <script src="./fingers.js"></script>
  38. <script src="./function.js"></script>
  39. <script src="./function10.js"></script>
  40. <script src="../public/js/layui/layui.js"></script>
  41. <script src="layer.js"></script>
  42. <script type="text/javascript">
  43. saveRecord("33111"+<?echo $count ?>);
  44. </script>
  45. <script>
  46. var arrow;
  47. var i = 0;
  48. function checkCorrect(){
  49. var correct=document.getElementById("correct");
  50. var wrong=document.getElementById("wrong");
  51. var check=document.getElementById("check");
  52. var blank=document.getElementById("blank");
  53. var next=document.getElementById("next");
  54. var back=document.getElementById("back");
  55. var checkButton29 = document.getElementById("checkButton29");
  56. if(arrow.checkRes()){
  57. setTimeout(
  58. function(){
  59. //check.style.display = "none";
  60. correct.style.display = "inline";
  61. /*correct.style.left =630;
  62. correct.style.top = -200;*/
  63. back.style.display = "inline";
  64. /*back.style.left = 630;
  65. back.style.top = -100;*/
  66. next.style.display = "inline";
  67. /*next.style.left = 750;
  68. next.style.top =-100;*/
  69. },3000)
  70. saveRecord(100);
  71. }
  72. else{
  73. setTimeout(
  74. function(){
  75. //check.style.display = "none";
  76. wrong.style.display = "inline";
  77. /*wrong.style.left = 630;
  78. wrong.style.top = -200;*/
  79. back.style.display = "inline";
  80. /*back.style.left = 630;
  81. back.style.top = -100;*/
  82. next.style.display = "inline";
  83. /*next.style.left = 750;
  84. next.style.top = -100;*/
  85. },3000)
  86. saveRecord(200);
  87. }
  88. //blank.className="hidden";
  89. }
  90. this.onload = function() {
  91. arrow=new FingerComponent(["left-item"],"right-item");
  92. }
  93. </script>
  94. <style>
  95. .defaultHideBtn{
  96. position:absolute;
  97. display: none;
  98. z-index: 5;
  99. }
  100. .contentDiv{
  101. position:relative;
  102. margin: 0px auto;
  103. width: 800px;
  104. height: 720px;
  105. }
  106. .defaultPage{
  107. position:relative;
  108. display: inline;
  109. left: 0px;
  110. top: 0px;
  111. }
  112. .hidden{
  113. position:absolute;
  114. display :none;
  115. }
  116. .right-item{
  117. position:absolute;
  118. display: inline;
  119. left: 510;
  120. top: -450;
  121. width: 200;
  122. height:200;
  123. z-index: 100;
  124. }
  125. .left-item{
  126. position:absolute;
  127. display: inline;
  128. left: 60;
  129. top: -250;
  130. width: 200;
  131. height:200;
  132. z-index: 100;
  133. }
  134. .checkAnswer{
  135. position:absolute;
  136. display: inline;
  137. left: 520px;
  138. top: 500px;
  139. width: 150px;
  140. z-index: 10;
  141. }
  142. /**修改内容 */
  143. .left-item{
  144. top: -150;
  145. }
  146. .checkAnswer{
  147. top: 600;
  148. }
  149. #check{
  150. top: 50;
  151. left:100;
  152. }
  153. #correct{
  154. top: 50;
  155. left:100;
  156. }
  157. #wrong{
  158. top: 50;
  159. left:100;
  160. }
  161. #back{
  162. top: 100;
  163. left:400
  164. }
  165. #next{
  166. top: 100;
  167. left:550;
  168. }
  169. .tooltipPhoto{
  170. position:absolute;
  171. display: none;
  172. left: 0;
  173. top: -550;
  174. z-index: 101;
  175. transform:scale(1);
  176. }
  177. .btns{
  178. position:absolute;
  179. width: 150px;
  180. z-index: 10;
  181. }
  182. </style>
  183. <head>
  184. <body>
  185. <div class="contentDiv">
  186. <div class="defaultPage" id="contentDiv">
  187. <img class="tooltipPhoto" id="tooltipPhoto" src="img/310a_1.png"/>
  188. <img id="blank" src="img/310q.png" style="width:800px"/>
  189. <img id="check" src="image/check.jpg" class="hidden"/>
  190. <img id="correct" src="image/correct.jpg" class="hidden"/>
  191. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  192. <img id="left-item" src="img/310p.png" class="left-item">
  193. <img id="right-item" src="img/310p.png" class="right-item">
  194. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(33119<?echo $count ?>,309)"/>
  195. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(33119<?echo $count ?>,'310A')"/>
  196. </div>
  197. </div>
  198. <button class="checkbutton btns" id="tooltip1" style="top:480px;left:520px;" onclick="tooltipPhoto()">圖形提示</button>
  199. <br/>
  200. <button class="checkbutton btns" id="tooltip2" style="top:540px;left:520px;" onclick="tooltip('310a_2.png',2)">文字提示</button>
  201. <br>
  202. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect2(checkCorrect());">確認答案</button>
  203. <script>
  204. showtooltipPhoto = false;
  205. </script>
  206. </body>
  207. </html>