123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?
- session_start();
- echo "<meta charset=utf8>";
- if ($_SESSION['id'] == '' || $_SESSION['id'] == null) {
- echo '您尚未登入';
- exit;
- }
- include "connect.php";
- $userid = $_SESSION['name'];
- $sql = "SELECT User_ID,p314 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 p314 = '" . $num . "' WHERE User_ID='" . $userid . "'";
- $result = mysql_query($sql) or die('MySQL query error');
- mysql_close($link);
- ?>
- <! DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Exam</title>
- <link rel="stylesheet" type="text/css" media="all" href="style.css" />
- <script src="function.js"></script>
- <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="jquery.ui.touch-punch.min.js"></script>
- <script src="../public/js/layui/layui.js"></script>
- <script src="layer.js"></script>
- <script type="text/javascript">
- saveRecord("33411<?echo $count ?>");
- picAisdroped = false;
- picBisdroped = false;
- picCisdroped = false;
- picDisdroped = false;
- answer1 = 0;
- error = 0;
- isStop = false;
- showPhototipStatus = false;
- showTooltipStatus = false;
- </script>
- <script>
- var dragId;
- $(document).ready(function(){
- $("#picA").draggable({
- drag: function(event, ui) {
- dragId = "picA";
- }
- });
- $("#picB").draggable({
- drag: function(event, ui) {
- dragId = "picB";
- }
- });
- $("#picC").draggable({
- drag: function(event, ui) {
- dragId = "picC";
- }
- });
- $("#picD").draggable({
- drag: function(event, ui) {
- dragId = "picD";
- }
- });
- $("#contentDiv").droppable({
- drop: function( event, ui ) {
- if(dragId == "picA"){
- picAisdroped = false;
- }
- else if(dragId == "picB"){
- picBisdroped = false;
- }
- else if(dragId == "picC"){
- picCisdroped = false;
- }
- else if(dragId == "picD"){
- picDisdroped = false;
- }
- }
- });
- $("#gridA").droppable({
- drop: function( event, ui ) {
- if(dragId == "picA"){
- saveRecords(1,dragTime);
- saveRecord(5);
- answer1 = 1;
- picAisdroped = true;
- }
- else if(dragId == "picB"){
- saveRecords(2,dragTime);
- saveRecord(5);
- answer1 = 2;
- picBisdroped = true;
- }
- else if(dragId == "picC"){
- saveRecords(3,dragTime);
- saveRecord(5);
- answer1 = 3;
- picCisdroped = true;
- }
- else if(dragId == "picD"){
- saveRecords(4,dragTime);
- saveRecord(5);
- answer1 = 4;
- picDisdroped = true;
- }
- document.getElementById(dragId).style.top = 40;
- document.getElementById(dragId).style.left = 550;
- }
- });
- });
- </script>
- <style type="text/css">
- #stockGraph{
- position: absolute;
- top:0;
- left:0;
- width:100%;
- height:30vh;
- background:rgba(100,100,100,0.4);
- }
- </style>
- </head>
- <body>
- <div class="contentDiv">
- <div class="defaultPage" id="contentDiv">
- <canvas id="stockGraph">
- current stock price: $3.15 +0.15
- </canvas>
- <img class="defaultPic" id="contentPic" src="image/314q.jpg"/>
- <img class="picItemA" id="picA" src="image/314picA.png" style="top:380px;left:10px;" onmousedown="dragPic()"/>
- <img class="picItemB" id="picB" src="image/314picB.png" style="top:380px;left:200px;" onmousedown="dragPic()"/>
- <img class="picItemC" id="picC" src="image/314picC.png" style="top:380px;left:390px;" onmousedown="dragPic()"/>
- <img class="picItemD" id="picD" src="image/314picD.png" style="top:380px;left:580px;" onmousedown="dragPic()"/>
- <!--提示-->
- <!--<img class="phototip" id="phototip" src="image/314a_1.jpg" style="top:0px;left:10px;display:none;position: absolute"/>
- <img class="phototip" id="tooltip" src="image/314a_2.jpg" style="top:380px;left:580px;display:none"/>-->
- <img class="gridItemA" id="gridA" src="image/transparent.png" style="top:40px;left:550px; width:200px; height:165px"/>
- <button class="checkbutton" id="chkButton" onclick="checkAns(314)" style="top:275px;left:425px;" >確認答案</button>
- <button class="checkbutton" id="chkButton" onclick="tooltip('314a_1.jpg',1)" style="top:275px;left:550px;" >圖案提示</button>
- <button class="checkbutton" id="chkButton" onclick="tooltip('314a_2.jpg',2)"style="top:275px;left:675px;" >文字提示</button>
- <img class="defaultStatus" id="status" src="" style="top:260px;left:160px;"/>
- <img class="defaultHideBtn" id="buttonPrev" src="image/prevButton.jpg" onclick="nextPage(33419<?echo $count ?>,313)"/>
- <img class="defaultHideBtn" id="buttonNext" src="image/nextButton.jpg" onclick="nextPage(33419<?echo $count ?>,'314A')"/>
- </div>
- </div>
- <script>
- var canvas = document.getElementById('stockGraph');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- ctx.strokeStyle = '#ec6c09';
- ctx.lineWidth = 2;
- //实线1
- ctx.moveTo(30, 8);
- ctx.lineTo(150, 23);
- ctx.stroke();
- //实线2
- ctx.moveTo(150, 23);
- ctx.lineTo(60, 40);
- ctx.stroke();
- //虚线
- ctx.beginPath();
- ctx.setLineDash([5, 15]);
- ctx.moveTo(150, 23);
- ctx.lineTo(400, 20);
- ctx.stroke();
- // drawing code here
- } else {
- // canvas-unsupported code here
- }
- </script>
- </body>
- </html>
|