mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
mod/lesson, mod/quiz: remove deprecated sql_paging_limit(), use offset, limit parameters
This commit is contained in:
parent
1ad5c6380f
commit
ea9a729f80
2 changed files with 3 additions and 4 deletions
|
@ -389,8 +389,7 @@
|
||||||
|
|
||||||
/// Get the actual records
|
/// Get the actual records
|
||||||
|
|
||||||
$limit = sql_paging_limit($page * $nowperpage, $nowperpage);
|
$records = get_records_sql($sqlselect, $page * $nowperpage, $nowperpage);
|
||||||
$records = get_records_sql($sqlselect.$limit);
|
|
||||||
|
|
||||||
if (empty($records)) { // Nothing to show!
|
if (empty($records)) { // Nothing to show!
|
||||||
if ($record) { // Something was requested so try to show that at least (bug 5132)
|
if ($record) { // Something was requested so try to show that at least (bug 5132)
|
||||||
|
|
|
@ -52,14 +52,14 @@
|
||||||
/// Clean up the timer table
|
/// Clean up the timer table
|
||||||
$timeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_timer
|
$timeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_timer
|
||||||
WHERE userid = $userid AND lessonid = $lesson->id
|
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);
|
delete_records('lesson_timer', 'id', $timeid);
|
||||||
|
|
||||||
/// Remove the grade from the grades and high_scores tables
|
/// Remove the grade from the grades and high_scores tables
|
||||||
$gradeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_grades
|
$gradeid = get_field_sql("SELECT id FROM {$CFG->prefix}lesson_grades
|
||||||
WHERE userid = $userid AND lessonid = $lesson->id
|
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_grades', 'id', $gradeid);
|
||||||
delete_records('lesson_high_scores', 'gradeid', $gradeid, 'lessonid', $lesson->id, 'userid', $userid);
|
delete_records('lesson_high_scores', 'gradeid', $gradeid, 'lessonid', $lesson->id, 'userid', $userid);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue