Browse Source

Fix new exercise UI result see BT#11784

jmontoyaa 8 years ago
parent
commit
d11025ef3e

+ 2 - 3
main/exercise/UniqueAnswerImage.php

@@ -361,14 +361,13 @@ class UniqueAnswerImage extends UniqueAnswer
 
     public function return_header($feedback_type = null, $counter = null, $score = null)
     {
-        $header = parent::return_header($feedback_type, $counter, $score);
-        $header .= '<table class="' . $this->question_table_class . '">
+        $header = '<table class="' . $this->question_table_class . '">
 			<tr>
 				<th>' . get_lang("Choice") . '</th>
 				<th>' . get_lang("ExpectedChoice") . '</th>
 				<th>' . get_lang("Answer") . '</th>';
         $header .= '<th>' . get_lang('Status') . '</th>';
-        $header .= '<th>' . get_lang("Comment") . '</th>';
+        $header .= '<th>' . get_lang('Comment') . '</th>';
         $header .= '</tr>';
 
         return $header;

+ 1 - 1
main/exercise/exercise.class.php

@@ -4255,7 +4255,7 @@ class Exercise
                                 $results_disabled,
                                 $showTotalScoreAndUserChoicesInLastAttempt
                             );
-                        } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE ) {
+                        } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
                             ExerciseShowFunctions::display_multiple_answer_combination_true_false(
                                 $feedback_type,
                                 $answerType,

+ 2 - 1
main/exercise/unique_answer.class.php

@@ -405,7 +405,8 @@ class UniqueAnswer extends Question
 				<th>' . get_lang("Choice") . '</th>
 				<th>' . get_lang("ExpectedChoice") . '</th>
 				<th>' . get_lang("Answer") . '</th>';
-        $header .= '<th>' . get_lang("Comment") . '</th>';
+        $header .= '<th>' . get_lang("Status") . '</th>';
+        $header .= '<th>'.get_lang('Comment').'</th>';
         $header .= '</tr>';
 
         return $header;

+ 7 - 0
main/inc/lib/exercise.lib.php

@@ -3767,7 +3767,14 @@ HOTSPOT;
             $exercise_content
         );
 
+
         echo $total_score_text;
+
+        // Ofaj change BT#11784
+        if (!empty($objExercise->description)) {
+            echo Display::div($objExercise->description, array('class'=>'exercise_description'));
+        }
+
         echo $exercise_content;
 
         if (!$show_only_score) {

+ 16 - 12
main/inc/lib/exercise_show_functions.lib.php

@@ -233,9 +233,9 @@ class ExerciseShowFunctions
 
         if ($resultsDisabled == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
             if ($showTotalScoreAndUserChoices) {
-                $hide_expected_answer = true;
-            } else {
                 $hide_expected_answer = false;
+            } else {
+                $hide_expected_answer = true;
             }
         }
 
@@ -321,9 +321,9 @@ class ExerciseShowFunctions
 
         if ($resultsDisabled == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
             if ($showTotalScoreAndUserChoices) {
-                $hide_expected_answer = true;
-            } else {
                 $hide_expected_answer = false;
+            } else {
+                $hide_expected_answer = true;
             }
         }
 
@@ -355,10 +355,12 @@ class ExerciseShowFunctions
 		</td>
 
         <?php
-        $status = Display::label(get_lang('Incorrect'), 'danger');
+        $status = '';
         if ($studentChoice) {
             if ($answerCorrect) {
                 $status = Display::label(get_lang('Correct'), 'success');
+            } else {
+                $status = Display::label(get_lang('Incorrect'), 'danger');
             }
         }
      ?>
@@ -432,9 +434,9 @@ class ExerciseShowFunctions
 
         if ($resultsDisabled == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
             if ($showTotalScoreAndUserChoices) {
-                $hide_expected_answer = true;
-            } else {
                 $hide_expected_answer = false;
+            } else {
+                $hide_expected_answer = true;
             }
         }
 
@@ -546,12 +548,11 @@ class ExerciseShowFunctions
 
         if ($resultsDisabled == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
             if ($showTotalScoreAndUserChoices) {
-                $hide_expected_answer = true;
-            } else {
                 $hide_expected_answer = false;
+            } else {
+                $hide_expected_answer = true;
             }
         }
-
         ?>
         <tr>
         <td width="5%">
@@ -589,10 +590,13 @@ class ExerciseShowFunctions
         </td>
 
          <?php
-        $status = Display::label(get_lang('Incorrect'), 'danger');
-        if ($studentChoice) {
+
+        $status = '';
+        if (isset($studentChoice)) {
             if ($studentChoice == $answerCorrect) {
                 $status = Display::label(get_lang('Correct'), 'success');
+            } else {
+                $status = Display::label(get_lang('Incorrect'), 'danger');
             }
         }
         ?>