Downloading Quiz structure analysis tables in .csv format (and in some cases .xlsx and .ods formats) fails.
Steps to reproduce (Moodle 3.1.7):
1. In a course with at least 2 users, containing a quiz with at least 2 questions, have each user attempt the quiz (so that "Quiz structure analysis" data can be generated).
2. Navigate to Quiz administration / Results / Statistics
3. Scroll down to "Quiz structure analysis" section, and attempt to "Download table data as" a .csv file.
Firefox returns "File Not Found" and Chromium returns "This site can’t be reached"
This discussion is related:
If you turn on debugging, you can download the file and find an error at the bottom:
We have also seen this error on .xlsx and .ods formats, though not .html or .json.
Speculation based on preliminary look at the code: It's possible that write_footer() gets called twice, or that the spout_base->writer gets set to null elsewhere after the table data is processed, resulting in the error.