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

CSV import of grades silently fails when malformed row(s) present

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6.5, 2.7.2
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide

      Getting some malformed data to test with

      1. Create a new course, and enrol a few users in it.
      2. Create a new assignment activity with submission types set to online text.
      3. As two students, complete the assignment.
      4. As a teacher or admin user, grade the students.
      5. Go to the course's grader report, by clicking Course administration -> Grades.
      6. Navigate to Grade administration -> Export -> Plain text file.
        • Export a CSV file using commas as the separator.
      7. Open the CSV file you generated.
        • Observe that the first line is a header row, with names for each data column.
        • Pick a subsequent row and completely excise a column from it - not just the data value, but the comma after it as well.
        • Save your CSV file as malformed.csv.

      Testing with malformed data

      1. Navigate to Grade administration -> Import -> CSV file.
      2. Upload your malformed CSV file, selecting comma as the separator and with a non-zero number of preview rows.
      3. Click Upload grades.
        • Observe that an error message is displayed.
      Show
      Getting some malformed data to test with Create a new course, and enrol a few users in it. Create a new assignment activity with submission types set to online text . As two students, complete the assignment. As a teacher or admin user, grade the students. Go to the course's grader report, by clicking Course administration -> Grades . Navigate to Grade administration -> Export -> Plain text file . Export a CSV file using commas as the separator. Open the CSV file you generated. Observe that the first line is a header row, with names for each data column. Pick a subsequent row and completely excise a column from it - not just the data value, but the comma after it as well. Save your CSV file as malformed.csv . Testing with malformed data Navigate to Grade administration -> Import -> CSV file . Upload your malformed CSV file, selecting comma as the separator and with a non-zero number of preview rows. Click Upload grades . Observe that an error message is displayed.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-46546-master
    • Story Points:
      13

      Description

      If the number of columns in any data row don’t match the columns in the header row, there is no diagnostic warning, AND the ability to map from the select box in the “identify user by" section is broken.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14