I modified "overview" reports page in "quiz" plugin, to add date filter (http://localhost/moodle/mod/quiz/report.php?id=9&mode=overview). Usually this page shows all students and if quiz attempt option was selected among four options, as show in the fig below
1. In progress.
4. Never submitted.
the report will filter accordingly and also downloaded excel report contains only those filtered results.
The date from field was added by me and I've modified the query to filter according to date in the "base_sql" function coded inside moodle\mod\quiz\report\attemptsreport_table.php.
While this filter is working fine and shows the filtered result, when I download this report in either of the format (xlsx,csv..), it just includes the previous report. i.e when filtered with attempts option.
Which function should I call to download the filtered report with date filtered results?