12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- require_once '../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_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
- $update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId];
- $sql = "UPDATE $TBL_TRACK_E_HOTSPOT SET coordinate = '".Database::escape_string($coordinates)."' WHERE id = ".intval($update_id)." LIMIT 1 ;;";
- $result = Database::query($sql);
|