Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r65ed4da382b320542dcd88cb1375662dcfac8769 -ra43256ee6435f1cd14f46c235e4d507957a86a5b Binary files differ Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r65ed4da382b320542dcd88cb1375662dcfac8769 -ra43256ee6435f1cd14f46c235e4d507957a86a5b --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 65ed4da382b320542dcd88cb1375662dcfac8769) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a43256ee6435f1cd14f46c235e4d507957a86a5b) @@ -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 =================================================================== diff -u -r65ed4da382b320542dcd88cb1375662dcfac8769 -ra43256ee6435f1cd14f46c235e4d507957a86a5b --- lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java (.../QuestionsAction.java) (revision 65ed4da382b320542dcd88cb1375662dcfac8769) +++ lams_central/src/java/org/lamsfoundation/lams/web/QuestionsAction.java (.../QuestionsAction.java) (revision a43256ee6435f1cd14f46c235e4d507957a86a5b) @@ -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 =================================================================== diff -u -r65ed4da382b320542dcd88cb1375662dcfac8769 -ra43256ee6435f1cd14f46c235e4d507957a86a5b --- lams_central/web/questionChoice.jsp (.../questionChoice.jsp) (revision 65ed4da382b320542dcd88cb1375662dcfac8769) +++ lams_central/web/questionChoice.jsp (.../questionChoice.jsp) (revision a43256ee6435f1cd14f46c235e4d507957a86a5b) @@ -12,7 +12,7 @@