diff --git a/main/exercice/admin.php b/main/exercice/admin.php
index 3412be8eaf..e4f49ab59d 100755
--- a/main/exercice/admin.php
+++ b/main/exercice/admin.php
@@ -424,7 +424,7 @@ if (isset($exerciseId) && !empty($exerciseId)) {
echo '
';
if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
-echo Display::return_icon('back.png', get_lang('GoBackToQuestionList')).' '.'
'.get_lang('GoBackToQuestionList').'';
+echo Display::return_icon('back.png', get_lang('GoBackToQuestionList')).' '.'
'.get_lang('GoBackToQuestionList').'';
echo Display::return_icon('preview.gif', get_lang('Preview')).'
'.get_lang('Preview').'';
echo Display::return_icon('edit.gif', get_lang('ModifyExercise')).'
'.get_lang('ModifyExercise').'';
diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php
index 16d26792c6..0eed668971 100755
--- a/main/exercice/exercise.lib.php
+++ b/main/exercice/exercise.lib.php
@@ -21,7 +21,7 @@ require_once dirname(__FILE__).'/../inc/lib/fckeditor/fckeditor.php';
* @param int current item from the list of questions
* @param int number of total questions
* */
-function showQuestion($questionId, $onlyAnswers = false, $origin = false, $current_item = '', $show_title = true) {
+function showQuestion($questionId, $onlyAnswers = false, $origin = false, $current_item = '', $show_title = true, $freeze = false) {
// Text direction for the current language
$is_ltr_text_direction = api_get_text_direction() != 'rtl';
@@ -76,6 +76,10 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
} else {
$option_ie="margin-left:10px";
}
+
+ if ($answerType == FREE_ANSWER && $freeze) {
+ return '';
+ }
$s .= '
';
// construction of the Answer object (also gets all answers details)
$objAnswerTmp=new Answer($questionId);
@@ -118,17 +122,19 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
}
$num_suggestions = ($nbrAnswers - $x) + 1;
} elseif ($answerType == FREE_ANSWER) {
- #$comment = $objAnswerTmp->selectComment(1);
- //
-
$oFCKeditor = new FCKeditor("choice[".$questionId."]") ;
-
$oFCKeditor->ToolbarSet = 'TestFreeAnswer';
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '200';
$oFCKeditor->Value = '' ;
+
+
+ $s .= '| ';
+ $s .= $oFCKeditor->CreateHtml();
+ $s .= ' |
';
+
+
- $s .= '| '.$oFCKeditor->CreateHtml()." |
";
//$s.=" |
";
}
@@ -190,7 +196,6 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
''.
$answer.
'
';
-
} elseif ($answerType == MULTIPLE_ANSWER_COMBINATION) {
// multiple answers
// set $debug_mark_answer to true at function start to
@@ -214,7 +219,6 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
} elseif ($answerType == FILL_IN_BLANKS) {
// fill in blanks
$s .= '| '.$answer.' |
';
-
} else {
// matching type, showing suggestions and answers
// TODO: replace $answerId by $numAnswer
@@ -311,6 +315,11 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
}
$questionName = $objQuestionTmp->selectTitle();
$questionDescription = $objQuestionTmp->selectDescription();
+
+ if ($freeze) {
+ echo Display::img($objQuestionTmp->selectPicturePath());
+ exit;
+ }
// Get the answers, make a list
$objAnswerTmp = new Answer($questionId);
@@ -347,10 +356,12 @@ function showQuestion($questionId, $onlyAnswers = false, $origin = false, $curre
echo $questionDescription=text_filter($questionDescription);
echo '';
}
+
+
+
+
$canClick = isset($_GET['editQuestion']) ? '0' : (isset($_GET['modifyAnswers']) ? '0' : '1');
- //$tes = isset($_GET['modifyAnswers']) ? '0' : '1';
- //echo $tes;
$s .= '
diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php
index 122ca70214..214b4e2fb2 100755
--- a/main/exercice/question.class.php
+++ b/main/exercice/question.class.php
@@ -212,6 +212,15 @@ abstract class Question
{
return $this->picture;
}
+
+ function selectPicturePath() {
+ global $_course;
+ if (!empty($this->picture)) {
+ return api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/images/'.$this->picture;
+ }
+ return false;
+
+ }
/**
* returns the array with the exercise ID list
diff --git a/main/exercice/question_list_admin.inc.php b/main/exercice/question_list_admin.inc.php
index 072d31480c..35cdc2975a 100755
--- a/main/exercice/question_list_admin.inc.php
+++ b/main/exercice/question_list_admin.inc.php
@@ -64,6 +64,7 @@ if($deleteQuestion) {