}
/**
- * Load an attempt by id. You need to use this method instead of get_record, because
+ * Load an attempt by id. You need to use this method instead of $DB->get_record, because
* of some ancient history to do with the upgrade from Moodle 1.4 to 1.5, See the comment
* after CREATE TABLE `prefix_quiz_newest_states` in mod/quiz/db/mysql.php.
*
}
// Use a transaction, so that on those databases that support it, this is safer.
- begin_sql();
+ $DB->begin_sql();
// Update the quiz table.
$success = $DB->set_field('quiz', 'grade', $newgrade, array('id' => $quiz->instance));
" WHERE i.quiz = '$quiz->id' AND q.id = i.question".
" AND q.id IN ($questionlist)";
- if (!$quizquestions = get_records_sql($sql)) {
+ if (!$quizquestions = $DB->get_records_sql($sql)) {
print_error('No questions found');
}