313.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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,p313 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 p313= '".$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="./function2.js"></script>
  39. <script type="text/javascript">
  40. saveRecord("33111" <?echo $count?>");
  41. </script>
  42. <script>
  43. var arrow;
  44. var i = 0;
  45. function checkCorrect(){
  46. var correct=document.getElementById("correct");
  47. var wrong=document.getElementById("wrong");
  48. var check=document.getElementById("check");
  49. var blank=document.getElementById("blank");
  50. var next=document.getElementById("next");
  51. var back=document.getElementById("back");
  52. var checkButton29 = document.getElementById("checkButton29");
  53. if(arrow.checkRes()){
  54. setTimeout(
  55. function(){
  56. correct.style.display = "inline";
  57. correct.style.left =600;
  58. correct.style.top = -250;
  59. back.style.display = "inline";
  60. back.style.left = 560;
  61. back.style.top = -150;
  62. next.style.display = "inline";
  63. next.style.left = 690;
  64. next.style.top = -150;
  65. },3000)
  66. saveRecord(100);
  67. }
  68. else{
  69. setTimeout(
  70. function(){
  71. wrong.style.display = "inline";
  72. wrong.style.left = 600;
  73. wrong.style.top = -250;
  74. back.style.display = "inline";
  75. back.style.left = 560;
  76. back.style.top = -150;
  77. next.style.display = "inline";
  78. next.style.left = 690;
  79. next.style.top = -150;
  80. },3000)
  81. saveRecord(200);
  82. }
  83. //blank.className="hidden";
  84. }
  85. this.onload = function() {
  86. arrow=new FingerComponent(["left-item"],"right-item");
  87. }
  88. </script>
  89. <style>
  90. .defaultHideBtn{
  91. position:absolute;
  92. display: none;
  93. z-index: 5;
  94. }
  95. .contentDiv{
  96. position:relative;
  97. margin: 0px auto;
  98. width: 800px;
  99. height: 720px;
  100. }
  101. .defaultPage{
  102. position:relative;
  103. display: inline;
  104. left: 0px;
  105. top: 0px;
  106. }
  107. .hidden{
  108. position:absolute;
  109. display :none;
  110. }
  111. .right-container{
  112. position: relative;
  113. left: 590px;
  114. top: -580px;
  115. width: 190px;
  116. height: 145px;
  117. overflow: hidden;
  118. z-index: 4;
  119. }
  120. .left-item{
  121. position:absolute;
  122. left: 300px;
  123. top: -350px;
  124. z-index: 2;
  125. }
  126. .checkAnswer{
  127. position:relative;
  128. display: inline;
  129. left: 620px;
  130. top: -550px;
  131. width: 150px;
  132. z-index: 4;
  133. }
  134. </style>
  135. <body>
  136. <div class="contentDiv">
  137. <div class="defaultPage" id="contentDiv">
  138. <img id="blank" src="image/313pq.jpg">
  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/313p.jpg" class="left-item">
  143. <div class="right-container">
  144. <img id="right-item" src="image/313p.jpg" class="right-item">
  145. </div>
  146. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(33419<?echo $count?>,312)"/>
  147. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(33419<?echo $count?>,'313A')"/>
  148. <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect();">確認答案</button>
  149. </div>
  150. </div>
  151. </body>
  152. </html>