diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php
index debb1eabdc..030b5d0d3f 100755
--- a/main/exercice/exercise_show.php
+++ b/main/exercice/exercise_show.php
@@ -21,8 +21,9 @@ require_once '../inc/lib/course.lib.php';
require_once 'exercise.class.php';
require_once 'question.class.php'; //also defines answer type constants
require_once 'answer.class.php';
-require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
-require_once(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
+require_once api_get_path(LIBRARY_PATH).'exercise_show_functions.lib.php';
if ( empty ( $origin ) ) {
$origin = $_REQUEST['origin'];
@@ -227,200 +228,12 @@ function getFCK(vals,marksid)
-
-
-
- |
-
-
- |
-
-
- |
-
-
- '.nl2br(make_clickable($answerComment)).'';
- }
- else{
- echo ''.nl2br(make_clickable($answerComment)).'';
- }
- }
- else
- {
- echo ' ';
- }
- ?>
- |
-
-
- |
-
-
-
-
- |
-
- |
-
-
-
- |
-
-
-
-
- |
-
- |
-
-
-
- |
-
-
-
-
- |
-
- |
-
-
- |
-
-
-
-
- '.nl2br(make_clickable($answerComment)).'';
- } else {
- echo ''.nl2br(make_clickable($answerComment)).'';
- }
- ?>
- |
-
- |
-
-
-
- ';
if ($answerId==1) {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
} else {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
}
echo ' | ';
$i++;
@@ -711,9 +524,9 @@ if ($show_results) {
echo '| ';
if ($answerId==1) {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
} else {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
}
echo ' |
';
$i++;
@@ -775,9 +588,9 @@ if ($show_results) {
}
echo '| ';
if ($answerId==1) {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,$answerId);
} else {
- display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
+ ExerciseShowFunctions::display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$id,$questionId,"");
}
echo ' |
';
$i++;
@@ -941,7 +754,7 @@ if ($show_results) {
}
//echo $questionScore."-".$totalScore;
echo '| ';
- display_fill_in_blanks_answer($answer,$id,$questionId);
+ ExerciseShowFunctions::display_fill_in_blanks_answer($answer,$id,$questionId);
echo ' |
';
$i++;
}
@@ -980,7 +793,7 @@ if ($show_results) {
$arrans[] = $choice;
echo '
- | '.display_free_answer($choice, $id, $questionId).' |
+ '.ExerciseShowFunctions::display_free_answer($choice, $id, $questionId).' |
';
@@ -1068,7 +881,7 @@ if ($show_results) {
$query = "select hotspot_correct from ".$TBL_TRACK_HOTSPOT." where hotspot_exe_id = '".Database::escape_string($id)."' and hotspot_question_id= '".Database::escape_string($questionId)."' AND hotspot_answer_id='".Database::escape_string($answerId)."'";
$resq=Database::query($query);
$choice = Database::result($resq,0,"hotspot_correct");
- display_hotspot_answer($answerId,$answer,$choice,$answerComment);
+ ExerciseShowFunctions::display_hotspot_answer($answerId,$answer,$choice,$answerComment);
$i++;
}
@@ -1108,7 +921,7 @@ if ($show_results) {
}
}
echo '
';
- $comnt = trim(get_comments($id,$questionId));
+ $comnt = trim(ExerciseShowFunctions::get_comments($id,$questionId));
if (empty($comnt)) {
echo '
';
} else {
@@ -1122,7 +935,7 @@ if ($show_results) {
$renderer =& $feedback_form->defaultRenderer();
$renderer->setFormTemplate('
');
$renderer->setElementTemplate('
{element}
');
- $comnt = get_comments($id,$questionId);
+ $comnt = ExerciseShowFunctions::get_comments($id,$questionId);
${user.$questionId}['comments_'.$questionId] = $comnt;
$feedback_form->addElement('html_editor', 'comments_'.$questionId, null, null, array('ToolbarSet' => 'TestAnswerFeedback', 'Width' => '100%', 'Height' => '120'));
$feedback_form->addElement('html','
');
@@ -1131,7 +944,7 @@ if ($show_results) {
$feedback_form->display();
echo '
';
} else {
- $comnt = get_comments($id,$questionId);
+ $comnt = ExerciseShowFunctions::get_comments($id,$questionId);
echo ' ';
if (!empty($comnt)) {
echo ''.get_lang('Feedback').'';
@@ -1266,7 +1079,7 @@ if ($origin != 'learnpath') {
echo ' |