Index: lams_build/lib/lams/lams.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams.jar,v diff -u -r1.356 -r1.357 Binary files differ Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.112 -r1.113 --- lams_central/conf/language/lams/ApplicationResources.properties 6 Feb 2013 15:08:07 -0000 1.112 +++ lams_central/conf/language/lams/ApplicationResources.properties 12 Feb 2013 16:42:45 -0000 1.113 @@ -399,4 +399,11 @@ label.questions.choice.title =Choose questions label.questions.choice.select.all =Select all label.questions.choice.missing =Please check at least one question. +label.questions.choice.type.mc =Multiple Choice +label.questions.choice.type.tf =True-False +label.questions.choice.type.mt =Matching +label.questions.choice.type.mr =Multiple Response +label.questions.choice.type.fb =Fill-in-Blank +label.questions.choice.type.es =Essay +label.questions.choice.type.unknown =Unknown #======= End labels: Exported 345 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java,v diff -u -r1.1 -r1.2 --- lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java 6 Feb 2013 15:08:07 -0000 1.1 +++ lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java 12 Feb 2013 16:42:45 -0000 1.2 @@ -1,7 +1,10 @@ package org.lamsfoundation.lams.web; import java.io.InputStream; +import java.util.Collections; import java.util.List; +import java.util.Set; +import java.util.TreeSet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -39,22 +42,22 @@ List formFields = formParser.parseRequest(request); String returnURL = null; - Boolean chooseAnswers = null; + String limitTypeParam = null; InputStream packageFileStream = null; for (FileItem formField : formFields) { String fieldName = formField.getFieldName(); if ("returnURL".equals(fieldName)) { // this can be empty; if so, another method of delivering results is used returnURL = formField.getString(); - } else if ("chooseAnswers".equals(fieldName)) { - chooseAnswers = Boolean.parseBoolean(formField.getString()); + } else if ("limitType".equals(fieldName)) { + limitTypeParam = formField.getString(); } else if ("file".equals(fieldName) && !StringUtils.isBlank(formField.getName())) { packageFileStream = formField.getInputStream(); } } request.setAttribute("returnURL", returnURL); - request.setAttribute("chooseAnswers", chooseAnswers); + request.setAttribute("limitType", limitTypeParam); // user did not choose a file if (packageFileStream == null) { @@ -64,7 +67,14 @@ return mapping.findForward("questionFile"); } - Question[] questions = QuestionParser.parseQTIPackage(packageFileStream); + Set limitType = null; + if (!StringUtils.isBlank(limitTypeParam)) { + limitType = new TreeSet(); + // comma delimited acceptable question types, for example "mc,fb" + Collections.addAll(limitType, limitTypeParam.split(",")); + } + + Question[] questions = QuestionParser.parseQTIPackage(packageFileStream, limitType); request.setAttribute("questions", questions); return mapping.findForward("questionChoice"); Index: lams_central/web/questionChoice.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/Attic/questionChoice.jsp,v diff -u -r1.1 -r1.2 --- lams_central/web/questionChoice.jsp 6 Feb 2013 15:08:07 -0000 1.1 +++ lams_central/web/questionChoice.jsp 12 Feb 2013 16:42:45 -0000 1.2 @@ -12,7 +12,7 @@