Source for file hotspot_answers.as.php
Documentation is available at hotspot_answers.as.php
DOKEOS - elearning and course management software
For a full list of contributors, see documentation/credits.html
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See "documentation/licence.html" more details.
Rue des Palais 44 Paleizenstraat
B-1030 Brussels - Belgium
* This file generates the ActionScript variables code used by the HotSpot .swf
* @package dokeos.exercise
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
include('exercise.class.php');
include('question.class.php');
include('answer.class.php');
include('../inc/global.inc.php');
$userId = $_user['user_id'];
$questionId = $_GET['modifyAnswers'];
$exe_id = $_GET['exe_id'];
$from_db = isset ($_GET['from_db']) ? $_GET['from_db'] : 0;
$picturePath = $documentPath. '/images';
$pictureName = $objQuestion->selectPicture();
$pictureSize = getimagesize($picturePath. '/'. $objQuestion->selectPicture());
$pictureWidth = $pictureSize[0];
$pictureHeight = $pictureSize[1];
$courseLang = $_course['language'];
$courseCode = $_course['sysCode'];
$coursePath = $_course['path'];
$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type FROM $TBL_ANSWERS WHERE question_id = '$questionId' ORDER BY id";
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&courseCode=$coursePath";
$output .= "&hotspot_". $hotspot['id']. "=true";
if ($hotspot['hotspot_type'] == 'square' )
$output .= "&hotspot_". $hotspot['id']. "_type=square";
if ($hotspot['hotspot_type'] == 'circle')
$output .= "&hotspot_". $hotspot['id']. "_type=circle";
if ($hotspot['hotspot_type'] == 'poly')
$output .= "&hotspot_". $hotspot['id']. "_type=poly";
$output .= "&hotspot_". $hotspot['id']. "_coord=". $hotspot['hotspot_coordinates']. "";
$output .= "&hotspot_". $i. "=false";
$questionId = $_GET['modifyAnswers'];
$course_code = $_course['id'];
if(isset ($_SESSION['exerciseResultCoordinates']) && $from_db== 0)
foreach ($_SESSION['exerciseResultCoordinates'][$questionId] as $coordinate)
$output2 .= $coordinate. "|";
$sql = 'SELECT hotspot_coordinate
FROM '. $tbl_track_e_hotspot. '
WHERE hotspot_question_id = '. intval($questionId). '
AND hotspot_exe_id='. intval($exe_id);
$rs = @api_sql_query($sql); // don't output error because we are in Flash execution.
$output2 .= $row['hotspot_coordinate']. "|";
$output .= "&p_hotspot_answers=". substr($output2,0,- 1). "&done=done";
|