Prechádzať zdrojové kódy

Fixing exercise report for fill in blanks see #5257

Julio Montoya 12 rokov pred
rodič
commit
aa05b042b9

+ 1 - 3
main/exercice/fill_blanks.class.php

@@ -200,6 +200,4 @@ class FillBlanks extends Question
         return $header;	  
 	}
 }
-
-endif;
-?>
+endif;

+ 1 - 1
main/exercice/question.class.php

@@ -1433,6 +1433,6 @@ abstract class Question
 			eval('$img = '.$tabQuestionList[$type][1].'::$typePicture;');
 			eval('$explanation = get_lang('.$tabQuestionList[$type][1].'::$explanationLangVar);');
 			return array($img, $explanation);
-    }
+    } 
 }
 endif;

+ 4 - 1
main/exercice/stats.php

@@ -99,10 +99,13 @@ if (!empty($question_list)) {
         
         for ($answer_id = 1; $answer_id <= $answer_count; $answer_id++) {            
             $answer_info = $answer->selectAnswer($answer_id);            
-            if ($answer_id == 1) {
+            if ($answer_id == 1) {                
                 $data[$id]['name']      = cut($question_obj->question, 100);
             } else {
                 $data[$id]['name']      = '-';
+            }       
+            if ($question_obj->type == FILL_IN_BLANKS) {
+                $answer_info = substr($answer_info, 0, strpos($answer_info, '::'));
             }
             $data[$id]['answer'] 	= $answer_info;
             $is_correct = $answer->isCorrect($answer_id);