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

Gradebook import is not working because of bad regexps

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.3, 11.4, 12.0
    • Fix Version/s: 19.0
    • Component/s: Gradebook
    • Labels:
      None

      Description

      The parsing of the header of a gradebook NG spreadsheet is broken. This is because the regular expressions used to validate and parse a the column titles are wrong.

      The columns can be of one of four types:

       #SOMETHING - a comment, meaning to ignore the column

       * SOMETHING2 - a "comment column". SOMETHING2 must match the name of an assignment

       SOMETHING3 [dd.dd] - Here SOMETHING3 should be the name of an assignment and dd.dd is a point value to assign

       SOMETHING4 - Here SOMETHING4 should be the name of an assignment

      The problem is that the regexps that are present make the assumption that the SOMETHING strings in these consist solely of a-zA-Z0-9_ and space, due to their use of a \w special character. This is wrong for several reasons. First, the dash - is allowed in assignment names. Second, this fails if someone uses non-ascii characters in an assignment name, this will also fail to match.

      I should note that Java regexps are a mess with respect to non-ascii strings (see e.g. here: https://stackoverflow.com/questions/4304928/unicode-equivalents-for-w-and-b-in-java-regular-expressions ) so you should be quite careful writing them.

       

      A second, unrelated bug is that the error messages given don't give any hint as to what the problem might be. I have at least added the exception messages to the screen, which, while possibly not terribly user friendly are better than nothing.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mgolden Mitch Golden
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code