mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
mod/lesson, mod/quiz: remove deprecated sql_paging_limit(), use offset, limit parameters
This commit is contained in:
parent
1ad5c6380f
commit
ea9a729f80
@ -389,8 +389,7 @@
|
||||
|
||||
/// Get the actual records
|
||||
|
||||
$limit = sql_paging_limit($page * $nowperpage, $nowperpage);
|
||||
$records = get_records_sql($sqlselect.$limit);
|
||||
$records = get_records_sql($sqlselect, $page * $nowperpage, $nowperpage);
|
||||
|
||||
if (empty($records)) { // Nothing to show!
|
||||
if ($record) { // Something was requested so try to show that at least (bug 5132)
|
||||
|
@ -52,14 +52,14 @@
|
||||
/// Clean up the timer table
|
||||
$timeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_timer
|
||||
WHERE userid = $userid AND lessonid = $lesson->id
|
||||
ORDER BY starttime ".sql_paging_limit($try, 1));
|
||||
ORDER BY starttime", $try, 1);
|
||||
|
||||
delete_records('lesson_timer', 'id', $timeid);
|
||||
|
||||
/// Remove the grade from the grades and high_scores tables
|
||||
$gradeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_grades
|
||||
WHERE userid = $userid AND lessonid = $lesson->id
|
||||
ORDER BY completed ".sql_paging_limit($try, 1));
|
||||
ORDER BY completed", $try, 1);
|
||||
|
||||
delete_records('lesson_grades', 'id', $gradeid);
|
||||
delete_records('lesson_high_scores', 'gradeid', $gradeid, 'lessonid', $lesson->id, 'userid', $userid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user