Create a manual report which accepts a query parameter. For example, use this query which gets all users who have completed a course since the given timestamp:
SELECT cc.userid AS userid,
cc.course AS courseid,
cc.timecompleted AS completiontime
FROM {course_completions} AS cc
WHERE timecompleted IS NOT NULL
AND timecompleted >= :fromtimestamp
Retrieve a report export via webservice which is expected to return at least one row:
Prerequisites:
Do everything necessary to download reports via webservice (see https://github.com/moodleou/moodle-report_customsql/blob/main/internaldoc/functionality.txt#L71): You have to especially enable webservices, create a webservice user, generate a webservice token for this user, allow the webservice token to download files
Steps to reproduce:
Create a manual report which accepts a query parameter. For example, use this query which gets all users who have completed a course since the given timestamp:
Retrieve a report export via webservice which is expected to return at least one row:
Retrieve a report export via webservice which is expected to return zero rows by changing the query parameter:
Expected result:
Actual result:
Analysis: