Bug #3969
closedChoices may be deleted due to indentation! (parser issue)
0%
Description
While parsing "Fall 02-Exam2.pdf", I noticed that q44 was being misclassified as a short-answer question when it is actually a true/false question. During my debugging process I discovered that one of the choices was being deleted in
separateQuestions() function due to some logic that checks for the indentation between the a line of text (say, a question) and the subsequent line (may be a new line of the same question or a choice or a new question). The specific case I encountered was:
line 219:
44. The unique contribution of Rosiland Franklin to the structure of DNA was that the diameter of DNA
line 220:
was not uniform throughout the length of the molecule.
line 221:
A. True
line 222:
B. False
In this example, line 221 was just being removed by the following piece of code:
if(indented && current.getBbox().x < question.getBbox().x){
// it's indented to the left, so probably a new question
doc.remove(i);
i--;
Updated by Sandeep Namilikonda over 15 years ago
Previously, the logic of condition check was based on the assumption that only a new question would satisfy the condition. Since I found a case of a line of text (answer choice with bounding box starting at an X coordinate less than that of the question text) that fails the test, I updated the test to check if the content corresponds to a choice and if so, append it to the question text!