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

Invalid CSV file when assignment has no submission

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new course but do not enrol anyone
      2. Create a new assignment with setting 'Feedback settings > Offline grading worksheet' to Yes
      3. Save and display the assignment
      4. Click on 'View/grade all submissions'
      5. Select 'Download grading worksheet' from the dropdown menu
      6. Open the file to find column headers in CSV format with no student and no error/warning given
      Show
      Create a new course but do not enrol anyone Create a new assignment with setting 'Feedback settings > Offline grading worksheet' to Yes Save and display the assignment Click on 'View/grade all submissions' Select 'Download grading worksheet' from the dropdown menu Open the file to find column headers in CSV format with no student and no error/warning given
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:

      Description

      Got this error in the content of the CSV file for an assignment (file submissions) without submissions

      Warning: fseek() expects parameter 1 to be resource  null given in /home/fred/www/repositories/im/moodle/lib/csvlib.class.php on line 415
          
      Call Stack: 
          0.0003     657344   1. {main}() /home/fred/www/repositories/im/moodle/mod/assign/view.php:0 
          0.2044   55767568   2. assign->view() /home/fred/www/repositories/im/moodle/mod/assign/view.php:53  
          0.2044   55768304   3. assign->view_plugin_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:427 
          0.2045   55768896   4. assign_feedback_offline->view_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:1668  
          0.2045   55768896   5. assign_feedback_offline->download_grades() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:344    
          0.2350   56677728   6. table_sql->out() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:332  
          0.2363   56678352   7. flexible_table->finish_output() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1393  
          0.2363   56678432   8. table_text_export_format_parent->finish_document() /home/fred/www/repositories/im/moodle/lib/tablelib.php:670    
          0.2363   56678432   9. csv_export_writer->download_file() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1602   
          0.2363   56678968  10. csv_export_writer->print_csv_data() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:465   
          0.2363   56679208  11. fseek() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:415   
          
          
      Warning: fgets() expects parameter 1 to be resource  null given in /home/fred/www/repositories/im/moodle/lib/csvlib.class.php on line 417
          
      Call Stack: 
          0.0003     657344   1. {main}() /home/fred/www/repositories/im/moodle/mod/assign/view.php:0 
          0.2044   55767568   2. assign->view() /home/fred/www/repositories/im/moodle/mod/assign/view.php:53  
          0.2044   55768304   3. assign->view_plugin_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:427 
          0.2045   55768896   4. assign_feedback_offline->view_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:1668  
          0.2045   55768896   5. assign_feedback_offline->download_grades() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:344    
          0.2350   56677728   6. table_sql->out() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:332  
          0.2363   56678352   7. flexible_table->finish_output() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1393  
          0.2363   56678432   8. table_text_export_format_parent->finish_document() /home/fred/www/repositories/im/moodle/lib/tablelib.php:670    
          0.2363   56678432   9. csv_export_writer->download_file() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1602   
          0.2363   56678968  10. csv_export_writer->print_csv_data() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:465   
          0.2450   56679848  11. fgets() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:417   
          
          
      Warning: fclose() expects parameter 1 to be resource     null given in /home/fred/www/repositories/im/moodle/lib/csvlib.class.php on line 513
          
      Call Stack: 
          0.0003     657344   1. {main}() /home/fred/www/repositories/im/moodle/mod/assign/view.php:0 
          0.2044   55767568   2. assign->view() /home/fred/www/repositories/im/moodle/mod/assign/view.php:53  
          0.2044   55768304   3. assign->view_plugin_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:427 
          0.2045   55768896   4. assign_feedback_offline->view_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:1668  
          0.2045   55768896   5. assign_feedback_offline->download_grades() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:344    
          0.2350   56677728   6. table_sql->out() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:332  
          0.2363   56678352   7. flexible_table->finish_output() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1393  
          0.2363   56678432   8. table_text_export_format_parent->finish_document() /home/fred/www/repositories/im/moodle/lib/tablelib.php:670    
          0.2363   56678432   9. csv_export_writer->download_file() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1602   
          0.2627   55637504  10. csv_export_writer->__destruct() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:0 
          0.2627   55637584  11. fclose() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:513  
          
          
      Warning: unlink(): No such file or directory in /home/fred/www/repositories/im/moodle/lib/csvlib.class.php on line 514  
          
      Call Stack: 
          0.0003     657344   1. {main}() /home/fred/www/repositories/im/moodle/mod/assign/view.php:0 
          0.2044   55767568   2. assign->view() /home/fred/www/repositories/im/moodle/mod/assign/view.php:53  
          0.2044   55768304   3. assign->view_plugin_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:427 
          0.2045   55768896   4. assign_feedback_offline->view_page() /home/fred/www/repositories/im/moodle/mod/assign/locallib.php:1668  
          0.2045   55768896   5. assign_feedback_offline->download_grades() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:344    
          0.2350   56677728   6. table_sql->out() /home/fred/www/repositories/im/moodle/mod/assign/feedback/offline/locallib.php:332  
          0.2363   56678352   7. flexible_table->finish_output() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1393  
          0.2363   56678432   8. table_text_export_format_parent->finish_document() /home/fred/www/repositories/im/moodle/lib/tablelib.php:670    
          0.2363   56678432   9. csv_export_writer->download_file() /home/fred/www/repositories/im/moodle/lib/tablelib.php:1602   
          0.2627   55637504  10. csv_export_writer->__destruct() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:0 
          0.2630   55637904  11. unlink() /home/fred/www/repositories/im/moodle/lib/csvlib.class.php:514  

      Replication steps

      1. Create a new course but do not enrol anyone
      2. Create a new assignment with setting 'Feedback settings > Offline grading worksheet' to Yes
      3. Save and display the assignment
      4. Click on 'View/grade all submissions'
      5. Select 'Download grading worksheet' from the dropdown menu
      6. Open the file to find the above notice

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    3/Dec/12