Index: lams_build/build.xml =================================================================== diff -u -r9bb615833c00a9139a689328ec07aaad8ee5cb16 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_build/build.xml (.../build.xml) (revision 9bb615833c00a9139a689328ec07aaad8ee5cb16) +++ lams_build/build.xml (.../build.xml) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -28,8 +28,7 @@ deploy-learning-libraries --> Deploys complex Tools lams-cruise --> Runs full LAMS redeployment lams-cruise-min-tools --> Runs full LAMS redeployment with minimal Tools set - slim-jboss --> Removes unused JBoss files - slim-jboss-revert --> Puts back JBoss files removed in slimming process + slim-wildfly --> Removes unused WidlFly files If you want to run full deployment, execute lams-cruise. @@ -368,7 +367,7 @@ dbPassword="${db.password}" dbUsername="${db.username}" dbDriverUrl="${db.url.build}" - dbDriverClass="com.mysql.jdbc.Driver" + dbDriverClass="com.mysql.cj.jdbc.Driver" /> Deploying language files @@ -483,32 +482,21 @@ - + - + - - - - - - - - - - + - - - - - - - - @@ -551,17 +531,6 @@ file="lib/json/jjwt.module.xml" overwrite="true" verbose="true" /> - - - - - - - - - - @@ -637,6 +606,7 @@ file="lib/googleauth/googleauth.module.xml" overwrite="true" verbose="true" /> + @@ -647,17 +617,6 @@ - - - - - - - - - - @@ -679,11 +638,11 @@ use them till migration to Wildfly 9.x It will be placed back if deploy-cluster is run. --> + overwrite="false" verbose="true" failonerror="false"> - + @@ -710,6 +669,7 @@ + @@ -723,6 +683,7 @@ + @@ -796,6 +757,7 @@ + @@ -824,7 +786,7 @@ - + @@ -845,30 +807,37 @@ + + + + + + + + - - - + + + + + - - - @@ -908,14 +877,17 @@ + + + Index: lams_build/build_base.xml =================================================================== diff -u -r9bb615833c00a9139a689328ec07aaad8ee5cb16 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_build/build_base.xml (.../build_base.xml) (revision 9bb615833c00a9139a689328ec07aaad8ee5cb16) +++ lams_build/build_base.xml (.../build_base.xml) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -1,476 +1,484 @@ - - - - - This is a base for most LAMS build.xml files. - It contains several most common tasks. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${ant.project.name} build file - ------------------------------------------------------ - - Available targets are: - - print-usage --> Display this information - copy-tags --> Copies custom JSP tags from Central - deploy-jar --> Deploys JAR to EAR - deploy-war --> Deploys WAR to EAR - explode-war --> Unpacks WAR in EAR - explode-war-synchronize --> Updates web content in exploded WAR - explode-war-delete --> Removes exploded WAR - - - - - - - - - - - - - This target is not implemented or applicable for ${ant.project.name} - - - - - - - - - ${ant.project.name}: Removing cache and build folders - - - - - ${ant.project.name}: Creating build dir structure - - - - - - - - - - - - ${ant.project.name}: Copying tags from Central - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${ant.project.name}: Compiling Java sources - - - - - ${ant.project.name}: Copying additional non-Java resources - - - - - - - - - - - - - - - - - - ${ant.project.name}: Copying Hibernate mapping files - - - - - - - - - - - ${ant.project.name}: Copying language files to build dir - - - - - - - - - - - - ${ant.project.name}: Preparing manifest - - - - - - - - - - - - - - - ${ant.project.name}: Building JAR - - - - - - - - - ${ant.project.name}: Building WAR - - - - - - - - - - - - - - - - - - - ${ant.project.name}: Deploying JAR - - - - - - ${ant.project.name}: Deploying WAR - - - Copying language files for ${ant.project.name}, if exist - - - - - - - - - - - - - - ${ant.project.name}: Enable module in EAR config files - - - - - - - - - - - - - ${ant.project.name}: Renaming existing WAR - - ${ant.project.name}: Exploding WAR to folder - - ${ant.project.name}: Removing temporary WAR - - - - - - - - - - Overwriting deployed ${ant.project.name} web files with source files - - - - - - - - - - - ${ant.project.name}: Removing WAR folder - - - Removing temporary WAR for ${ant.project.name}, if exists - - - - - - - ${ant.project.name}: Copying JSP files - - - Copying web resources - - - - - - - - - ${ant.project.name}: Copying additional libraries - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Minifying Files - - - - - - - - - - - - - Copying css files from build area to web/css directory. The .map files are not copied. - - - - - - - - - - Copying css files from build area to web/css directory. The .map files are not copied. - - - - - - - - - - - - - - - - - Compiling ALL .sccs files from ${scss.css.dir} using ${sass_exec_file} - - - - - - - - - - - Compiling modified .sccs files from ${scss.css.dir} using ${sass_exec_file} - - - - - - - - - - - - - - - - - - - - - Minifying Javascript Files - - - - - - - - - - - - + + + + + This is a base for most LAMS build.xml files. + It contains several most common tasks. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${ant.project.name} build file + ------------------------------------------------------ + + Available targets are: + + print-usage --> Display this information + copy-tags --> Copies custom JSP tags from Central + deploy-jar --> Deploys JAR to EAR + deploy-war --> Deploys WAR to EAR + copy-to-lams-lib --> Copies JAR to lams-build for other projects to use + explode-war --> Unpacks WAR in EAR + explode-war-synchronize --> Updates web content in exploded WAR + explode-war-delete --> Removes exploded WAR + + + + + + + + + + + + + This target is not implemented or applicable for ${ant.project.name} + + + + + + + + + ${ant.project.name}: Removing cache and build folders + + + + + ${ant.project.name}: Creating build dir structure + + + + + + + + + + + + ${ant.project.name}: Copying tags from Central + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${ant.project.name}: Compiling Java sources + + + + + ${ant.project.name}: Copying additional non-Java resources + + + + + + + + + + + + + + + + + + ${ant.project.name}: Copying Hibernate mapping files + + + + + + + + + + + ${ant.project.name}: Copying language files to build dir + + + + + + + + + + + + ${ant.project.name}: Preparing manifest + + + + + + + + + + + + + + + ${ant.project.name}: Building JAR + + + + + + + + + ${ant.project.name}: Building WAR + + + + + + + + + + + + + + + + + + + ${ant.project.name}: Deploying JAR + + + + + + ${ant.project.name}: Deploying WAR + + + Copying language files for ${ant.project.name}, if exist + + + + + + + + + + + + + + ${ant.project.name}: Enable module in EAR config files + + + + + + + + + + + + + ${ant.project.name}: Renaming existing WAR + + ${ant.project.name}: Exploding WAR to folder + + ${ant.project.name}: Removing temporary WAR + + + + + + + + + + Overwriting deployed ${ant.project.name} web files with source files + + + + + + + + + + + ${ant.project.name}: Removing WAR folder + + + Removing temporary WAR for ${ant.project.name}, if exists + + + + + + + ${ant.project.name}: Copying JSP files + + + Copying web resources + + + + + + + + + ${ant.project.name}: Copying additional libraries + + + + + + + + + + ${ant.project.name}: Copying deployment handler + + + + + + + + + + + + + + + + + + + + + + + + + + + + Minifying Files + + + + + + + + + + + + + Copying css files from build area to web/css directory. The .map files are not copied. + + + + + + + + + + Copying css files from build area to web/css directory. The .map files are not copied. + + + + + + + + + + + + + + + + + Compiling ALL .sccs files from ${scss.css.dir} using ${sass_exec_file} + + + + + + + + + + + Compiling modified .sccs files from ${scss.css.dir} using ${sass_exec_file} + + + + + + + + + + + + + + + + + + + + + Minifying Javascript Files + + + + + + + + + + + + \ No newline at end of file Index: lams_build/build_tools_base.xml =================================================================== diff -u -r9bb615833c00a9139a689328ec07aaad8ee5cb16 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_build/build_tools_base.xml (.../build_tools_base.xml) (revision 9bb615833c00a9139a689328ec07aaad8ee5cb16) +++ lams_build/build_tools_base.xml (.../build_tools_base.xml) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -117,7 +117,7 @@ dbPassword="${db.password}" dbUsername="${db.username}" dbDriverUrl="${db.url.build}" - dbDriverClass="com.mysql.jdbc.Driver" + dbDriverClass="com.mysql.cj.jdbc.Driver" deployFiles="${basedir}/build/deploy/${product}.war,${basedir}/build/deploy/${product}.jar" toolJarFileName="${product}.jar" toolSignature="${signature}" Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== diff -u -rab8e7f342fae4b67ebbd6078f4deee402a7defd6 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -76,7 +76,6 @@ import org.lamsfoundation.lams.learningdesign.dao.ILearningLibraryDAO; import org.lamsfoundation.lams.learningdesign.dao.ILicenseDAO; import org.lamsfoundation.lams.learningdesign.dao.ITransitionDAO; -import org.lamsfoundation.lams.learningdesign.dto.AuthoringActivityDTO; import org.lamsfoundation.lams.learningdesign.dto.ValidationErrorDTO; import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException; import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; @@ -353,7 +352,8 @@ } /** - * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#getToolOutputDefinitions(java.lang.Long, int) + * @see org.lamsfoundation.lams.authoring.service.IAuthoringFullService#getToolOutputDefinitions(java.lang.Long, + * int) */ @Override public List getToolOutputDefinitions(Long toolContentID, int definitionType) { @@ -1591,7 +1591,7 @@ access.setAccessDate(new Date()); learningDesignDAO.insertOrUpdate(access); } - + @Override public FolderContentDTO getUserWorkspaceFolder(Integer userID) throws IOException { return workspaceManagementService.getUserWorkspaceFolder(userID); Index: lams_central/src/java/org/lamsfoundation/lams/web/outcome/OutcomeAction.java =================================================================== diff -u -rb04d180a9437de2ef936f972fcdebdf69ffe2421 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_central/src/java/org/lamsfoundation/lams/web/outcome/OutcomeAction.java (.../OutcomeAction.java) (revision b04d180a9437de2ef936f972fcdebdf69ffe2421) +++ lams_central/src/java/org/lamsfoundation/lams/web/outcome/OutcomeAction.java (.../OutcomeAction.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -47,8 +47,6 @@ import org.apache.struts.action.ActionMessages; import org.apache.struts.actions.DispatchAction; import org.apache.struts.upload.FormFile; -import org.apache.tomcat.util.json.JSONArray; -import org.apache.tomcat.util.json.JSONObject; import org.lamsfoundation.lams.learningdesign.ToolActivity; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.outcome.Outcome; @@ -73,6 +71,10 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + public class OutcomeAction extends DispatchAction { private static Logger log = Logger.getLogger(OutcomeAction.class); @@ -280,12 +282,12 @@ } List outcomes = getOutcomeService().getOutcomes(search, organisationIds); - JSONArray responseJSON = new JSONArray(); + ArrayNode responseJSON = JsonNodeFactory.instance.arrayNode(); for (Outcome outcome : outcomes) { - JSONObject outcomeJSON = new JSONObject(); + ObjectNode outcomeJSON = JsonNodeFactory.instance.objectNode(); outcomeJSON.put("value", outcome.getOutcomeId()); outcomeJSON.put("label", outcome.getName() + " (" + outcome.getCode() + ")"); - responseJSON.put(outcomeJSON); + responseJSON.add(outcomeJSON); } response.setContentType("application/json;charset=utf-8"); response.getWriter().print(responseJSON); @@ -361,14 +363,14 @@ } List outcomeMappings = getOutcomeService().getOutcomeMappings(lessonId, toolContentId, itemId); - JSONArray responseJSON = new JSONArray(); + ArrayNode responseJSON = JsonNodeFactory.instance.arrayNode(); for (OutcomeMapping outcomeMapping : outcomeMappings) { - JSONObject outcomeJSON = new JSONObject(); + ObjectNode outcomeJSON = JsonNodeFactory.instance.objectNode(); outcomeJSON.put("mappingId", outcomeMapping.getMappingId()); outcomeJSON.put("outcomeId", outcomeMapping.getOutcome().getOutcomeId()); outcomeJSON.put("label", outcomeMapping.getOutcome().getName() + " (" + outcomeMapping.getOutcome().getCode() + ")"); - responseJSON.put(outcomeJSON); + responseJSON.add(outcomeJSON); } response.setContentType("application/json;charset=utf-8"); response.getWriter().print(responseJSON); Index: lams_common/build.xml =================================================================== diff -u -r9bb615833c00a9139a689328ec07aaad8ee5cb16 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_common/build.xml (.../build.xml) (revision 9bb615833c00a9139a689328ec07aaad8ee5cb16) +++ lams_common/build.xml (.../build.xml) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -1,64 +1,64 @@ - - - - - - - - - - - Rebuilding LAMS database - - - - - - - - - - - - - - - - Executing SQL scripts - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + Rebuilding LAMS database + + + + + + + + + + + + + + + + Executing SQL scripts + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java =================================================================== diff -u -rab8e7f342fae4b67ebbd6078f4deee402a7defd6 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision ab8e7f342fae4b67ebbd6078f4deee402a7defd6) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -115,7 +115,6 @@ * @author lfoxton */ public class GradebookService implements IGradebookFullService { - private static Logger logger = Logger.getLogger(GradebookService.class); private static final ExcelCell[] EMPTY_ROW = new ExcelCell[4]; @@ -414,6 +413,10 @@ gUserDTO.setMark(gradebookUserActivity.getMark()); } + + boolean hasArchivedMarks = gradebookDAO.hasArchivedMarks(lesson.getLessonId(), learner.getUserId()); + gUserDTO.setHasArchivedMarks(hasArchivedMarks); + gradebookUserDTOs.add(gUserDTO); } } Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookFullService.java =================================================================== diff -u -r471b903caa3365758fbdec0a22440b1b0b3f2947 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookFullService.java (.../IGradebookFullService.java) (revision 471b903caa3365758fbdec0a22440b1b0b3f2947) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookFullService.java (.../IGradebookFullService.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -23,7 +23,6 @@ package org.lamsfoundation.lams.gradebook.service; import java.util.ArrayList; -import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.TimeZone; @@ -134,6 +133,7 @@ * * @param activity */ + @Override void recalculateGradebookMarksForActivity(Activity activity); /** @@ -144,6 +144,7 @@ * @param lessonId * @throws Exception */ + @Override void recalculateTotalMarksForLesson(Long lessonId) throws Exception; /** @@ -257,6 +258,7 @@ */ Activity getActivityById(Long activityID); + @Override void removeLearnerFromLesson(Long lessonId, Integer learnerId); /** Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java =================================================================== diff -u -r344a7854d00abbb7a6bb0bb3756970234be71f76 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java (.../GradebookAction.java) (revision 344a7854d00abbb7a6bb0bb3756970234be71f76) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java (.../GradebookAction.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -138,7 +138,7 @@ } } - List gradebookActivityDTOs = new ArrayList(); + List gradebookActivityDTOs = new ArrayList<>(); // Get the user gradebook list from the db // A slightly different list is needed for userview or activity view @@ -176,19 +176,19 @@ // Getting userID param, it is passed differently from different views UserDTO currentUserDTO = getUser(); Integer userID = null; - if (view == GBGridView.MON_USER) { + if (view == GBGridView.MON_USER || view == GBGridView.MON_ACTIVITY) { userID = WebUtil.readIntParam(request, GradebookConstants.PARAM_USERID); } else if (view == GBGridView.LRN_ACTIVITY) { if (currentUserDTO != null) { userID = currentUserDTO.getUserID(); } } - List gradebookActivityDTOs = new ArrayList(); + List gradebookActivityDTOs = new ArrayList<>(); // Get the user gradebook list from the db // A slightly different list is needed for userview or activity view - if ((view == GBGridView.MON_USER) || (view == GBGridView.LRN_ACTIVITY)) {//2nd level && from personal marks page (2nd level or 1st) + if ((view == GBGridView.MON_USER) || (view == GBGridView.LRN_ACTIVITY) || (view == GBGridView.MON_ACTIVITY)) {//2nd level && from personal marks page (2nd level or 1st) gradebookActivityDTOs = getGradebookService().getGBActivityArchiveRowsForLearner(activityID, userID, currentUserDTO.getTimeZone()); } @@ -319,7 +319,7 @@ } // Get the user gradebook list from the db - List gradebookUserDTOs = new ArrayList(); + List gradebookUserDTOs = new ArrayList<>(); int totalUsers = 0; // if leesonID is specified show results based on lesson Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McLearningAction.java =================================================================== diff -u -r344a7854d00abbb7a6bb0bb3756970234be71f76 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McLearningAction.java (.../McLearningAction.java) (revision 344a7854d00abbb7a6bb0bb3756970234be71f76) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McLearningAction.java (.../McLearningAction.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.Date; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -197,7 +198,8 @@ /** * */ - protected List buildAnswerDtos(List answers, McContent content, HttpServletRequest request) { + protected List buildAnswerDtos(List answers, Map confidenceLevels, + McContent content, HttpServletRequest request) { List answerDtos = new LinkedList(); @@ -234,11 +236,14 @@ answerDto.setFeedbackIncorrect(question.getFeedback()); answerDto.setMark(0); } - + //handle confidence levels if (content.isEnableConfidenceLevels()) { - int confidenceLevel = WebUtil.readIntParam(request, "confidenceLevel" + question.getUid()); - answerDto.setConfidenceLevel(confidenceLevel); + String wantedKey = "confidenceLevel" + question.getUid(); + Integer confidenceLevel = confidenceLevels.get(wantedKey); + if (confidenceLevel != null) { + answerDto.setConfidenceLevel(confidenceLevel); + } } answerDtos.add(answerDto); @@ -268,8 +273,18 @@ List answers = McLearningAction.parseLearnerAnswers(mcLearningForm, request, mcContent.isQuestionsSequenced()); + + Map learnerConfidenceLevels = null; + if (mcContent.isEnableConfidenceLevels()) { + learnerConfidenceLevels = parseLearnerConfidenceLevels(mcLearningForm, request, + mcContent.isQuestionsSequenced()); + } + if (mcContent.isQuestionsSequenced()) { sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, answers); + if (mcContent.isEnableConfidenceLevels()) { + sessionMap.put(McAppConstants.CONFIDENCE_LEVELS_KEY, learnerConfidenceLevels); + } } mcLearningForm.resetCa(mapping, request); @@ -282,7 +297,7 @@ } /* process the answers */ - List answerDtos = buildAnswerDtos(answers, mcContent, request); + List answerDtos = buildAnswerDtos(answers, learnerConfidenceLevels, mcContent, request); mcService.saveUserAttempt(user, answerDtos); //calculate total learner mark @@ -335,8 +350,15 @@ mcContent.isQuestionsSequenced()); sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, answers); + Map learnerConfidenceLevels = null; + if (mcContent.isEnableConfidenceLevels()) { + learnerConfidenceLevels = parseLearnerConfidenceLevels(mcLearningForm, request, + mcContent.isQuestionsSequenced()); + sessionMap.put(McAppConstants.CONFIDENCE_LEVELS_KEY, learnerConfidenceLevels); + } + //save user attempt - List answerDtos = buildAnswerDtos(answers, mcContent, request); + List answerDtos = buildAnswerDtos(answers, learnerConfidenceLevels, mcContent, request); mcService.saveUserAttempt(user, answerDtos); List learnerAnswersDTOList = mcService.getAnswersFromDatabase(mcContent, user); @@ -425,7 +447,8 @@ int mapIndex2 = 0; while (iter.hasNext()) { McOptsContent option = iter.next(); - String stringIndex = mcContent.isPrefixAnswersWithLetters() ? option.formatPrefixLetter(mapIndex2++) : Integer.toString(++mapIndex2); + String stringIndex = mcContent.isPrefixAnswersWithLetters() ? option.formatPrefixLetter(mapIndex2++) + : Integer.toString(++mapIndex2); mapOptsContent.put(stringIndex, option.getMcQueOptionText()); } @@ -493,7 +516,7 @@ mcGeneralLearnerFlowDTO.setTotalMarksPossible(mcContent.getTotalMarksPossible()); mcGeneralLearnerFlowDTO.setShowMarks(new Boolean(mcContent.isShowMarks()).toString()); mcGeneralLearnerFlowDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString()); - mcGeneralLearnerFlowDTO.setDisplayFeedbackOnly(((Boolean)mcContent.isDisplayFeedbackOnly()).toString()); + mcGeneralLearnerFlowDTO.setDisplayFeedbackOnly(((Boolean) mcContent.isDisplayFeedbackOnly()).toString()); mcGeneralLearnerFlowDTO.setLearnerMark(user.getLastAttemptTotalMark()); Object[] markStatistics = null; @@ -714,8 +737,13 @@ List answers = McLearningAction.parseLearnerAnswers(mcLearningForm, request, mcContent.isQuestionsSequenced()); + Map learnerConfidenceLevels = null; + if (mcContent.isEnableConfidenceLevels()) { + learnerConfidenceLevels = parseLearnerConfidenceLevels(mcLearningForm, request, + mcContent.isQuestionsSequenced()); + } - List answerDtos = buildAnswerDtos(answers, mcContent, request); + List answerDtos = buildAnswerDtos(answers, learnerConfidenceLevels, mcContent, request); mcService.saveUserAttempt(user, answerDtos); return null; @@ -760,6 +788,31 @@ return answers; } + private Map parseLearnerConfidenceLevels(McLearningForm mcLearningForm, HttpServletRequest request, + boolean isQuestionsSequenced) { + String httpSessionID = mcLearningForm.getHttpSessionID(); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + + Map confidenceLevels = new HashMap(); + if (isQuestionsSequenced) { + Map previousConfidenceLevels = (Map) sessionMap + .get(McAppConstants.CONFIDENCE_LEVELS_KEY); + if (previousConfidenceLevels != null) { + confidenceLevels.putAll(previousConfidenceLevels); + } + } + + Map parameters = request.getParameterMap(); + Iterator iter = parameters.keySet().iterator(); + while (iter.hasNext()) { + String key = iter.next(); + if (key.startsWith("confidenceLevel")) { + confidenceLevels.put(key, WebUtil.readIntParam(request, key)); + } + } + return confidenceLevels; + } + private McQueUsr getCurrentUser(String toolSessionId) { McSession mcSession = mcService.getMcSessionById(new Long(toolSessionId)); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McMonitoringAction.java =================================================================== diff -u -r1b036cb2e23c7358b8b44b47c4a131853d2075d1 -rb8e51289e8498d408a9379a64353ad9ca97e6fed --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McMonitoringAction.java (.../McMonitoringAction.java) (revision 1b036cb2e23c7358b8b44b47c4a131853d2075d1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/McMonitoringAction.java (.../McMonitoringAction.java) (revision b8e51289e8498d408a9379a64353ad9ca97e6fed) @@ -285,8 +285,7 @@ request.setAttribute(McAppConstants.ATTR_CONTENT, user.getMcSession().getMcContent()); request.setAttribute(McAppConstants.USER_ATTEMPTS, userAttempts); request.setAttribute(McAppConstants.TOOL_SESSION_ID, user.getMcSession().getMcSessionId()); - return (userAttempts == null || userAttempts.isEmpty()) ? null - : mapping.findForward(McAppConstants.USER_MASTER_DETAIL); + return mapping.findForward(McAppConstants.USER_MASTER_DETAIL); } /**