123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- include('exercise.class.php');
- include('question.class.php');
- include('answer.class.php');
- include('../inc/global.inc.php');
- $courseCode = $_GET['coursecode'];
- $questionId = $_GET['questionId'];
- $coordinates = $_GET['coord'];
- $objExcercise = $_SESSION['objExercise'];
- $hotspotId = $_GET['hotspotId'];
- $exerciseId = $objExcercise->selectId();
- if ($_GET['answerId'] == "0")
- {
- $hit = 0;
- $answerId = $hotspotId;
-
- unset($_SESSION['exerciseResult'][$questionId][$answerId]);
-
-
-
- }
- else
- {
- $hit = 1;
- $answerId = $hotspotId;
-
- $_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
-
-
-
- }
- $coords = explode('/',$coordinates);
- $coordinates = '';
- foreach ($coords as $coord) {
- list($x,$y) = explode(';',$coord);
- $coordinates .= round($x).';'.round($y).'/';
- }
- $coordinates = substr($coordinates,0,-1);
- $TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS);
- $update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId];
- $sql = "UPDATE $TBL_TRACK_E_HOTSPOT SET coordinate = '".Database::escape_string($coordinates)."' WHERE id ='".Database::escape_string($update_id)."' LIMIT 1 ;;";
- $result = api_sql_query($sql,__FILE__,__LINE__);
- ?>
|