Moodle

Error importing grades from a CSV file when the first row (colum names) character count exceeds 999 characters.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.4
  • Component/s: Gradebook
  • Labels:
    None
  • Environment:
    Windows XP Professional (SP3).
    Microsoft Office 2007.
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

One of the professors at ISU had a problem importing a CSV file into the gradebook when the first row (column names) character count exceeded 999 characters (not including spaces).

We reproduced the problem by exporting an existing gradebook into Excel, adding a new column to it, and added words to the first cell of the new column until the character count in the first row was 999 characters (without spaces). Then a CSV file was created with Excel and imported into the gradebook. The new column was added as a new gradeitem (although adding it or not adding it does not make any difference) and it worked just fine. Then more words were added to the first cell of the new column in the CSV file until the character count was more than 999 characters. While importing that file, Moodle gave an error and would not let the grades be imported. For the same file, once again, decreasing the word count fixed the problem. A sample CSV file in which the aforementioned character count is more than 999, is included with this bug report. A print screen of error message is also attached.

This is how the professor described the problem to us (for reference):

"The record length cannot exceed 999 characters. This may be an issue with MS Excel writing to the CSV format. What it does is wrap the long record into another "new" record. My Column Headings were too long and when it wrapped the record, the "new record" was treated as invalid data rather than an extension of the column labels."

  1. longimport.csv
    03/Apr/09 8:50 PM
    5 kB
    Nicolas Connault
  2. sampleCSV_file.csv
    23/Oct/08 7:39 AM
    2 kB
    Jariullah Safi
  1. MoodleErrorReport.png
    56 kB
    23/Oct/08 7:39 AM

Issue Links

Activity

Hide
Nicolas Connault added a comment -

I've just attached a more realistic CSV file, with 100 grade items with a long name. The line of column names is much longer than 1000 characters (2489) and the import happens without problem.

Show
Nicolas Connault added a comment - I've just attached a more realistic CSV file, with 100 grade items with a long name. The line of column names is much longer than 1000 characters (2489) and the import happens without problem.
Hide
Nicolas Connault added a comment -

This was already solved in 1.9.4, see linked tracker issue.

Show
Nicolas Connault added a comment - This was already solved in 1.9.4, see linked tracker issue.

People

Vote (3)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: