Forráskód Böngészése

Fix show question result when reading comprehension is failed #1896

Angel Fernando Quiroz Campos 7 éve
szülő
commit
1322a8caf5
2 módosított fájl, 21 hozzáadás és 2 törlés
  1. 7 0
      main/exercise/exercise.class.php
  2. 14 2
      main/exercise/question.class.php

+ 7 - 0
main/exercise/exercise.class.php

@@ -4505,11 +4505,18 @@ class Exercise
 
                     switch ($answerType) {
                         case UNIQUE_ANSWER:
+                            //no break
                         case UNIQUE_ANSWER_IMAGE:
+                            //no break
                         case UNIQUE_ANSWER_NO_OPTION:
+                            //no break
                         case MULTIPLE_ANSWER:
+                            //no break
                         case GLOBAL_MULTIPLE_ANSWER :
+                            //no break
                         case MULTIPLE_ANSWER_COMBINATION:
+                            //no break
+                        case READING_COMPREHENSION:
                             if ($answerId == 1) {
                                 ExerciseShowFunctions::display_unique_or_multiple_answer(
                                     $feedback_type,

+ 14 - 2
main/exercise/question.class.php

@@ -1913,9 +1913,21 @@ abstract class Question
             $header .= Display::div($this->description, array('class' => 'question_description'));
         } else {
             if ($score['pass'] == true) {
-                $message = Display::div(sprintf(get_lang('ReadingQuestionCongratsSpeedXReachedForYWords'), $this->speeds[$this->level], $this->getWordsCount()));
+                $message = Display::div(
+                    sprintf(
+                        get_lang('ReadingQuestionCongratsSpeedXReachedForYWords'),
+                        ReadingComprehension::$speeds[$this->level],
+                        $this->getWordsCount()
+                    )
+                );
             } else {
-                $message = Display::div(sprintf(get_lang('ReadingQuestionCongratsSpeedXNotReachedForYWords'), $this->speeds[$this->level], $this->getWordsCount()));
+                $message = Display::div(
+                    sprintf(
+                        get_lang('ReadingQuestionCongratsSpeedXNotReachedForYWords'),
+                        ReadingComprehension::$speeds[$this->level],
+                        $this->getWordsCount()
+                    )
+                );
             }
             $header .= $message.'<br />';
         }