Permalink
Browse files

Merge branch 'MDL-42957-26' into MDL-42957-master

  • Loading branch information...
2 parents b58bc15 + e4b1711 commit 6ebfe7e5f182fc582e374cbd44d257be74e686ac @jamiepratt jamiepratt committed Nov 20, 2013
@@ -250,8 +250,7 @@ public function get_last_calculated_time($qubaids) {
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
- return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ? '.
- 'ORDER BY timemodified DESC LIMIT 1',
+ return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ?',
array($qubaids->get_hash_code(), $timemodified));
}
@@ -137,7 +137,7 @@ public function load_cached($qubaids) {
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
- $rows = $DB->get_records_select('question_response_analysis', 'hashcode = ? AND questionid = ? AND timemodified > ? ',
+ $rows = $DB->get_records_select('question_response_analysis', 'hashcode = ? AND questionid = ? AND timemodified > ?',
array($qubaids->get_hash_code(), $this->questiondata->id, $timemodified));
if (!$rows) {
return false;
@@ -161,8 +161,7 @@ public function get_last_analysed_time($qubaids) {
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
- return $DB->get_field_select('question_response_analysis', 'timemodified', 'hashcode = ? AND timemodified > ? '.
- 'ORDER BY timemodified DESC LIMIT 1',
- array($qubaids->get_hash_code(), $timemodified));
+ return $DB->get_field_select('question_response_analysis', 'hashcode = ? AND questionid = ? AND timemodified > ?',
+ array($qubaids->get_hash_code(), $this->questiondata->id, $timemodified), IGNORE_MULTIPLE);
}
}

0 comments on commit 6ebfe7e

Please sign in to comment.