MDL-42957 (2) quiz statistics : Hardcoded sql LIMIT clause

Fixing some typos and adding some tests.
This commit is contained in:
James Pratt 2013-11-28 17:13:26 +07:00
parent 6ebfe7e5f1
commit 487e7e6602
4 changed files with 29 additions and 20 deletions

View file

@ -251,7 +251,7 @@ class calculator {
$timemodified = time() - self::TIME_TO_CACHE;
return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ?',
array($qubaids->get_hash_code(), $timemodified));
array($qubaids->get_hash_code(), $timemodified), IGNORE_MULTIPLE);
}
/** @var integer Time after which statistics are automatically recomputed. */

View file

@ -161,7 +161,8 @@ class analyser {
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
return $DB->get_field_select('question_response_analysis', 'hashcode = ? AND questionid = ? AND timemodified > ?',
return $DB->get_field_select('question_response_analysis', 'timemodified',
'hashcode = ? AND questionid = ? AND timemodified > ?',
array($qubaids->get_hash_code(), $this->questiondata->id, $timemodified), IGNORE_MULTIPLE);
}
}