Project

General

Profile

Actions

Bug #3877

closed

Exception occurs generating XML for FillInTheBlank blank question

Added by Ryan McFall about 15 years ago. Updated about 15 years ago.

Status:
Resolved
Priority:
Normal
Category:
parser
Target version:
Start date:
03/10/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
3877

Description

When attempting to import my computer graphics exam from this semester, which I will attach, I get the following exception on pressing the Finish button in the wizard:

Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at edu.msu.first.parser.question.FillInTheBlankResponseItem.generateXML(FillInTheBlankResponseItem.java:82)
at edu.msu.first.parser.question.Question.generateXML(Question.java:180)
at edu.msu.first.parser.gui.MainWindow.importPDF(MainWindow.java:690)
at edu.msu.first.parser.gui.MainWindow$3.wizardCompleted(MainWindow.java:591)
at edu.msu.first.wizard.WizardFrame.fireWizardCompleted(WizardFrame.java:330)
at edu.msu.first.wizard.WizardFrame.finish(WizardFrame.java:230)


Files

midterm-2009.pdf (67.5 KB) midterm-2009.pdf Ryan McFall, 03/10/2009 12:31 PM
Actions #1

Updated by Ryan McFall about 15 years ago

This is the file that causes the exception.

Actions #2

Updated by Ryan McFall about 15 years ago

Notes: I drew a "header" selection around the heading at the top of the document, and also ignored the introductory text on the first page. I also draw boxes around the two vector images which are simply empty rectangles on two separate pages. I suspect the error occurs without these two actions, however.

Actions #3

Updated by Ryan McFall about 15 years ago

I'm wrong about the error occurring without the actions mentioned in comment #2. The header selection is not important; but if you don't do the image rasterization process on pages 2 and 3, the error does not occur.

Actions #4

Updated by Sandeep Namilikonda about 15 years ago

Reason for Bug 3877: generateXML() in FillInTheBlankResponseItem.java

while(condition1) {
while(condition2) // condition1 violation is not caught here!
// resulted in stringOutOfBound access! {}
}

Fix: Simple modification to the inside while() to check for cond1 && cond2 resolved the issue!

The violation is only caught when the "blank" appears at the end of the question text! When the image corresponding to question 2 is not scanned explicitly by the user, the last blank is not at the end of the question text. e.g.,

------ Start snippet ---------
...
...
at the far left edge. The shape of the object should remain the same. (3
pts) Line # to change: _ New contents:
______________________________________ c. Draw the contents of the
screen window if the code from part (a) above were modified as follows
...
...
----- End of snippet ----------

Actions #5

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 3877

Actions

Also available in: Atom PDF