313.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. } else {
  17. $count = "" . (string) ($num);
  18. }
  19. $sql = "UPDATE coursepagecount SET p313= '" . $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. <link rel="stylesheet" type="text/css" media="all" href="style.css" />
  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="./function2.js"></script>
  40. <script src="../public/js/layui/layui.js"></script>
  41. <script src="layer.js"></script>
  42. <script type="text/javascript">
  43. saveRecord("33111<?echo $count ?>");
  44. rotateX = 0;
  45. rotateY = 0;
  46. rotateZ = 0;
  47. scale = 1;
  48. picwidth = 195;
  49. error = 0;
  50. isStop = false;
  51. showTooltipPhoto = false;
  52. function tooltipPhoto(){
  53. showTooltipPhoto = !showTooltipPhoto;
  54. if(showTooltipPhoto){
  55. document.getElementById("stockGraph").style.display="block";
  56. }else{
  57. document.getElementById("stockGraph").style.display="none";
  58. }
  59. }
  60. </script>
  61. <style type="text/css">
  62. #stockGraph{
  63. width:800px;
  64. height:35vh;
  65. /*background:rgba(100,100,100,0.4);*/
  66. display:none;
  67. }
  68. </style>
  69. <body>
  70. <div class="contentDiv">
  71. <div class="defaultPage" id="contentDiv">
  72. <canvas id="stockGraph" width="800" height="600">
  73. current stock price: $3.15 +0.15
  74. </canvas>
  75. <img class="defaultPic" id="contentPic" src="image/314q.png"/>
  76. <img class="picItem" id="picA" src="image/314pic.png" style="top:350px;left:140px;"/>
  77. <img class="picItem" id="picB" src="image/314pic.png" style="top:45px;left:548px;z-index:-50;"/>
  78. <img class="picItem" id="pic1" src="image/pic1.png" style="top:550px;left:350px;" onclick="rotatePic(1,0.5,0.25,1)"/>
  79. <img class="picItem" id="pic2" src="image/pic2.png" style="top:550px;left:420px;" onclick="rotatePic(360,-360,10,2)"/>
  80. <img class="picItem" id="pic3" src="image/pic3.png" style="top:550px;left:490px;" onclick="rotatePic(1,0.5,0.25,3)"/>
  81. <img class="picItem" id="pic4" src="image/pic4.png" style="top:480px;left:350px;" onclick="rotatePic(360,-360,10,4)"/>
  82. <img class="picItem" id="pic6" src="image/pic6.png" style="top:480px;left:490px;" onclick="rotatePic(360,-360,10,6)"/>
  83. <img class="picItem" id="pic7" src="image/pic7.png" style="top:410px;left:350px;" onclick="rotatePic(360,-360,10,7)"/>
  84. <img class="picItem" id="pic8" src="image/pic8.png" style="top:410px;left:420px;" onclick="rotatePic(360,-360,10,8)"/>
  85. <img class="picItem" id="pic9" src="image/pic9.png" style="top:410px;left:490px;" onclick="rotatePic(360,-360,10,9)"/>
  86. <button class="checkbutton" id="tooltip1" style="top:420px;left:580px;" onclick="tooltipPhoto()">圖形提示</button>
  87. <br/>
  88. <button class="checkbutton" id="tooltip2" style="top:480px;left:580px;" onclick="tooltip('314a_2.jpg',2)">文字提示</button>
  89. <br>
  90. <button class="checkbutton" id="chkButton" onclick="checkAns(314)" style="top:540px;left:580px;" >確認答案</button>
  91. <img class="defaultStatus" id="status" src=""/>
  92. <img class="defaultHideBtn" id="buttonPrev" src="image/prevButton.jpg" onclick="nextPage(33419<?echo $count ?>,312)"/>
  93. <img class="defaultHideBtn" id="buttonNext" src="image/nextButton.jpg" onclick="nextPage(33419<?echo $count ?>,'313A')"/>
  94. </div>
  95. </div>
  96. <script>
  97. var canvas = document.getElementById('stockGraph');
  98. if (canvas.getContext){
  99. //上线
  100. var ctx = canvas.getContext('2d');
  101. ctx.strokeStyle = '#ec6c09';
  102. ctx.lineWidth = 4;
  103. //实线1
  104. //30, 20 2.65 4.1
  105. ctx.moveTo(79, 77);
  106. ctx.lineTo(397, 120);
  107. ctx.stroke();
  108. //实线2
  109. ctx.moveTo(397, 120);
  110. ctx.lineTo(159, 184);
  111. ctx.stroke();
  112. //虚线
  113. ctx.beginPath();
  114. ctx.setLineDash([10, 10]);
  115. ctx.moveTo(397, 120);
  116. ctx.lineTo(715, 76);
  117. ctx.stroke();
  118. //下线
  119. ctx.beginPath();
  120. ctx.strokeStyle = '#04ab53';
  121. ctx.lineWidth = 4;
  122. ctx.setLineDash([]);
  123. //实线1
  124. ctx.moveTo(159, 184);
  125. ctx.lineTo(397, 267);
  126. ctx.stroke();
  127. //实线2
  128. ctx.moveTo(397, 267);
  129. ctx.lineTo(79, 362);
  130. ctx.stroke();
  131. //虚线
  132. ctx.beginPath();
  133. ctx.setLineDash([10, 10]);
  134. ctx.moveTo(397, 267);
  135. ctx.lineTo(715, 389);
  136. ctx.stroke();
  137. } else {
  138. // canvas-unsupported code here
  139. }
  140. </script>
  141. </body>
  142. </html>