Skip to content

Commit

Permalink
Merge branch 'MDL-42957-26' into MDL-42957-master
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiepratt committed Nov 20, 2013
2 parents b58bc15 + e4b1711 commit 6ebfe7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions question/classes/statistics/questions/calculator.php
Expand Up @@ -250,8 +250,7 @@ public function get_last_calculated_time($qubaids) {
global $DB; global $DB;


$timemodified = time() - self::TIME_TO_CACHE; $timemodified = time() - self::TIME_TO_CACHE;
return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ? '. return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ?',
'ORDER BY timemodified DESC LIMIT 1',
array($qubaids->get_hash_code(), $timemodified)); array($qubaids->get_hash_code(), $timemodified));
} }


Expand Down
7 changes: 3 additions & 4 deletions question/classes/statistics/responses/analyser.php
Expand Up @@ -137,7 +137,7 @@ public function load_cached($qubaids) {
global $DB; global $DB;


$timemodified = time() - self::TIME_TO_CACHE; $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)); array($qubaids->get_hash_code(), $this->questiondata->id, $timemodified));
if (!$rows) { if (!$rows) {
return false; return false;
Expand All @@ -161,8 +161,7 @@ public function get_last_analysed_time($qubaids) {
global $DB; global $DB;


$timemodified = time() - self::TIME_TO_CACHE; $timemodified = time() - self::TIME_TO_CACHE;
return $DB->get_field_select('question_response_analysis', 'timemodified', 'hashcode = ? AND timemodified > ? '. return $DB->get_field_select('question_response_analysis', 'hashcode = ? AND questionid = ? AND timemodified > ?',
'ORDER BY timemodified DESC LIMIT 1', array($qubaids->get_hash_code(), $this->questiondata->id, $timemodified), IGNORE_MULTIPLE);
array($qubaids->get_hash_code(), $timemodified));
} }
} }

0 comments on commit 6ebfe7e

Please sign in to comment.