Moodle
  1. Moodle
  2. MDL-35435

Invalid CSV file when assignment has no submission

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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:
    • Rank:
      44116

      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

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Could you add some replication steps to this, Fred?

          Show
          Michael de Raadt added a comment - Could you add some replication steps to this, Fred?
          Hide
          Michael de Raadt added a comment -

          Thanks, Fred.

          Show
          Michael de Raadt added a comment - Thanks, Fred.
          Hide
          Damyon Wiese added a comment -

          Thanks Raymond.

          This could also have been solved by showing an error when there are no submissions - but I think that would be incorrect.

          I think this is the correct solution - it is not an error if there are no students and an error message is scary and makes it looks like something has gone wrong when it hasn't.

          Show
          Damyon Wiese added a comment - Thanks Raymond. This could also have been solved by showing an error when there are no submissions - but I think that would be incorrect. I think this is the correct solution - it is not an error if there are no students and an error message is scary and makes it looks like something has gone wrong when it hasn't.
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Raymond Antonio added a comment -

          Hi Dan
          Rebase done. Cheers

          Show
          Raymond Antonio added a comment - Hi Dan Rebase done. Cheers
          Hide
          Sam Hemelryk added a comment -

          Looks good thanks Raymond, it'll be integrated as soon as I have access to git.moodle.org again (currently down for me).
          Just to quickly check, this issue only effects 2.4 correct?

          Show
          Sam Hemelryk added a comment - Looks good thanks Raymond, it'll be integrated as soon as I have access to git.moodle.org again (currently down for me). Just to quickly check, this issue only effects 2.4 correct?
          Hide
          Damyon Wiese added a comment -

          Hi Sam,

          Yes 2.4 only for this one.

          Show
          Damyon Wiese added a comment - Hi Sam, Yes 2.4 only for this one.
          Hide
          Sam Hemelryk added a comment -

          Integrated now thanks

          Show
          Sam Hemelryk added a comment - Integrated now thanks
          Hide
          Adrian Greeve added a comment -

          Tested on master (normal) and master (integration)
          I viewed the error that was being displayed on master (normal)
          master (integration) has no such errors.
          Test passed.

          Show
          Adrian Greeve added a comment - Tested on master (normal) and master (integration) I viewed the error that was being displayed on master (normal) master (integration) has no such errors. Test passed.
          Hide
          Dan Poltawski added a comment -

          Congratulations, you've done it!

          Nf n erjneq sbe fhpprfshy vagrtengvba vagb guvf jrrxf eryrnfr, V pna abj qvfpybfr gb lbh gur rkvfgnapr bs shapgvba fge_ebg13(), gb tb va lbhe gbbyxvg nybat jvgu uggc://cuc.arg/znahny/ra/shapgvba.tmtrgff.cuc

          Cyrnfr qb abg nyybj guvf vasbezngvba gb cnff shegure.

          Show
          Dan Poltawski added a comment - Congratulations, you've done it! Nf n erjneq sbe fhpprfshy vagrtengvba vagb guvf jrrxf eryrnfr, V pna abj qvfpybfr gb lbh gur rkvfgnapr bs shapgvba fge_ebg13(), gb tb va lbhe gbbyxvg nybat jvgu uggc://cuc.arg/znahny/ra/shapgvba.tmtrgff.cuc Cyrnfr qb abg nyybj guvf vasbezngvba gb cnff shegure.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: