From 1c1929e6418763f1de664f3f8c315ea0a9f1d1d2 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 28 Apr 2017 19:55:19 -0500 Subject: [PATCH] Fix calculate the number of words according the level --- main/exercise/ReadingSpeed.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/exercise/ReadingSpeed.php b/main/exercise/ReadingSpeed.php index 3cf64c267b..d1982933ac 100755 --- a/main/exercise/ReadingSpeed.php +++ b/main/exercise/ReadingSpeed.php @@ -45,7 +45,6 @@ class ReadingSpeed extends UniqueAnswer parent::__construct(); $this->type = READING_SPEED; $this->isContent = $this->getIsContent(); - $this->expectedCount = self::$speeds[$this->level]; } /** @@ -150,6 +149,9 @@ class ReadingSpeed extends UniqueAnswer public function processText($text) { + //recalulate the expected words count + $this->expectedCount = self::$speeds[$this->level]; + $words = str_word_count($text, 2, '0..9'); $indexes = array_keys($words);