123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?
- session_start();
- echo "<meta charset=utf8>";
- if ($_SESSION['id'] == '' || $_SESSION['id'] == NULL){
- echo '您尚未登入';
- exit;
- }
- include("connect.php");
- $userid = $_SESSION['name'];
- $sql = "SELECT User_ID,p606 FROM coursepagecount WHERE User_ID = '".$userid."'";
- $result = mysql_query($sql) or die('MySQL query error');
- $row = mysql_fetch_array($result);
- $num = $row[1]+1;
- if($num<10){
- $count = "0".(string)($num);
- }
- else{
- $count = "".(string)($num);
- }
- $sql ="UPDATE coursepagecount SET p606 = '".$num."' WHERE User_ID='".$userid."'";
- $result = mysql_query($sql) or die('MySQL query error');
- mysql_close($link);
- ?>
- <html>
- <head>
- <title>Exam</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
- <META http-equiv="Cache-Control" content="no-cache">
- <META http-equiv="Pragma" content="no-cache">
- <META http-equiv="Expires" content="0">
- <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
- <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
- <script src="./fingers.js"></script>
- <script src="./function.js"></script>
- <script src="./function6.js"></script>
- <script type="text/javascript">
-
- saveRecord("63411<?echo $count?>");
- </script>
- <script>
-
- var arrow;
- var i = 0;
- var lineComp;
- var lineComp1;
- var lineComp2;
- var lineComp3;
- function checkCorrect(){
- var correct=document.getElementById("correct");
- var wrong=document.getElementById("wrong");
- var check=document.getElementById("check");
- var blank=document.getElementById("blank");
- var next=document.getElementById("next");
- var back=document.getElementById("back");
- var checkButton29 = document.getElementById("checkButton29");
- if(arrow.checkRes()){
- setTimeout(
- function(){
- correct.style.display = "inline";
- correct.style.left =540;
- correct.style.top = -210;
- back.style.display = "inline";
- back.style.left = 530;
- back.style.top = -160;
- next.style.display = "inline";
- next.style.left = 650;
- next.style.top =-160;
-
- },3000)
- saveRecord(100);
- }
- else{
- setTimeout(
- function(){
- wrong.style.display = "inline";
- wrong.style.left = 540;
- wrong.style.top = -210;
- back.style.display = "inline";
- back.style.left = 530;
- back.style.top = -160;
- next.style.display = "inline";
- next.style.left = 650;
- next.style.top =-160;
-
- },3000)
- saveRecord(200);
- }
- // blank.className="hidden";
- }
- this.onload = function() {
- arrow=new FingerComponent(["left-item"],"right-item");
- document.addEventListener("touchend", arrow.resetFlag, true);
- //lineComp=new LineComponent("canvas","blank");
- }
- </script>
- <style>
- .defaultHideBtn{
- position:absolute;
- display: none;
- z-index: 3;
- }
- .hidden{
- position:absolute;
- display :none;
- }
- .contentDiv{
- position:relative;
- margin: 0px auto;
- width: 800px;
- height: 720px;
- }
- .defaultPage{
- position:relative;
- display: inline;
- left: 0px;
- top: 0px;
- }
- .right-item{
- position:absolute;
- display: inline;
- left: 540px;
- top: -370px;
- width: 100;
- z-index: 1;
- }
- .left-item{
- position:absolute;
- display: inline;
- left: 330px;
- top: -220px;
- width: 100;
- z-index: 1;
- }
- .checkAnswer{
- position:absolute;
- display: inline;
- left: 550px;
- top: -500px;
- width: 150px;
- z-index: 3;
- }
- .option{
- float: left;
- width: 20px;
- height: 20px;
- border: 2px solid #cccccc;
- margin-right: 12px;
- margin-bottom: 12px;
- }
- #canvas_preview{
- opacity:0.5;
- top: -586px;
- left: 0;
- position: absolute;
- }
- .panel{
- position: absolute;
- width: 150px;
- left:150px;
- top:-550px;
- }
- #blank{
- position: absolute;
- top: -586px;
- left: 0;
- z-index: -2;
- }
- </style>
- <body>
-
- <div class="contentDiv">
-
-
- <div class="defaultPage" id="contentDiv">
- <canvas id="canvas" width="800" height="600"></canvas>
- <img id="blank" src="image/606pq.jpg" class style="top: -586px; left: 0px;">
- <img id="check" src="image/check.jpg" class="hidden"/>
- <img id="correct" src="image/correct.jpg" class="hidden"/>
- <img id="wrong" src="image/wrongnext.jpg" class="hidden"/>
- <img id="left-item" src="image/606p.jpg" class="left-item">
- <img id="right-item" src="image/606p.jpg" class="right-item">
- <img class="defaultHideBtn" id="back" src="image/prevButton.jpg" onclick="nextPage(63419<?echo $count?>,605)"/>
- <img class="defaultHideBtn" id="next" src="image/nextButton.jpg" onclick="nextPage(63419<?echo $count?>,'606A')"/>
- <button class= "CheckAnswer" id="checkButton29" onclick="checkCorrect();">確認答案</button>
- <canvas id="canvas_preview" width="800" height="600" style="top: -586px; left: 0px;"></canvas>
- <div class="panel">
- <div class="option" style="background-color:green" onclick="changeColor('green')"></div>
- <div class="option" style="background-color:red" onclick="changeColor('red')"></div>
- <button id="reset">清除</button>
- </div>
- </div>
- </div>
-
- </body>
- </html>
|