diff --git a/main/css/base.css b/main/css/base.css
index e9ef931327..554e963749 100644
--- a/main/css/base.css
+++ b/main/css/base.css
@@ -2610,6 +2610,21 @@ div.admin_section h4 {
border-bottom: 1px solid #7A290F;
}
+.ribbon .rib-gray {
+ background: #cccccc;
+
+ background-image: -ms-linear-gradient(top, #bbbbbb, #cccccc);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bbbbbb), to(#cccccc));
+ background-image: -webkit-linear-gradient(top, #bbbbbb, #cccccc);
+ background-image: -o-linear-gradient(top, #bbbbbb, #cccccc);
+ background-image: -moz-linear-gradient(top, #bbbbbb, #cccccc);
+ background-image: linear-gradient(top, #bbbbbb, #cccccc);
+
+ border-top: 1px solid #bbbbbb;
+ border-bottom: 1px solid #bbbbbb;
+}
+
+
.ribbon .rib-success, .ribbon .ribbon-total-success{
background-color: #768E00;
background-image: -ms-linear-gradient(top, #9CB80A, #768E00);
@@ -2675,6 +2690,12 @@ div.admin_section h4 {
border-color: #66751B transparent transparent transparent;
}
+.ribbon .rib-gray::before {
+ border-color: #ccc transparent transparent transparent;
+}
+
+
+
.ribbon .rib::before {left: 0;}
.ribbon .rib::after {right: 0;}
diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php
index 25e4cd5690..b3c08639e7 100644
--- a/main/exercice/exercise.lib.php
+++ b/main/exercice/exercise.lib.php
@@ -2056,7 +2056,9 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu
$score = array();
if ($show_results) {
$score['result'] = get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
- $score['pass'] = $my_total_score >= $my_total_weight ? true : false;
+ $score['pass'] = $my_total_score >= $my_total_weight ? true : false;
+ $score['score'] = $my_total_score;
+ $score['weight'] = $my_total_weight;
}
if ($show_results) {
@@ -2071,9 +2073,9 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu
$question_content = '
';
- if ($show_results) {
+ if ($show_results) {
//Shows question title an description
- $question_content .= $objQuestionTmp->return_header("", $counter, $score);
+ $question_content .= $objQuestionTmp->return_header(null, $counter, $score);
// display question category, if any
$question_content .= Testcategory::returnCategoryAndTitle($questionId);
diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php
index c0e436314c..aaf83cd4a9 100644
--- a/main/exercice/exercise_show.php
+++ b/main/exercice/exercise_show.php
@@ -286,6 +286,10 @@ foreach ($questionList as $questionId) {
// Start buffer
ob_start();
+
+ /* Use switch
+ switch ($answerType) {
+ }*/
if ($answerType == MULTIPLE_ANSWER || $answerType == MULTIPLE_ANSWER_TRUE_FALSE) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
@@ -464,12 +468,9 @@ foreach ($questionList as $questionId) {
$queryfree = "select marks from ".$TBL_TRACK_ATTEMPT." WHERE exe_id = '".Database::escape_string($id)."' and question_id= '".Database::escape_string($questionId)."'";
$resfree = Database::query($queryfree);
$questionScore= Database::result($resfree,0,"marks");
- $totalScore+=$questionScore;
- ?>
-
-
-
+ $totalScore+=$questionScore;
+ echo '';
+ echo '
|
';
- }
+ }
}
if ($show_results) {
@@ -487,67 +488,61 @@ foreach ($questionList as $questionId) {
}
}
- if ($show_results) {
- //if (0) {
- echo '
';
-
- if ($is_allowedToEdit && $locked == false && !api_is_drh() ) {
- echo '';
+ if ($show_results) {
+ if ($is_allowedToEdit && $locked == false && !api_is_drh()) {
$name = "fckdiv".$questionId;
- $marksname = "marksName".$questionId;
- ?>
-
-
- '.get_lang('EditIndividualComment');
+ $url_name = get_lang('EditIndividualComment');
} else {
- echo get_lang('AddComments');
+ $url_name = get_lang('AddComments');
}
}
- echo '
';
+ echo ' ';
+ echo Display::url($url_name, 'javascript://', array('class' => 'btn', 'onclick'=>"showfck('".$name."', '".$marksname."');"));
+ echo ' ';
+
+ echo ' ';
$comnt = trim(get_comments($id,$questionId));
if (empty($comnt)) {
echo ' ';
} else {
echo ' '.$comnt.' ';
}
- echo ' ';
+ echo ' ';
+
+ echo ' ';
$arrid[] = $questionId;
-
$feedback_form = new FormValidator('frmcomments'.$questionId,'post','');
$feedback_form->addElement('html',' ');
$renderer =& $feedback_form->defaultRenderer();
$renderer->setFormTemplate(' ');
$renderer->setElementTemplate(' {element} ');
- $comnt = get_comments($id,$questionId);
- ${user.$questionId}['comments_'.$questionId] = $comnt;
+ $comnt = get_comments($id, $questionId);
+ $default = array('comments_'.$questionId => $comnt);
$feedback_form->addElement('html_editor', 'comments_'.$questionId, null, null, array('ToolbarSet' => 'TestAnswerFeedback', 'Width' => '100%', 'Height' => '120'));
- $feedback_form->addElement('html',' ');
- //$feedback_form->addElement('submit','submitQuestion',get_lang('Ok'));
- $feedback_form->setDefaults(${user.$questionId});
+ $feedback_form->addElement('html',' ');
+ $feedback_form->setDefaults($default);
$feedback_form->display();
echo ' ';
} else {
- $comnt = get_comments($id,$questionId);
- echo ' ';
+ $comnt = get_comments($id, $questionId);
+ echo ' ';
if (!empty($comnt)) {
echo ''.get_lang('Feedback').'';
echo ''.$comnt.' ';
- }
- echo ' | ';
- }
+ }
+ }
+
if ($is_allowedToEdit) {
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION))) {
$marksname = "marksName".$questionId;
- ?>
-
-
';
}
} else {
- if ($questionScore==-1) {
- $questionScore=0;
+ if ($questionScore == -1) {
+ $questionScore = 0;
}
- }
- echo ' |
-
- |
';
+ }
}
$my_total_score = $questionScore;
@@ -586,7 +578,10 @@ foreach ($questionList as $questionId) {
$score = array();
if ($show_results) {
$score['result'] = get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
- $score['pass'] = $my_total_score >= $my_total_weight ? true : false;
+ $score['pass'] = $my_total_score >= $my_total_weight ? true : false;
+ $score['type'] = $answerType;
+ $score['score'] = $my_total_score;
+ $score['weight'] = $my_total_weight;
}
unset($objAnswerTmp);
@@ -598,7 +593,7 @@ foreach ($questionList as $questionId) {
if ($show_results) {
//Shows question title an description
- $question_content .= $objQuestionTmp->return_header("", $counter, $score);
+ $question_content .= $objQuestionTmp->return_header(null, $counter, $score);
// display question category, if any
$question_content .= Testcategory::returnCategoryAndTitle($questionId);
diff --git a/main/exercice/freeanswer.class.php b/main/exercice/freeanswer.class.php
index 112d90798f..977cf2bdbd 100644
--- a/main/exercice/freeanswer.class.php
+++ b/main/exercice/freeanswer.class.php
@@ -1,70 +1,76 @@
type = FREE_ANSWER;
+ $this->isContent = $this->getIsContent();
+ }
- static $typePicture = 'open_answer.gif';
- static $explanationLangVar = 'FreeAnswer';
+ /**
+ * function which redifines Question::createAnswersForm
+ * @param the formvalidator instance
+ */
+ function createAnswersForm($form) {
+ $form->addElement('text', 'weighting', get_lang('Weighting'), array('class' => 'span1'));
+ global $text, $class;
+ // setting the save button here and not in the question class.php
+ $form->addElement('style_submit_button', 'submitQuestion', $text, 'class="' . $class . '"');
+ if (!empty($this->id)) {
+ $form->setDefaults(array('weighting' => float_format($this->weighting, 1)));
+ } else {
+ if ($this->isContent == 1) {
+ $form->setDefaults(array('weighting' => '10'));
+ }
+ }
+ }
- /**
- * Constructor
- */
- function FreeAnswer(){
- parent::question();
- $this -> type = FREE_ANSWER;
- $this -> isContent = $this-> getIsContent();
- }
+ /**
+ * abstract function which creates the form to create / edit the answers of the question
+ * @param the formvalidator instance
+ */
+ function processAnswersCreation($form) {
+ $this->weighting = $form->getSubmitValue('weighting');
+ $this->save();
+ }
- /**
- * function which redifines Question::createAnswersForm
- * @param the formvalidator instance
- */
- function createAnswersForm ($form)
- {
- $form -> addElement('text','weighting',get_lang('Weighting'), array('class' => 'span1'));
- global $text, $class;
- // setting the save button here and not in the question class.php
- $form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
- if (!empty($this->id)) {
- $form -> setDefaults(array('weighting' => float_format($this->weighting, 1)));
- } else {
- if ($this -> isContent == 1) {
- $form -> setDefaults(array('weighting' => '10'));
- }
- }
- }
+ function return_header($feedback_type = null, $counter = null, $score = null) {
+ if ((int) $score['score'] == 0) {
+ $score['revised'] = false;
+ } else {
+ $score['revised'] = true;
+ }
- /**
- * abstract function which creates the form to create / edit the answers of the question
- * @param the formvalidator instance
- */
- function processAnswersCreation($form)
- {
- $this -> weighting = $form -> getSubmitValue('weighting');
- $this->save();
- }
-
- function return_header($feedback_type = null, $counter = null, $score = null) {
- $header = parent::return_header($feedback_type, $counter, $score);
- $header .= '
+ $header = parent::return_header($feedback_type, $counter, $score);
+ $header .= '
- '.get_lang("Answer").' |
-
';
- return $header;
- }
-}
+ ' . get_lang("Answer") . ' |
+ ';
+ return $header;
+ }
+ }
endif;
\ No newline at end of file
diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php
index 76cf517e09..9ea4150c4c 100644
--- a/main/exercice/question.class.php
+++ b/main/exercice/question.class.php
@@ -1373,6 +1373,7 @@ abstract class Question
* @param type $score
*/
function return_header($feedback_type = null, $counter = null, $score = null) {
+
$counter_label = '';
if (!empty($counter)) {
$counter_label = intval($counter);
@@ -1383,6 +1384,17 @@ abstract class Question
$score_label = get_lang('Correct');
$class = 'success';
}
+
+ if ($this->type == FREE_ANSWER) {
+ if ($score['revised'] == true) {
+ $score_label = get_lang('Revised');
+ $class = 'gray';
+ } else {
+ $score_label = get_lang('NotRevised');
+ $class = 'gray';
+ }
+ }
+
$question_title = get_lang("Question").' '.($counter_label).' : '.$this->question;
$header = Display::div(''.$score_label.'
'.$question_title.'
'.$score['result'].'
', array('class'=>'ribbon'));
$header .= Display::div($this->description, array('id'=>'question_description'));
diff --git a/main/exercice/result.php b/main/exercice/result.php
index fc5f2777b6..45152c6997 100644
--- a/main/exercice/result.php
+++ b/main/exercice/result.php
@@ -74,8 +74,7 @@ if (!$is_allowedToEdit) {
if ($show_headers) {
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "#","name" => get_lang('Result'));
- $this_section = SECTION_COURSES;
-
+ $this_section = SECTION_COURSES;
Display::display_header();
} else {
Display::display_reduced_header();
diff --git a/main/inc/lib/exercise_show_functions.lib.php b/main/inc/lib/exercise_show_functions.lib.php
index 25fccf0c58..3add72008d 100644
--- a/main/inc/lib/exercise_show_functions.lib.php
+++ b/main/inc/lib/exercise_show_functions.lib.php
@@ -206,7 +206,6 @@ class ExerciseShowFunctions {
|