$sort = 'ORDER BY u.firstname, u.lastname, qa.attempt ASC';
if ($gradenextungraded){
- $limit = ' LIMIT '.QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE;
+ $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params, 0, QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE);
} else {
- $limit = '';
+ $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params);
}
- $attempts = $DB->get_records_sql($select.$from.$where.$sort.$limit, $params);
if ($attempts){
$firstattempt = current($attempts);
$fullname = fullname($firstattempt);
// this sql joins the attempts table and the user table
$select = 'SELECT qa.id AS attemptid, qa.uniqueid, qa.attempt, qa.timefinish, qa.preview,
u.id AS userid, u.firstname, u.lastname, u.picture ';
- if ($wantstateevent){
+ if ($wantstateevent && $questionid){
$select .= ', qs.event ';
}
$from = 'FROM {user} u, ' .