Index: lams_common/src/java/org/lamsfoundation/lams/questions/QuestionExporter.java =================================================================== diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -r48570a8043ac3d1a4e2a3506537b49dfa071f670 --- lams_common/src/java/org/lamsfoundation/lams/questions/QuestionExporter.java (.../QuestionExporter.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd) +++ lams_common/src/java/org/lamsfoundation/lams/questions/QuestionExporter.java (.../QuestionExporter.java) (revision 48570a8043ac3d1a4e2a3506537b49dfa071f670) @@ -77,7 +77,7 @@ private Document doc = null; private Integer itemId = null; - private Map images = new TreeMap(); + private Map images = new TreeMap<>(); public QuestionExporter(String title, Question[] questions) { if (StringUtils.isBlank(title)) { @@ -161,7 +161,7 @@ * Builds QTI XML file containing structured questions & answers content. * * @return XML file content - * @throws IOException + * @throws IOException */ public String exportQTIFile() throws IOException { itemId = 1000; @@ -232,7 +232,7 @@ responseLidElem.setAttribute("rtiming", "No"); // question feedback (displayed no matter what answer was choosed) - List feedbackList = new ArrayList(); + List feedbackList = new ArrayList<>(); String correctFeedbackLabel = null; String incorrectFeedbackLabel = null; Element overallFeedbackElem = null; @@ -243,7 +243,7 @@ Element renderChoiceElem = (Element) responseLidElem.appendChild(doc.createElement("render_choice")); short answerId = 0; - List respconditionList = new ArrayList(question.getAnswers().size()); + List respconditionList = new ArrayList<>(question.getAnswers().size()); // iterate through answers, collecting some info along the way for (Answer answer : question.getAnswers()) { @@ -365,8 +365,8 @@ } int answerIndex = 0; - List matchAnswerIdents = new ArrayList(question.getAnswers().size()); - List respconditionElems = new ArrayList(question.getAnswers().size()); + List matchAnswerIdents = new ArrayList<>(question.getAnswers().size()); + List respconditionElems = new ArrayList<>(question.getAnswers().size()); for (Answer answer : question.getAnswers()) { itemId++; String responseLidIdentifier = "QUE_" + itemId + "_RL"; @@ -584,6 +584,7 @@ */ private void appendMaterialElements(Element materialElem, String text) { int index = 0; + text = text.replace("%20", " "); // looks for images stored in LAMS WWW secure folder Matcher imageTagMatcher = QuestionExporter.IMAGE_PATTERN.matcher(text); @@ -628,7 +629,7 @@ Element matimageElem = (Element) materialElem.appendChild(doc.createElement("matimage")); matimageElem.setAttribute("imagtype", imageType); matimageElem.setAttribute("uri", imageName); - + //set image attributes: width, length, and class Matcher attributesMatcher = IMAGE_ATTRIBUTES_PATTERN.matcher(imageTagMatcher.group(0)); while (attributesMatcher.find()) { @@ -648,7 +649,7 @@ appendTextElement(materialElem, text.substring(index)); } } - + /** * Appends mattext element to materialElem. Used in appendMaterialElements(...) method only */