[svn r13139] resize hotspots : pictures are now limited to 720px (height or width)

skala
Eric Marguin 18 years ago
parent be6f7653b3
commit 6b97cee5b9
  1. 4
      main/exercice/exercise.lib.php
  2. 61
      main/exercice/exercise_show.php
  3. 8
      main/exercice/hotspot.class.php
  4. 2
      main/exercice/hotspot_admin.inc.php

@ -23,7 +23,7 @@
* shows a question and its answers
* @package dokeos.exercise
* @author Olivier Brouckaert <oli.brouckaert@skynet.be>
* @version $Id: exercise.lib.php 13128 2007-09-20 13:38:47Z elixir_inter $
* @version $Id: exercise.lib.php 13139 2007-09-20 15:19:08Z elixir_inter $
*/
@ -424,7 +424,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
// Check to see if the version meets the requirements for playback
if (hasReqestedVersion) { // if we've detected an acceptable version
var oeTags = '<object type=\"application/x-shockwave-flash\" data=\"../plugin/hotspot/hotspot_user.swf?modifyAnswers=".$questionId."&amp;canClick:".$canClick."\" width=\"720\" height=\"720\">'
var oeTags = '<object type=\"application/x-shockwave-flash\" data=\"../plugin/hotspot/hotspot_user.swf?modifyAnswers=".$questionId."&amp;canClick:".$canClick."\" width=\"730\" height=\"620\">'
+ '<param name=\"movie\" value=\"../plugin/hotspot/hotspot_user.swf?modifyAnswers=".$questionId."&amp;canClick:".$canClick."\" \/>'
+ '<\/object>';
document.write(oeTags); // embed the Flash Content SWF when all tests are passed

@ -684,36 +684,45 @@ $result =api_sql_query($query, __FILE__, __LINE__);
$objAnswerTmp=new Answer($questionId);
$nbrAnswers=$objAnswerTmp->selectNbrAnswers();
$questionScore=0;
echo '
?>
<tr>
<td>
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'" width="380" height="400">
<td valign="top" align="left">
<table style="border: 1px solid" width="200">';
<?php
for($answerId=1;$answerId <= $nbrAnswers;$answerId++)
{
$answer=$objAnswerTmp->selectAnswer($answerId);
$answerComment=$objAnswerTmp->selectComment($answerId);
$answerCorrect=$objAnswerTmp->isCorrect($answerId);
$answerWeighting=$objAnswerTmp->selectWeighting($answerId);
$query = "select answer from ".$TBL_TRACK_ATTEMPT." where exe_id = $id and question_id= $questionId";
$resq=api_sql_query($query);
$choice = mysql_result($resq,0,"answer");
display_hotspot_answer($answerId,$answer,$choice,$answerComment);
$i++;
}
$queryfree = "select marks from ".$TBL_TRACK_ATTEMPT." where exe_id = $id and question_id= $questionId";
$resfree = api_sql_query($queryfree, __FILE__, __LINE__);
$questionScore= mysql_result($resfree,0,"marks");
$totalScore+=$questionScore;
?>
</table>
</td>
<?php
echo '
<tr>
<td colspan="2">
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'" width="730" height="730">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'" />
</object>
</td><td valign="top"><table style="border: 1px solid" width="200">';
for($answerId=1;$answerId <= $nbrAnswers;$answerId++)
{
$answer=$objAnswerTmp->selectAnswer($answerId);
$answerComment=$objAnswerTmp->selectComment($answerId);
$answerCorrect=$objAnswerTmp->isCorrect($answerId);
$answerWeighting=$objAnswerTmp->selectWeighting($answerId);
$query = "select answer from ".$TBL_TRACK_ATTEMPT." where exe_id = $id and question_id= $questionId";
$resq=api_sql_query($query);
$choice = mysql_result($resq,0,"answer");
display_hotspot_answer($answerId,$answer,$choice,$answerComment);
$i++;
}
$queryfree = "select marks from ".$TBL_TRACK_ATTEMPT." where exe_id = $id and question_id= $questionId";
$resfree = api_sql_query($queryfree, __FILE__, __LINE__);
$questionScore= mysql_result($resfree,0,"marks");
$totalScore+=$questionScore;
?>
</table></td></tr></table>
</td>
</tr>
</tr></table></td></tr></table>';
<?php
}
?>

@ -68,8 +68,12 @@ class HotSpot extends Question {
parent::processCreation ($form, $objExercise);
if(!empty($file_info['tmp_name']))
{
$this->uploadPicture($file_info['tmp_name'], $file_info['name']);
$this->resizePicture('any',720);
$this->uploadPicture($file_info['tmp_name'], $file_info['name']);
list($width,$height) = getimagesize($file_info['tmp_name']);
if($width>=$height)
$this->resizePicture('width',720);
else
$this->resizePicture('height',540);
$this->save();
}
}

@ -362,7 +362,7 @@ if($modifyAnswers)
// Check to see if the version meets the requirements for playback
if (hasReqestedVersion) { // if we've detected an acceptable version
var oeTags = '<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_admin.swf?modifyAnswers=<?php echo $modifyAnswers ?>" width="720" height="720">'
var oeTags = '<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_admin.swf?modifyAnswers=<?php echo $modifyAnswers ?>" width="720" height="650">'
+ '<param name="movie" value="../plugin/hotspot/hotspot_admin.swf?modifyAnswers=<?php echo $modifyAnswers ?>" />'
+ '<param name="test" value="OOoowww fo shooww" />'
+ '</object>';

Loading…
Cancel
Save