410.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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,p410 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 p410 = '".$num."' WHERE User_ID='".$userid."'";
  21. $result = mysql_query($sql) or die('MySQL query error');
  22. mysql_close($link);
  23. ?>
  24. <! DOCTYPE HTML>
  25. <html>
  26. <head>
  27. <title>Exam</title>
  28. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  29. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  30. <meta name="mobile-web-app-capable" content="yes">
  31. <meta name="apple-mobile-web-app-capable" content="yes" />
  32. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  33. <META http-equiv="Cache-Control" content="no-cache">
  34. <META http-equiv="Pragma" content="no-cache">
  35. <META http-equiv="Expires" content="0">
  36. <script src="./fingers.js"></script>
  37. <script src="./function.js"></script>
  38. <script src="./function1.js"></script>
  39. <script type="text/javascript">
  40. saveRecord("43811<?echo $count?>");
  41. </script>
  42. </head>
  43. <body>
  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 =50;
  60. correct.style.top = -50;
  61. back.style.display = "inline";
  62. back.style.left = 540;
  63. back.style.top = -80;
  64. next.style.display = "inline";
  65. next.style.left = 660;
  66. next.style.top = -80;
  67. },3000)
  68. saveRecord(100);
  69. }
  70. else{
  71. setTimeout(
  72. function(){
  73. wrong.style.display = "inline";
  74. wrong.style.left = 50;
  75. wrong.style.top = -50;
  76. back.style.display = "inline";
  77. back.style.left = 540;
  78. back.style.top = -80;
  79. next.style.display = "inline";
  80. next.style.left = 660;
  81. next.style.top = -80;
  82. },3000)
  83. saveRecord(200);
  84. }
  85. //blank.className="hidden";
  86. }
  87. this.onload = function() {
  88. arrow=new FingerComponent(["arrow"]);
  89. }
  90. </script>
  91. <style>
  92. .defaultHideBtn{
  93. position:absolute;
  94. display: none;
  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. .arrow-begin{
  113. position:absolute;
  114. transform-origin: 0% 100%;
  115. -webkit-transform-origin: 0% 100%;
  116. left: 400px;
  117. top: -385px;
  118. z-index:10000;
  119. }
  120. .checkAnswer{
  121. position:relative;
  122. display: inline;
  123. left: 490px;
  124. top: -440px;
  125. width: 150px;
  126. }
  127. .blank{
  128. position:relative;
  129. display: inline;
  130. z-index:0;
  131. }
  132. </style>
  133. <div class="contentDiv">
  134. <div class="defaultPage" id="contentDiv">
  135. <img id="arrow" src="image/410p.jpg" class="arrow-begin">
  136. <img id="blank" src="image/410pq.jpg"/>
  137. <img id="check" src="image/check.jpg" class="hidden"/>
  138. <img id="correct" src="image/correct.jpg" class="hidden"/>
  139. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  140. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect();">確認答案</button>
  141. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(43819<?echo $count?>,'409A')"/>
  142. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(43819<?echo $count?>,'410A')"/>
  143. </div>
  144. </div>
  145. </body>
  146. </html>