[svn r13301] Fix encoding problem by using $charset inside calls to htmlentities() and htmlspecialchars

skala
Yannick Warnier 18 years ago
parent 10c2226917
commit 41d3b1cf65
  1. 34
      main/exercice/answer_admin.inc.php
  2. 18
      main/exercice/exercice.php
  3. 142
      main/exercice/exercise.lib.php
  4. 3
      main/exercice/export/scorm/scorm_classes.php
  5. 4
      main/exercice/question_pool.php

@ -22,7 +22,7 @@
* This script allows to manage answers. It is included from the script admin.php
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: answer_admin.inc.php 12269 2007-05-03 14:17:37Z elixir_julian $
* @version $Id: answer_admin.inc.php 13301 2007-09-27 03:47:39Z yannoo $
*/
@ -990,8 +990,8 @@ if($modifyAnswers)
}
?>
<td align="left"><textarea wrap="virtual" rows="7" cols="25" name="reponse[<?php echo $i; ?>]"><?php echo htmlentities($reponse[$i]); ?></textarea></td>
<td align="left"><textarea wrap="virtual" rows="7" cols="25" name="comment[<?php echo $i; ?>]"><?php echo htmlentities($comment[$i]); ?></textarea></td>
<td align="left"><textarea wrap="virtual" rows="7" cols="25" name="reponse[<?php echo $i; ?>]"><?php echo htmlentities($reponse[$i],ENT_QUOTES,$charset); ?></textarea></td>
<td align="left"><textarea wrap="virtual" rows="7" cols="25" name="comment[<?php echo $i; ?>]"><?php echo htmlentities($comment[$i],ENT_QUOTES,$charset); ?></textarea></td>
<td valign="top"><input type="text" name="weighting[<?php echo $i; ?>]" size="5" value="<?php echo isset($weighting[$i])?$weighting[$i]:0; ?>"></td>
</tr>
@ -1005,7 +1005,7 @@ if($modifyAnswers)
<input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>">
&nbsp;&nbsp;<input type="submit" name="lessAnswers" value="<?php echo get_lang('LessAnswers'); ?>">
&nbsp;&nbsp;<input type="submit" name="moreAnswers" value="<?php echo get_lang('MoreAnswers'); ?>">
<!-- &nbsp;&nbsp;<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"> //-->
<!-- &nbsp;&nbsp;<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"> //-->
</td>
</tr>
</table>
@ -1033,7 +1033,7 @@ if($modifyAnswers)
{
?>
<input type="hidden" name="weighting" value="<?php echo $submitAnswers?htmlentities($weighting):htmlentities(serialize($weighting)); ?>">
<input type="hidden" name="weighting" value="<?php echo $submitAnswers?htmlentities($weighting,ENT_QUOTES,$charset):htmlentities(serialize($weighting),ENT_QUOTES,$charset); ?>">
<table border="0" cellpadding="5" width="500">
@ -1071,11 +1071,11 @@ if($modifyAnswers)
<td><?php echo get_lang('TypeTextBelow').', '.get_lang('And').' '.get_lang('UseTagForBlank'); ?> :</td>
</tr>
<tr>
<td><textarea wrap="virtual" name="reponse" cols="65" rows="6"><?php if(!$submitAnswers && empty($reponse)) echo get_lang('DefaultTextInBlanks'); else echo htmlentities($reponse); ?></textarea></td>
<td><textarea wrap="virtual" name="reponse" cols="65" rows="6"><?php if(!$submitAnswers && empty($reponse)) echo get_lang('DefaultTextInBlanks'); else echo htmlentities($reponse,ENT_QUOTES,$charset); ?></textarea></td>
</tr>
<tr>
<td colspan="5">
<!-- <input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;">
<!-- <input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;">
&nbsp;&nbsp; //--> <input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>">
</td>
</tr>
@ -1086,8 +1086,8 @@ if($modifyAnswers)
else
{
?>
<input type="hidden" name="blanks" value="<?php echo htmlentities(serialize($blanks)); ?>">
<input type="hidden" name="reponse" value="<?php echo htmlentities($reponse); ?>">
<input type="hidden" name="blanks" value="<?php echo htmlentities(serialize($blanks),ENT_QUOTES,$charset); ?>">
<input type="hidden" name="reponse" value="<?php echo htmlentities($reponse,ENT_QUOTES,$charset); ?>">
<table border="0" cellpadding="5" width="500">
<?php
if(!empty($msgErr))
@ -1136,7 +1136,7 @@ if($modifyAnswers)
<td colspan="2">
<input type="submit" name="buttonBack" value="&lt; <?php echo get_lang('Back'); ?>">
&nbsp;&nbsp;<input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>">
<!-- &nbsp;&nbsp;<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"> //-->
<!-- &nbsp;&nbsp;<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"> //-->
</td>
</tr>
</table>
@ -1195,7 +1195,7 @@ if($modifyAnswers)
if(!$submitAnswers && empty($free_comment))
echo '';
else
echo htmlentities($free_comment); ?>
echo htmlentities($free_comment,ENT_QUOTES,$charset); ?>
<tr><td width="22%"><?php echo get_lang('QuestionWeighting'); ?></td>
<td width="78%"><input type="text" size="4" name="weighting" value="<?php if(!$submitAnswers && !isset($weighting)) echo '0'; else echo $weighting; ?>"></td>
</tr>
@ -1274,7 +1274,7 @@ if($modifyAnswers)
<tr>
<td><?php echo $j; ?></td>
<td><input type="text" name="match[<?php echo $i; ?>]" size="58" value="<?php if(!$formSent && !isset($match[$i])) echo ${"langDefaultMakeCorrespond$j"}; else echo htmlentities($match[$i]); ?>"></td>
<td><input type="text" name="match[<?php echo $i; ?>]" size="58" value="<?php if(!$formSent && !isset($match[$i])) echo ${"langDefaultMakeCorrespond$j"}; else echo htmlentities($match[$i],ENT_QUOTES,$charset); ?>"></td>
<td align="center"><select name="sel[<?php echo $i; ?>]">
<?php
@ -1313,7 +1313,7 @@ if($modifyAnswers)
<tr>
<td><?php echo $val; ?></td>
<td colspan="3"><input type="text" name="option[<?php echo $key; ?>]" size="80" value="<?php if(!$formSent && !isset($option[$key])) echo get_lang("DefaultMatchingOpt$val"); else echo htmlentities($option[$key]); ?>"></td>
<td colspan="3"><input type="text" name="option[<?php echo $key; ?>]" size="80" value="<?php if(!$formSent && !isset($option[$key])) echo get_lang("DefaultMatchingOpt$val"); else echo htmlentities($option[$key],ENT_QUOTES,$charset); ?>"></td>
</tr>
<?php
@ -1331,7 +1331,7 @@ if($modifyAnswers)
</tr>
<tr>
<td colspan="4">
<!-- <input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;">
<!-- <input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;">
&nbsp;&nbsp; //--> <input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>">
</td>
</tr>
@ -1420,8 +1420,8 @@ if($modifyAnswers)
<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 htmlentities($comment[$i]); ?></textarea></td>
<td valign="top" align="left"><input type="text" name="reponse[<?php echo $i; ?>]" value="<?php echo htmlentities($reponse[$i],ENT_QUOTES,$charset); ?>" size="12" /></td>
<td align="left"><textarea wrap="virtual" rows="3" cols="10" name="comment[<?php echo $i; ?>]" style="width: 100%"><?php echo htmlentities($comment[$i],ENT_QUOTES,$charset); ?></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>
@ -1437,7 +1437,7 @@ if($modifyAnswers)
<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;" />
<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;" />
</td>
</tr>
</table>

@ -565,7 +565,7 @@ if($show == 'test'){
<?php $row['title']=api_parse_tex($row['title']); ?>
<td>
<a href="exercice_submit.php?<?php echo api_get_cidreq().$myorigin.$mylpid.$mylpitemid; ?>&exerciseId=<?php echo $row['id']; ?>" <?php if(!$row['active']) echo 'class="invisible"'; ?>><?php echo $row['title']; ?></a>
<a href="exercise_admin.php?modifyExercise=yes&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/edit.gif" border="0" title="<?php echo htmlentities(get_lang('Modify')); ?>" alt="<?php echo htmlentities(get_lang('Modify')); ?>" /></a>
<a href="exercise_admin.php?modifyExercise=yes&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/edit.gif" border="0" title="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" alt="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" /></a>
</td>
</tr>
</table>
@ -578,21 +578,21 @@ if($show == 'test'){
echo $rowi.' '.strtolower(get_lang('Questions')).'</td>';
echo '<td width="5%" align="center"><a href="exercice.php?choice=exportqti2&exerciseId='.$row['id'].'"><img src="../img/export.png" border="0" title="IMS/QTI" /></a></td>';
?>
<td width="12%" align="center"><a href="admin.php?exerciseId=<?php echo $row['id']; ?>"><img src="../img/wizard_small.gif" border="0" title="<?php echo htmlentities(get_lang('Build')); ?>" alt="<?php echo htmlentities(get_lang('Build')); ?>" /></a>
<a href="exercice.php?choice=delete&exerciseId=<?php echo $row['id']; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSureToDelete'))); echo " ".$row['title']; echo "?"; ?>')) return false;"> <img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete')); ?>" /></a>
<td width="12%" align="center"><a href="admin.php?exerciseId=<?php echo $row['id']; ?>"><img src="../img/wizard_small.gif" border="0" title="<?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?>" alt="<?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?>" /></a>
<a href="exercice.php?choice=delete&exerciseId=<?php echo $row['id']; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSureToDelete'),ENT_QUOTES,$charset)); echo " ".$row['title']; echo "?"; ?>')) return false;"> <img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?>" /></a>
<?php
// if active
if($row['active'])
{
?>
<a href="exercice.php?choice=disable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate')); ?>" /></a>
<a href="exercice.php?choice=disable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?>" /></a>
<?php
}
// else if not active
else
{
?>
<a href="exercice.php?choice=enable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate')); ?>" /></a>
<a href="exercice.php?choice=enable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?>" /></a>
<?php
}
echo "</td>";
@ -731,22 +731,22 @@ if($show == 'test'){
</tr>
</table></td>
<td></td>
<td width="12%" align="center"><a href="adminhp.php?hotpotatoesName=<?php echo $path; ?>"> <img src="../img/edit.gif" border="0" alt="<?php echo htmlentities(get_lang('Modify')); ?>" /></a>
<a href="<?php echo $exercicePath; ?>?hpchoice=delete&file=<?php echo $path; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSure')).$title."?"); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete')); ?>" /></a>
<td width="12%" align="center"><a href="adminhp.php?hotpotatoesName=<?php echo $path; ?>"> <img src="../img/edit.gif" border="0" alt="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" /></a>
<a href="<?php echo $exercicePath; ?>?hpchoice=delete&file=<?php echo $path; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSure'),ENT_QUOTES,$charset).$title."?"); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?>" /></a>
<?php
// if active
if($active)
{
$nbrActiveTests = $nbrActiveTests + 1;
?>
<a href="<?php echo $exercicePath; ?>?hpchoice=disable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate')); ?>" /></a>
<a href="<?php echo $exercicePath; ?>?hpchoice=disable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?>" /></a>
<?php
}
// else if not active
else
{
?>
<a href="<?php echo $exercicePath; ?>?hpchoice=enable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate')); ?>" /></a>
<a href="<?php echo $exercicePath; ?>?hpchoice=enable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?>" /></a>
<?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 13177 2007-09-21 14:50:21Z elixir_inter $
* @version $Id: exercise.lib.php 13301 2007-09-27 03:47:39Z yannoo $
*/
@ -48,27 +48,27 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
$questionName=$objQuestionTmp->selectTitle();
$questionDescription=$objQuestionTmp->selectDescription();
$s="<tr>
<td valign='top' colspan='2'>&nbsp;";
$questionName=api_parse_tex($questionName);
$s.=$questionName;
$s.="</td>
</tr>
<tr>
<td valign='top' colspan='2'>
<i>";
$questionDescription=api_parse_tex($questionDescription);
$s.=$questionDescription;
$s.="</i>
</td>
</tr>";
if(!empty($pictureName))
$s="<tr>
<td valign='top' colspan='2'>&nbsp;";
$questionName=api_parse_tex($questionName);
$s.=$questionName;
$s.="</td>
</tr>
<tr>
<td valign='top' colspan='2'>
<i>";
$questionDescription=api_parse_tex($questionDescription);
$s.=$questionDescription;
$s.="</i>
</td>
</tr>";
if(!empty($pictureName))
{
$s.="
<tr>
<td align='center' colspan='2'><img src='../document/download.php?doc_url=%2Fimages%2F'".$pictureName."' border='0'></td>
</tr>";
$s.="
<tr>
<td align='center' colspan='2'><img src='../document/download.php?doc_url=%2Fimages%2F'".$pictureName."' border='0'></td>
</tr>";
}
} // end if(!$onlyAnswers)
@ -86,30 +86,30 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
$Select=array();
}
elseif($answerType == FREE_ANSWER)
{
{
#$comment = $objAnswerTmp->selectComment(1);
//
$upload_path = api_get_path(REL_COURSE_PATH).$_SESSION['_course']['path'].'/document/';
$oFCKeditor = new FCKeditor("choice[".$questionId."]") ;
$oFCKeditor->BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";
$oFCKeditor->Config['IMUploadPath'] = 'upload/test/';
$oFCKeditor->ToolbarSet = "Test";
$oFCKeditor->Width = '80%';
$oFCKeditor->Height = '300';
$oFCKeditor->Value = '' ;
$TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_course"]["language"]."'";
$result_sql=api_sql_query($sql);
$isocode_language=mysql_result($result_sql,0,0);
$oFCKeditor->Config['DefaultLanguage'] = $isocode_language;
$s .= "<tr><td colspan='2'>".$oFCKeditor->CreateHtml()."</td></tr>";
$upload_path = api_get_path(REL_COURSE_PATH).$_SESSION['_course']['path'].'/document/';
$oFCKeditor = new FCKeditor("choice[".$questionId."]") ;
$oFCKeditor->BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";
$oFCKeditor->Config['IMUploadPath'] = 'upload/test/';
$oFCKeditor->ToolbarSet = "Test";
$oFCKeditor->Width = '80%';
$oFCKeditor->Height = '300';
$oFCKeditor->Value = '' ;
$TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_course"]["language"]."'";
$result_sql=api_sql_query($sql);
$isocode_language=mysql_result($result_sql,0,0);
$oFCKeditor->Config['DefaultLanguage'] = $isocode_language;
$s .= "<tr><td colspan='2'>".$oFCKeditor->CreateHtml()."</td></tr>";
//$s.="<tr><td colspan='2'><textarea cols='80' rows='10' name='choice[".$questionId."]'>$answer</textarea></td></tr>";
}
}
for($answerId=1;$answerId <= $nbrAnswers;$answerId++)
{
@ -190,15 +190,15 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
}
else
{
$s.="
<tr>
<td colspan='2'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>";
$answer=api_parse_tex($answer);
$s.="<td width='40%' valign='top'><b>".$cpt2."</b>.&nbsp;".$answer."</td>
<td width='20%' align='center'>&nbsp;&nbsp;<select name='choice[".$questionId."][".$answerId."]'>
<option value='0'>--</option>";
$s.="
<tr>
<td colspan='2'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>";
$answer=api_parse_tex($answer);
$s.="<td width='40%' valign='top'><b>".$cpt2."</b>.&nbsp;".$answer."</td>
<td width='20%' align='center'>&nbsp;&nbsp;<select name='choice[".$questionId."][".$answerId."]'>
<option value='0'>--</option>";
// fills the list-box
foreach($Select as $key=>$val)
@ -208,16 +208,16 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
} // end foreach()
$s.="</select>&nbsp;&nbsp;</td>
<td width='40%' valign='top'>";
if(isset($Select[$cpt2])) $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
else $s.='&nbsp;';
$s.="
</td>
</tr>
</table>
</td>
</tr>";
$s.="</select>&nbsp;&nbsp;</td>
<td width='40%' valign='top'>";
if(isset($Select[$cpt2])) $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
else $s.='&nbsp;';
$s.="
</td>
</tr>
</table>
</td>
</tr>";
$cpt2++;
@ -229,18 +229,18 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
{
$s.="<tr>
<td colspan='2'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td width='60%' colspan='2'>&nbsp;</td>
<td width='40%' valign='top'>";
$s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
$s.="</td>
</tr>
</table>
</td>
</tr>";
$s.="<tr>
<td colspan='2'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td width='60%' colspan='2'>&nbsp;</td>
<td width='40%' valign='top'>";
$s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
$s.="</td>
</tr>
</table>
</td>
</tr>";
$cpt2++;

@ -293,6 +293,7 @@ class ScormAnswerFillInBlanks extends Answer
*/
function export()
{
global $charset;
$js = '';
$html = '<tr><td colspan="2"><table width="100%">' . "\n";
// get all enclosed answers
@ -323,7 +324,7 @@ class ScormAnswerFillInBlanks extends Answer
$texstring=substr($answer,$startlocations,($endlocations-$startlocations)+1);
$answer = substr_replace($answer,'<input type="text" name="question_'.$this->questionId.'_fib_'.$i.'" id="question_'.$this->questionId.'_fib_'.$i.'" size="10" value="" />',$startlocations,($endlocations-$startlocations)+1);
$jstmp .= $i.',';
$jstmpc .= "'".htmlentities(substr($texstring,1,-1),ENT_QUOTES)."',";
$jstmpc .= "'".htmlentities(substr($texstring,1,-1),ENT_QUOTES,$charset)."',";
$jstmpw .= 'questions_answers_ponderation['.$this->questionId.']['.$i.'] = '.$weights[$i-1].";\n";
$i++;
$startlocations=strpos($answer,'[');

@ -24,7 +24,7 @@
* One question can be in several exercises
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question_pool.php 12269 2007-05-03 14:17:37Z elixir_julian $
* @version $Id: question_pool.php 13301 2007-09-27 03:47:39Z yannoo $
*/
// name of the language file that needs to be included
@ -312,7 +312,7 @@ if($is_allowedToEdit)
?>
<td align="center">
<a href="<?php echo api_get_self(); ?>?exerciseId=<?php echo $exerciseId; ?>&delete=<?php echo $row[id]; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo get_lang('Delete'); ?>"></a>
<a href="<?php echo api_get_self(); ?>?exerciseId=<?php echo $exerciseId; ?>&delete=<?php echo $row[id]; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo get_lang('Delete'); ?>"></a>
</td>
<?php

Loading…
Cancel
Save