[svn r13271] fix still a bug with hotspots results... it seems to me that it's up now.

skala
Eric Marguin 17 years ago
parent 7c2ca8a132
commit a8abe2edd9
  1. 6
      main/exercice/exercise_result.php
  2. 7
      main/exercice/exercise_show.php
  3. 15
      main/exercice/hotspot_answers.as.php
  4. BIN
      main/plugin/hotspot/hotspot_solution.fla
  5. BIN
      main/plugin/hotspot/hotspot_solution.swf

@ -25,7 +25,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring
* @version $Id: exercise_result.php 13267 2007-09-26 07:57:09Z elixir_inter $
* @version $Id: exercise_result.php 13271 2007-09-26 08:46:34Z elixir_inter $
*
* @todo split more code up in functions, move functions to library?
*/
@ -700,8 +700,8 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
<tr>
<td colspan="2">
<i><?php echo get_lang('Hotspot'); ?></i><br /><br />
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers=<?php echo $questionId ?>" width="730" height="750">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers=<?php echo $questionId ?>" />
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers=<?php echo $questionId ?>&exe_id=&from_db=0" width="730" height="750">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers=<?php echo $questionId ?>&exe_id=&from_db=0" />
</object>
</td>
</tr>

@ -688,7 +688,8 @@ $result =api_sql_query($query, __FILE__, __LINE__);
<tr>
<td valign="top" align="left">
<table style="border: 1px solid #4271b5;border-bottom:none" width="730">
<?php
<?php
error_log('la');
for($answerId=1;$answerId <= $nbrAnswers;$answerId++)
{
$answer=$objAnswerTmp->selectAnswer($answerId);
@ -716,8 +717,8 @@ $result =api_sql_query($query, __FILE__, __LINE__);
echo '
<tr>
<td colspan="2">
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'" width="730" height="570">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'" />
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'&exe_id='.$id.'&from_db=1" width="730" height="570">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'&exe_id='.$id.'&from_db=1" />
</object>
</td>
</tr>

@ -33,7 +33,9 @@ include('../inc/global.inc.php');
// set vars
$userId = $_user['user_id'];
$questionId = $_GET['modifyAnswers'];
$questionId = $_GET['modifyAnswers'];
$exe_id = $_GET['exe_id'];
$from_db = isset($_GET['from_db']) ? $_GET['from_db'] : 0;
$objQuestion = Question :: read($questionId);
$TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER);
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
@ -94,7 +96,7 @@ $questionId = $_GET['modifyAnswers'];
$course_code = $_course['id'];
// Get clicks
/*if(isset($_SESSION['exerciseResultCoordinates']))
if(isset($_SESSION['exerciseResultCoordinates']) && $from_db==0)
{
foreach ($_SESSION['exerciseResultCoordinates'][$questionId] as $coordinate)
{
@ -102,20 +104,21 @@ $course_code = $_course['id'];
}
}
else
{*/
{
// get it from db
$tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
$sql = 'SELECT hotspot_coordinate
FROM '.$tbl_track_e_hotspot.'
WHERE hotspot_question_id = '.intval($questionId).'
AND hotspot_course_code = "'.Database::escape_string($course_code).'"';
error_log($sql);
AND hotspot_course_code = "'.Database::escape_string($course_code).'"
AND hotspot_exe_id='.intval($exe_id);
$rs = @api_sql_query($sql); // don't output error because we are in Flash execution.
while($row = Database :: fetch_array($rs))
{
$output2 .= $row['hotspot_coordinate']."|";
}
//}
}
$output .= "&p_hotspot_answers=".substr($output2,0,-1)."&done=done";

Loading…
Cancel
Save