511.php 5.2 KB

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