606.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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,p606 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 p606 = '" . $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="./function6.js"></script>
  39. <script src="../public/js/layui/layui.js"></script>
  40. <script src="layer.js"></script>
  41. <script type="text/javascript">
  42. saveRecord("63411<?echo $count ?>");
  43. </script>
  44. <script>
  45. var arrow;
  46. var i = 0;
  47. var lineComp;
  48. var lineComp1;
  49. var lineComp2;
  50. var lineComp3;
  51. function checkCorrect(){
  52. var correct=document.getElementById("correct");
  53. var wrong=document.getElementById("wrong");
  54. var check=document.getElementById("check");
  55. var blank=document.getElementById("blank");
  56. var next=document.getElementById("next");
  57. var back=document.getElementById("back");
  58. var checkButton29 = document.getElementById("checkButton29");
  59. if(arrow.checkRes()){
  60. setTimeout(
  61. function(){
  62. correct.style.display = "inline";
  63. //correct.style.left =540;
  64. //correct.style.top = -210;
  65. back.style.display = "inline";
  66. //back.style.left = 530;
  67. //back.style.top = -160;
  68. next.style.display = "inline";
  69. //next.style.left = 650;
  70. //next.style.top =-160;
  71. },3000)
  72. saveRecord(100);
  73. }
  74. else{
  75. setTimeout(
  76. function(){
  77. wrong.style.display = "inline";
  78. //wrong.style.left = 540;
  79. //wrong.style.top = -210;
  80. back.style.display = "inline";
  81. //back.style.left = 530;
  82. //back.style.top = -160;
  83. next.style.display = "inline";
  84. //next.style.left = 650;
  85. //next.style.top =-160;
  86. },3000)
  87. saveRecord(200);
  88. }
  89. // blank.className="hidden";
  90. }
  91. this.onload = function() {
  92. arrow=new FingerComponent(["left-item"],"right-item");
  93. document.addEventListener("touchend", arrow.resetFlag, true);
  94. //lineComp=new LineComponent("canvas","blank");
  95. }
  96. </script>
  97. <style>
  98. .defaultHideBtn{
  99. position:absolute;
  100. display: none;
  101. z-index: 3;
  102. }
  103. .hidden{
  104. position:absolute;
  105. display :none;
  106. }
  107. .contentDiv{
  108. position:relative;
  109. margin: 0px auto;
  110. width: 800px;
  111. height: 720px;
  112. }
  113. .defaultPage{
  114. position:relative;
  115. display: inline;
  116. left: 0px;
  117. top: 0px;
  118. }
  119. .right-item{
  120. position:absolute;
  121. display: inline;
  122. left: 530px;
  123. top: -350px;
  124. width: 100;
  125. z-index: 1;
  126. }
  127. .left-item{
  128. position:absolute;
  129. display: inline;
  130. left: 330px;
  131. top: -120px;
  132. width: 100;
  133. z-index: 1;
  134. }
  135. .checkAnswer{
  136. position:absolute;
  137. display: inline;
  138. left: 550px;
  139. top: -500px;
  140. width: 150px;
  141. z-index: 3;
  142. }
  143. .option{
  144. float: left;
  145. width: 20px;
  146. height: 20px;
  147. border: 2px solid #cccccc;
  148. margin-right: 12px;
  149. margin-bottom: 12px;
  150. }
  151. #canvas_preview{
  152. opacity:0.5;
  153. top: -586px;
  154. left: 0;
  155. position: absolute;
  156. }
  157. .panel{
  158. position: absolute;
  159. width: 150px;
  160. left:150px;
  161. top:-550px;
  162. }
  163. #blank{
  164. position: absolute;
  165. top: -586px;
  166. left: 0;
  167. z-index: -2;
  168. }
  169. /**修改内容 */
  170. .tooltipPhoto{
  171. position:absolute;
  172. display: none;
  173. left: 0;
  174. top: -550;
  175. z-index: 101;
  176. transform: scale(1);
  177. width: 100%;
  178. }
  179. .btns{
  180. position:absolute;
  181. display: inline;
  182. width: 120px;
  183. z-index: 4;
  184. }
  185. .checkAnswer{
  186. top:0;
  187. left: 550;
  188. width:120px;
  189. }
  190. #tooltip1
  191. {
  192. left: 150;
  193. top:0;
  194. }
  195. #tooltip2
  196. {
  197. left: 350;
  198. top:0;
  199. }
  200. #check{
  201. top: 30;
  202. left:100;
  203. }
  204. #correct{
  205. top: 30;
  206. left:100;
  207. }
  208. #wrong{
  209. top: 30;
  210. left:100;
  211. }
  212. #back{
  213. top: 50;
  214. left:400
  215. }
  216. #next{
  217. top: 50;
  218. left:550;
  219. }
  220. </style>
  221. </head>
  222. <body>
  223. <div class="contentDiv">
  224. <div class="defaultPage" id="contentDiv">
  225. <canvas id="canvas" width="800" height="600"></canvas>
  226. <img class="tooltipPhoto" id="tooltipPhoto" src="img/606a_1.png"/>
  227. <img id="blank" src="img/606pq.png" class style="top: -586px; left: 0px;">
  228. <img id="check" src="image/check.jpg" class="hidden"/>
  229. <img id="correct" src="image/correct.jpg" class="hidden"/>
  230. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  231. <img id="left-item" src="img/606p.png" class="left-item">
  232. <img id="right-item" src="img/606p.png" class="right-item">
  233. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(63419<?echo $count ?>,605)"/>
  234. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(63419<?echo $count ?>,'606A')"/>
  235. <button class="checkbutton btns" id="tooltip1" onclick="tooltipPhoto()">圖形提示</button>
  236. <button class="checkbutton btns" id="tooltip2" onclick="tooltip('606a_2.png',2)">文字提示</button>
  237. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect2(checkCorrect());">確認答案</button>
  238. <canvas id="canvas_preview" width="800" height="600" style="top: -586px; left: 0px;"></canvas>
  239. <div class="panel">
  240. <div class="option" style="background-color:green" onclick="changeColor('green')"></div>
  241. <div class="option" style="background-color:red" onclick="changeColor('red')"></div>
  242. <button id="reset">清除</button>
  243. </div>
  244. </div>
  245. </div>
  246. <script>
  247. showtooltipPhoto = false;
  248. </script>
  249. </body>
  250. </html>