selectId(); if ($_GET['answerId'] == "0") // click is NOT on a hotspot { $hit = 0; $answerId = $hotspotId; // remove from session unset($_SESSION['exerciseResult'][$questionId][$answerId]); // Save clicking order //$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; //$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; } else // user clicked ON a hotspot { $hit = 1; $answerId = $hotspotId; // Save into session $_SESSION['exerciseResult'][$questionId][$answerId] = $hit; // Save clicking order //$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; //$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; } $TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); // update db $update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId]; $sql = "UPDATE $TBL_TRACK_E_HOTSPOT SET `coordinate` = '".$coordinates."' WHERE `id` =$update_id LIMIT 1 ;;"; $result = api_sql_query($sql,__FILE__,__LINE__); ?>