MDL-15112 lesson dml conversion - fix the previous fix ($DB->count_records_select should be $DB->count_records)

This commit is contained in:
jerome 2008-06-11 06:04:06 +00:00
parent 590a837a34
commit 9267ffda3c

View file

@ -790,10 +790,8 @@
} }
} elseif ($lesson->nextpagedefault == LESSON_UNANSWEREDPAGE) { } elseif ($lesson->nextpagedefault == LESSON_UNANSWEREDPAGE) {
foreach ($allpages as $thispage) { foreach ($allpages as $thispage) {
$params = array('pageid'=>$thispage->id, if (!$DB->count_records("lesson_attempts", array('pageid'=>$thispage->id,
'userid'=>$USER->id, 'correct'=>1, 'retry'=>$nretakes); 'userid'=>$USER->id, 'correct'=>1, 'retry'=>$nretakes))) {
if (!count_records_select("lesson_attempts", "pageid = :pageid AND
userid = :userid AND correct = 1 AND retry = :retry", $params)) {
$found = true; $found = true;
break; break;
} }