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

Importing invalid XML file generates un-recoverable NPE crash

    XMLWordPrintable

    Details

    • 2.9 Status:
      Merge
    • Previous Issue Keys:
      SAM-2234

      Description

      We have a user who downloaded an xml assessment file, tried to edit it (creating an invalid format – see attached), and then tried to import the file. If there is already an existing question pool, importing this invalid xml file generates first an error on import:

      java.lang.RuntimeException: Invalid QTI XML format.
      at org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper.createImportedAssessment(AuthoringHelper.java:572)
      at org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper.createImportedAssessment(AuthoringHelper.java:505)
      at org.sakaiproject.tool.assessment.services.qti.QTIService.createImportedAssessment(QTIService.java:107)
      at org.sakaiproject.tool.assessment.ui.bean.qti.XMLImportBean.createImportedAssessment(XMLImportBean.java:405)
      at org.sakaiproject.tool.assessment.ui.bean.qti.XMLImportBean.processFile(XMLImportBean.java:291)
      at org.sakaiproject.tool.assessment.ui.bean.qti.XMLImportBean.importAssessment(XMLImportBean.java:174)
      at org.sakaiproject.tool.assessment.ui.bean.qti.XMLImportBean.importAssessment(XMLImportBean.java:152)

      But following the import, every time the user tries to access the Question Pools, they see this error:

      java.lang.NullPointerException
      at java.text.RuleBasedCollator.compare(RuleBasedCollator.java:351)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean$TitleComparator.compare(QuestionPoolBean.java:238)
      at java.util.Arrays.mergeSort(Arrays.java:758)
      at java.util.Arrays.legacyMergeSort(Arrays.java:668)
      at java.util.Arrays.sort(Arrays.java:657)
      at java.util.Collections.sort(Collections.java:217)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.sortQpoolsByProperty(QuestionPoolBean.java:254)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.sortPoolByLevel(QuestionPoolBean.java:1978)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.setQpDataModelByLevel(QuestionPoolBean.java:2074)

        Gliffy Diagrams

          Zeplin

            Attachments

            1. assessment.xml
              0.4 kB
              Beth Kirschner
            2. missing_pool_name.png
              103 kB
              Neal Caidin

              Issue Links

                Activity

                  People

                  Assignee:
                  samigoteam SAMIGO TEAM (Inactive)
                  Reporter:
                  bkirschn Beth Kirschner
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration