612.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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,p612 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. }
  17. else{
  18. $count = "".(string)($num);
  19. }
  20. $sql ="UPDATE coursepagecount SET p612 = '".$num."' WHERE User_ID='".$userid."'";
  21. $result = mysql_query($sql) or die('MySQL query error');
  22. mysql_close($link);
  23. ?>
  24. <html>
  25. <head>
  26. <title>Exam</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  29. <meta name="mobile-web-app-capable" content="yes">
  30. <meta name="apple-mobile-web-app-capable" content="yes" />
  31. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  32. <META http-equiv="Cache-Control" content="no-cache">
  33. <META http-equiv="Pragma" content="no-cache">
  34. <META http-equiv="Expires" content="0">
  35. <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  36. <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  37. <script src="./fingers.js"></script>
  38. <script src="./function.js"></script>
  39. <script src="./function6.js"></script>
  40. <script type="text/javascript">
  41. saveRecord("63411<?echo $count?>");
  42. </script>
  43. <script>
  44. var arrow;
  45. var i = 0;
  46. var lineComp;
  47. var lineComp1;
  48. var lineComp2;
  49. var lineComp3;
  50. function checkCorrect(){
  51. var correct=document.getElementById("correct");
  52. var wrong=document.getElementById("wrong");
  53. var check=document.getElementById("check");
  54. var blank=document.getElementById("blank");
  55. var next=document.getElementById("next");
  56. var back=document.getElementById("back");
  57. var checkButton29 = document.getElementById("checkButton29");
  58. if(arrow.checkRes()){
  59. setTimeout(
  60. function(){
  61. correct.style.display = "inline";
  62. correct.style.left =650;
  63. correct.style.top = 600;
  64. back.style.display = "inline";
  65. back.style.left = 610;
  66. back.style.top = 680;
  67. next.style.display = "inline";
  68. next.style.left = 730;
  69. next.style.top =680;
  70. },3000)
  71. saveRecord(100);
  72. }
  73. else{
  74. setTimeout(
  75. function(){
  76. wrong.style.display = "inline";
  77. wrong.style.left = 650;
  78. wrong.style.top = 600;
  79. back.style.display = "inline";
  80. back.style.left = 610;
  81. back.style.top = 680;
  82. next.style.display = "inline";
  83. next.style.left = 730;
  84. next.style.top =680;
  85. },3000)
  86. saveRecord(200);
  87. }
  88. blank.className="hidden";
  89. }
  90. this.onload = function() {
  91. arrow=new FingerComponent(["left-item"],"right-item");
  92. document.addEventListener("touchend", arrow.resetFlag, true);
  93. lineComp=new LineComponent("canvas","blank");
  94. }
  95. </script>
  96. <style>
  97. .defaultHideBtn{
  98. position:absolute;
  99. display: none;
  100. }
  101. .hidden{
  102. position:absolute;
  103. display :none;
  104. }
  105. .right-item{
  106. position:absolute;
  107. display: inline;
  108. left: 700px;
  109. top: 220px;
  110. width: 100;
  111. }
  112. .left-item{
  113. position:absolute;
  114. display: inline;
  115. left: 180px;
  116. top: 340px;
  117. width: 100;
  118. }
  119. .checkAnswer{
  120. position:absolute;
  121. display: inline;
  122. left: 690px;
  123. top: 380px;
  124. width: 150px;
  125. z-index: 10;
  126. }
  127. .option {
  128. float: left;
  129. width: 20px;
  130. height: 20px;
  131. border: 2px solid #cccccc;
  132. margin-right: 12px;
  133. margin-bottom: 12px;
  134. </style>
  135. <body>
  136. <div style="-webkit-perspective: 900000px;perspective: 900000px;">
  137. <canvas id="canvas" width="1000" height="800"></canvas>
  138. <img id="blank" src="image/612pq.jpg" class="hidden">
  139. <img id="check" src="image/check.jpg" class="hidden"/>
  140. <img id="correct" src="image/correct.jpg" class="hidden"/>
  141. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  142. <img id="left-item" src="image/612p.jpg" class="left-item">
  143. <img id="right-item" src="image/612p.jpg" class="right-item">
  144. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(63819<?echo $count?>,611)"/>
  145. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(63819<?echo $count?>,'612A')"/>
  146. <div style="position:absolute;left:600px;top:80px;">
  147. <div class="option" style="background-color:green" onclick="lineComp.setColor('green');"></div>
  148. <div class="option" style="background-color:red" onclick="lineComp.setColor('red');"></div>
  149. <button onclick="lineComp.clear();">清除</button>
  150. </div>
  151. </div>
  152. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect();">確認答案</button>
  153. </body>
  154. </html>