Function modified in order to accept exercise_result.php calls

skala
Julio Montoya 15 years ago
parent 9b793c10af
commit 1aba26fe5b
  1. 37
      main/inc/lib/exercise_show_functions.lib.php

@ -31,8 +31,11 @@ class ExerciseShowFunctions {
* @return void * @return void
*/ */
function display_fill_in_blanks_answer($answer,$id,$questionId) function display_fill_in_blanks_answer($answer,$id,$questionId) {
{ global $feedback_type; global $feedback_type;
if (empty($id)) {
echo '<tr><td>'. nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)).'</td></tr>';
} else {
?> ?>
<tr> <tr>
<td> <td>
@ -50,6 +53,7 @@ class ExerciseShowFunctions {
</tr> </tr>
<?php <?php
}
} }
/** /**
@ -60,13 +64,30 @@ class ExerciseShowFunctions {
* @return void * @return void
*/ */
function display_free_answer($answer,$id,$questionId) { function display_free_answer($answer,$id,$questionId) {
global $feedback_type; global $feedback_type;
if (empty($id)) {
?>
<tr>
<td width="55%">
<?php echo nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)); ?>
</td>
<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
<td width="45%">
<?php echo get_lang('notCorrectedYet');?>
</td>
<?php } else { ?>
<td>&nbsp;</td>
<?php } ?>
</tr>
<?php
} else {
?> ?>
<tr> <tr>
<td> <td>
<?php if (!empty($answer)) {echo nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY));} ?> <?php if (!empty($answer)) {echo nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY));} ?>
</td> </td>
<?php if(!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {?> <?php if(!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {?>
<td> <td>
<?php <?php
@ -74,10 +95,9 @@ class ExerciseShowFunctions {
?> ?>
</td> </td>
<?php }?> <?php }?>
</tr> </tr>
<?php <?php
}
} }
/** /**
@ -337,4 +357,9 @@ class ExerciseShowFunctions {
$result = @api_mail_html('', $to, $subject, $mail_content, $sender_name, $email_admin, array('charset'=>$mycharset)); $result = @api_mail_html('', $to, $subject, $mail_content, $sender_name, $email_admin, array('charset'=>$mycharset));
} }
} }
} }
Loading…
Cancel
Save