Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-42953

Problem Import/Export on GradeBook

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 12.8 [Tentative], 19.4, 20.0, 21.0 [Tentative]
    • Fix Version/s: 20.0, 21.0 [Tentative]
    • Component/s: Gradebook
    • Labels:
      None
    • 20 status:
      Resolved
    • 19 status:
      Won't Fix
    • 12 status:
      Won't Fix
    • Test Plan:
      Hide

      Text 1:

      1. Export a CSV with the gradebooks (Check that the coding is UTF8-BOM).
      2. Change a gradebook of the downloaded CSV with the MSEXCEL application and give it to close so that it gives us the option to save. We save again the file in CSV (We see that the codification has changed to ANSI).
      3. When we try to import the file, it duplicates the subjects that contain punctuation symbols with the strange symbols.

      Text 2:

      1. Export a CSV with the gradebooks (Check that the coding is UTF8-BOM).
      2. Change a CSV grade downloaded with the MSEXCEL application and save it as XLS (It does not allow to import an excel document in Spanish because of the decimal separators).
      3. In other languages we also see that if there is a rating without a value and later there are others with a value, we save in the non corresponding column the value of the ratings.

      NOTE: We can configure both the decimal separator and the CSV document separator in Windows "control panel > Change date, time or number formats > Additional configuration..." to be able to perform the correct treatment of these formats simulating the desired country.

      Show
      Text 1: Export a CSV with the gradebooks (Check that the coding is UTF8-BOM). Change a gradebook of the downloaded CSV with the MSEXCEL application and give it to close so that it gives us the option to save. We save again the file in CSV (We see that the codification has changed to ANSI). When we try to import the file, it duplicates the subjects that contain punctuation symbols with the strange symbols. Text 2: Export a CSV with the gradebooks (Check that the coding is UTF8-BOM). Change a CSV grade downloaded with the MSEXCEL application and save it as XLS (It does not allow to import an excel document in Spanish because of the decimal separators). In other languages we also see that if there is a rating without a value and later there are others with a value, we save in the non corresponding column the value of the ratings. NOTE: We can configure both the decimal separator and the CSV document separator in Windows "control panel > Change date, time or number formats > Additional configuration..." to be able to perform the correct treatment of these formats simulating the desired country.

      Description

      The issues of importing and exporting ratings have been reviewed in depth. The following problems have been fixed:

      When a user exports a ratings CSV file, modifies it afterwards and imports the file back again with the changes, if any text contains tilde or special characters, Gradebook duplicates the columns containing those special characters, just replacing the special characters with strangely parsed characters. This is so because, when saving any local changes on the exported CSV file, Microsoft Excel (the most widely used spreadsheet software) changes the document's coding from UTF-8 with BOM, it's original coding, to ANSI. Because of that, when processing the file, it is processed by default in UTF-8, thus, transcoding incorrectly those special characters.

      To solve this up, code has been modified to normalize file exporting and importing. Now it creates the exported file in ANSI code and, when importing, processes it with ANSI coding again. This makes sure, unless the user directly changes file's encoding, it will import the file correctly. It is also important to highlight that it will also work if the user creates the CSV from scratch.

      Additionally, during an in-depth validation process it was detected that importing ratings in XLS format, does also fail in languages other than English. This is because ratings in CSV/XLS files always show the decimal and integer parts separated by '.'. When processing the imported file, the code now validates that the format of these fields is correct, using the standard decimal separator defined in the locale environment variable. For it to work properly, the code modifies the RAW value (the one that validates the correct format) for those ratings that come with the decimal separator '.' and replaces it with the decimal separator character specified for the region specified in the locale without modifying the integer nor decimal values.

      Having changed that, export of XLS and XLSX files still does not work properly in any of the cases shown above, since the POI library is being used and the methods used by the ROW class that to go through the cells never take into account "null" cell values, omitting those cells and also skipping columns when importing data for empty fields, inserting the values in wrong columns. To fix this problem, methods that run through rows and columns, have been modified and now just a simple iterator is used.

        Gliffy Diagrams

          Zeplin

            Attachments

            1. SpanishGB.gif
              SpanishGB.gif
              39 kB
            2. US_GB.gif
              US_GB.gif
              12 kB

              Issue Links

                Activity

                  People

                  Assignee:
                  agschmidt Andrea Schmidt
                  Reporter:
                  victor.gomollon Victor Gomollon Martos
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration