407.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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,p407 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 p407 = '".$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="./jquery-1.11.3.min.js"></script>
  36. <script src="./function.js"></script>
  37. <script src="./function8.js"></script>
  38. <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  39. <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  40. <script src="jquery.ui.touch-punch.min.js"></script>
  41. <script src="./fingers.js"></script>
  42. <script type="text/javascript">
  43. saveRecord("43511<?echo $count?>");
  44. </script>
  45. </head>
  46. <body>
  47. <script>
  48. function checkCorrect(){
  49. var correct=document.getElementById("correct");
  50. var wrong=document.getElementById("wrong");
  51. var check = document.getElementById("check");
  52. var next = document.getElementById("next");
  53. var back = document.getElementById("back");
  54. var car = document.getElementById("car");
  55. if(finger.checkRes()){
  56. correct.className="";
  57. wrong.className="hidden";
  58. }
  59. else{
  60. wrong.className="hidden";
  61. correct.className="hidden";
  62. }
  63. blank.className="hidden";
  64. }
  65. this.onload = function() {
  66. var canvas = document.getElementById("myCanvas");
  67. var ctx=canvas.getContext("2d");
  68. var bg = $("#blank")[0];
  69. ctx.drawImage(bg,0,0,800,700);
  70. finger=new FingerComponent(["arrow"],"car",canvas);
  71. ctx.moveTo(390,190);
  72. //ctx.lineTo(500,300);
  73. finger.car.isUpdated=true;
  74. //ctx.moveTo(242,130);
  75. ctx.lineTo(finger.car.x+30,finger.car.y-10);
  76. $("#normal-line").css("top",finger.car.y+35);
  77. finger.arrow.y=finger.car.y-100;//+70;
  78. finger.arrow.isUpdated=true;
  79. ctx.lineWidth = 6;
  80. ctx.strokeStyle = "red";
  81. ctx.stroke();
  82. }
  83. </script>
  84. <style>
  85. .defaultHideBtn{
  86. position:absolute;
  87. display: none;
  88. }
  89. .hidden{
  90. position:absolute;
  91. display :none;
  92. }
  93. #normal-line{
  94. position:absolute;
  95. left:380px;
  96. top: 337px;
  97. height:5px;
  98. weight:5px;
  99. }
  100. .arrow-begin{
  101. position:absolute;
  102. left: 179px;
  103. top: 148px;
  104. transform: rotate(45deg);
  105. transform-origin: 20% 40%;
  106. -webkit-transform: rotate(45deg);
  107. -webkit-transform-origin:20% 40%;
  108. height:20px;
  109. weight:20px;
  110. }
  111. .car{
  112. position:absolute;
  113. left:30px;
  114. top: -40px;
  115. transform: rotate(45deg);
  116. transform-origin: 20% 40%;
  117. -webkit-transform: rotate(45deg);
  118. -webkit-transform-origin:20% 40%;
  119. width:100px;
  120. height: 80px;
  121. }
  122. }
  123. </style>
  124. <div style="position:absolute;left:0px;top:0px;">
  125. <canvas id="myCanvas" width="1000" height="710" style="z-index:10000;">
  126. </canvas>
  127. <img src="image/407pq.jpg" id="blank" style="position:absolute;left:0px;top:0px;width:0px;">
  128. <img id="check" src="image/check.jpg" class="hidden"/>
  129. <img id="correct" src="image/correct.jpg" class="hidden"/>
  130. <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
  131. <img id="car" src="image/car.png" class="car">
  132. <img id="arrow" src="image/arrow.png" class="arrow-begin">
  133. <img id="normal-line" src="image/normal-line.png">
  134. <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(43519<?echo $count?>,'406A')"/>
  135. <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(43519<?echo $count?>,'407A')"/>
  136. </div>
  137. </body>
  138. </html>