MDL-57822 feedback: Correct page param for nonrespondents WS
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 29 Mar 2017 03:20:55 +0000 (11:20 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 29 Mar 2017 03:20:57 +0000 (11:20 +0800)
mod/feedback/classes/external.php

index c065b88..5f4c63d 100644 (file)
@@ -1028,10 +1028,13 @@ class mod_feedback_external extends external_api {
 
         // Check if we are page filtering.
         if ($params['page'] == 0 && $params['perpage'] == 0) {
-            $params['page'] = false;
-            $params['perpage'] = false;
+            $perpage = false;
+            $page = false;
+        } else {
+            $perpage = $params['perpage'];
+            $page = $perpage * $params['page'];
         }
-        $users = feedback_get_incomplete_users($cm, $groupid, $params['sort'], $params['page'], $params['perpage']);
+        $users = feedback_get_incomplete_users($cm, $groupid, $params['sort'], $page, $perpage);
 
         $result = array(
             'users' => $users,