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

skala
Eric Marguin 19 years ago
parent f6b4ecb9a1
commit 662e7bb97a
  1. 6
      main/exercice/exercise.lib.php
  2. 21
      main/exercice/exercise_result.php
  3. 2
      main/exercice/hotspot.class.php
  4. 119
      main/exercice/hotspot_admin.inc.php
  5. BIN
      main/plugin/hotspot/hotspot_admin.fla
  6. BIN
      main/plugin/hotspot/hotspot_admin.swf
  7. BIN
      main/plugin/hotspot/hotspot_solution.swf
  8. BIN
      main/plugin/hotspot/hotspot_user.fla
  9. BIN
      main/plugin/hotspot/hotspot_user.swf

@ -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 12439 2007-05-21 08:14:11Z elixir_julian $
* @version $Id: exercise.lib.php 13128 2007-09-20 13:38:47Z elixir_inter $
*/
@ -415,7 +415,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
}
// -->
</script>";
$s .= '<tr><td valign="top" colspan="2"><table><tr><td>'."
$s .= '<tr><td valign="top" colspan="2" width="100%"><table><tr><td width="100%">'."
<script language=\"JavaScript\" type=\"text/javascript\">
<!--
// Version check based upon the values entered above in \"Globals\"
@ -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=\"380\" height=\"470\">'
var oeTags = '<object type=\"application/x-shockwave-flash\" data=\"../plugin/hotspot/hotspot_user.swf?modifyAnswers=".$questionId."&amp;canClick:".$canClick."\" width=\"720\" height=\"720\">'
+ '<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

@ -25,7 +25,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring
* @version $Id: exercise_result.php 13045 2007-09-17 12:57:17Z elixir_inter $
* @version $Id: exercise_result.php 13128 2007-09-20 13:38:47Z elixir_inter $
*
* @todo split more code up in functions, move functions to library?
*/
@ -398,13 +398,7 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
{
?>
<tr>
<td width="40%">
<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="570" height="600">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers=<?php echo $questionId ?>" />
</object>
</td>
<td width="60%" valign="top">
<td valign="top" colspan="2">
<table width="100%" border="0">
<tr>
<td width="25%" valign="top">
@ -693,6 +687,17 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
{
// We made an extra table for the answers
echo "</table></td></tr>";
?>
<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>
</td>
</tr>
<?php
}
?>
<tr>

@ -69,7 +69,7 @@ class HotSpot extends Question {
if(!empty($file_info['tmp_name']))
{
$this->uploadPicture($file_info['tmp_name'], $file_info['name']);
$this->resizePicture('any',350);
$this->resizePicture('any',720);
$this->save();
}
}

@ -292,13 +292,68 @@ if($modifyAnswers)
{
Display::display_normal_message($msgErr); //main API
}
?>
?>
<form method="post" action="<?php echo api_get_self(); ?>?hotspotadmin=<?php echo $modifyAnswers; ?>" name="frm_exercise">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="2" style="border:1px solid #4271b5; border-bottom:none;"><?php echo stripslashes(get_lang('HotspotChoose')); ?></td>
<td colspan="2" style="border:1px solid #4271b5;"><?php echo stripslashes(get_lang('HotspotChoose')); ?></td>
</tr>
<tr>
<td valign="top" style="border:1px solid #4271b5;border-top:none; border-right:none; border-bottom:none">
<input type="hidden" name="formSent" value="1" />
<input type="hidden" name="nbrAnswers" value="<?php echo $nbrAnswers; ?>" />
<table class="data_table">
<!--
<tr>
<td colspan="5"><?php echo get_lang('AnswerHotspot'); ?> :</td>
</tr>
-->
<tr>
<th width="5">&nbsp;<?php /* echo get_lang('Hotspot'); */ ?></th>
<th ><?php echo get_lang('Description'); ?>*</th>
<th ><?php echo get_lang('Comment'); ?></th>
<th><?php echo get_lang('QuestionWeighting'); ?>*</th>
</tr>
<?php
for($i=1;$i <= $nbrAnswers;$i++)
{
?>
<tr>
<td valign="top"><div style="height: 15px; width: 15px; background-color: <?php echo $hotspot_colors[$i]; ?>"> </div></td>
<td valign="top" align="left"><input type="text" name="reponse[<?php echo $i; ?>]" value="<?php echo htmlentities($reponse[$i]); ?>" size="45" /></td>
<td align="left"><textarea wrap="virtual" rows="3" cols="25" name="comment[<?php echo $i; ?>]" style="width: 100%"><?php echo stripslashes(htmlentities($comment[$i])); ?></textarea></td>
<td valign="top"><input type="text" name="weighting[<?php echo $i; ?>]" size="1" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 1); ?>" />
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>" />
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>" /></td>
</tr>
<?php
}
?>
</table>
<table cellpadding="0" cellspacing="0">
<tr>
<td style="text-align:center; vertical-align:top; width:20px;">*</td>
<td style="width:auto;"><?php echo get_lang('HotspotRequired'); ?></td>
</tr>
</table>
</td>
<td style="border-right:1px solid #4271b5;" valign="bottom">
<input type="submit" name="lessAnswers" value="<?php echo get_lang('LessHotspots'); ?>" />
<input type="submit" name="moreAnswers" value="<?php echo get_lang('MoreHotspots'); ?>" /><br /><br /><br />
</td>
</tr>
<tr>
<td colspan="2" style="border:1px solid #4271b5;border-top:none;padding-bottom:3px;margin-bottom:5px;">
<input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>" />
<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;" />
</td>
</tr>
<tr>
<td width="550" valign="top">
<td colspan="2" valign="top" style="border:1px solid #4271b5;border-top:none">
<script type="text/javascript">
<!--
// Version check based upon the values entered above in "Globals"
@ -307,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="550" height="377">'
var oeTags = '<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_admin.swf?modifyAnswers=<?php echo $modifyAnswers ?>" width="720" height="720">'
+ '<param name="movie" value="../plugin/hotspot/hotspot_admin.swf?modifyAnswers=<?php echo $modifyAnswers ?>" />'
+ '<param name="test" value="OOoowww fo shooww" />'
+ '</object>';
@ -321,62 +376,10 @@ if($modifyAnswers)
// -->
</script>
</td>
<td valign="top">
<form method="post" action="<?php echo api_get_self(); ?>?hotspotadmin=<?php echo $modifyAnswers; ?>" name="frm_exercise">
<input type="hidden" name="formSent" value="1" />
<input type="hidden" name="nbrAnswers" value="<?php echo $nbrAnswers; ?>" />
<table class="data_table">
<!--
<tr>
<td colspan="5"><?php echo get_lang('AnswerHotspot'); ?> :</td>
</tr>
-->
<tr>
<th >&nbsp;<?php /* echo get_lang('Hotspot'); */ ?></th>
<th ><?php echo get_lang('Description'); ?>*</th>
<th ><?php echo get_lang('Comment'); ?></th>
<th ><?php echo get_lang('QuestionWeighting'); ?>*</th>
</tr>
<?php
for($i=1;$i <= $nbrAnswers;$i++)
{
?>
<tr>
<td valign="top"><div style="height: 15px; width: 15px; background-color: <?php echo $hotspot_colors[$i]; ?>"> </div></td>
<td valign="top" align="left"><input type="text" name="reponse[<?php echo $i; ?>]" value="<?php echo htmlentities($reponse[$i]); ?>" size="12" /></td>
<td align="left"><textarea wrap="virtual" rows="3" cols="10" name="comment[<?php echo $i; ?>]" style="width: 100%"><?php echo stripslashes(htmlentities($comment[$i])); ?></textarea></td>
<td valign="top"><input type="text" name="weighting[<?php echo $i; ?>]" size="1" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 1); ?>" />
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>" />
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>" /></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5">
<input type="submit" name="lessAnswers" value="<?php echo get_lang('LessHotspots'); ?>" />
<input type="submit" name="moreAnswers" value="<?php echo get_lang('MoreHotspots'); ?>" />
<hr noshade="noshade" size="1" style="color: #4271b5" />
<input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>" />
<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;" />
</td>
</tr>
</table>
</form>
<table cellpadding="0" cellspacing="0">
<tr>
<td style="text-align:center; vertical-align:top; width:20px;">*</td>
<td style="width:auto;"><?php echo get_lang('HotspotRequired'); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

Loading…
Cancel
Save