Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60845

Error downloading CSV tables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.1.7
    • Libraries, Quiz
    • None
    • MOODLE_31_STABLE

      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:
      https://moodle.org/mod/forum/discuss.php?d=338364

      If you turn on debugging, you can download the file and find an error at the bottom:

      Fatal error: Call to a member function close() on a non-object in /vagrant/lib/classes/dataformat/spout_base.php on line 102
       
      Call Stack:
          0.0019     275248   1. {main}() /vagrant/mod/quiz/report.php:0
          0.4286   32882456   2. quiz_statistics_report->display() /vagrant/mod/quiz/report.php:96
          0.5810   36885064   3. flexible_table->finish_output() /vagrant/mod/quiz/report/statistics/report.php:256
          0.5810   36885112   4. table_dataformat_export_format->finish_table() /vagrant/lib/tablelib.php:772
          0.5810   36885112   5. core\dataformat\spout_base->write_footer() /vagrant/lib/tablelib.php:1775
      

      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.

            timhunt Tim Hunt
            zorkzork Dom Royko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.