Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -rf80f8ca251173376b790a2d05914a57cc1acb430 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision f80f8ca251173376b790a2d05914a57cc1acb430) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -153,6 +153,7 @@ public static final String MAP_STARTUP_GENERAL_OPTIONS_CONTENT ="mapStartupGeneralOptionsContent"; public static final String MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT ="mapStartupGeneralSelectedOptionsContent"; public static final String MAP_STARTUP_GENERAL_OPTIONS_QUEID ="mapStartupGeneralOptionsQueId"; + public static final String QUESTIONS_WITHNO_OPTIONS ="questionsWithNoOptions"; public static final String MAP_GENERAL_CHECKED_OPTIONS_CONTENT ="mapGeneralCheckedOptionsContent"; public static final String MAP_LEARNER_QUESTIONS_CONTENT ="mapLearnerQuestionsContent"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties =================================================================== diff -u -rf80f8ca251173376b790a2d05914a57cc1acb430 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision f80f8ca251173376b790a2d05914a57cc1acb430) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -126,6 +126,8 @@ error.file.notPersisted =An error occurred: The file is not viewable yet. Please save all the content first and check back. error.learningUser.notAvailable =Tool Activity Error! Can't continue. Tool Activity expects a user id. error.fileName.empty =Please correct this: Under "Instructions", the file(name) to upload can not be empty. +error.questions.withNoOptions =Please note: The questions with no candate answers have been automatically removed for you. Please check total question weight. + error.question.addNotAllowed.thisScreen = The question text can not be modified in this screen since it has options attached . Please use the "Options" button to edit the question text. error.question.removeNotAllowed.thisScreen = The question can not be removed since one or more of the question texts has been modified. Please try again without any text modifications. @@ -138,8 +140,8 @@ error.defaultContent.notAvailable =Tool Activity Error! Can't continue
The the default content for the Tool Activity has not been set up. error.defaultQuestionContent.notAvailable =Tool Activity Error! Can't continue
The the default question content for the Tool Activity has not been set up. error.defaultOptionsContent.notAvailable =Tool Activity Error! Can't continue
The the default options content for the Tool Activity has not been set up. + - #Learning mode resources label.learning.qa =Answers for Q/A label.question =Question Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -rf80f8ca251173376b790a2d05914a57cc1acb430 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision f80f8ca251173376b790a2d05914a57cc1acb430) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -885,6 +885,8 @@ logger.debug("mapQuestionsContent: " + mapQuestionsContent); logger.debug("mapGeneralOptionsContent: " + mapGeneralOptionsContent); + request.getSession().setAttribute(QUESTIONS_WITHNO_OPTIONS, new Boolean(false)); + Iterator itQuestionsMap = mapQuestionsContent.entrySet().iterator(); boolean questionFound=false; while (itQuestionsMap.hasNext()) @@ -913,6 +915,11 @@ logger.debug("will add this question to the the questionsMap:" + pairs.getKey().toString()); mapUpdatedQuestionsContent.put(pairs.getKey().toString(), pairs.getValue().toString()); } + else + { + request.getSession().setAttribute(QUESTIONS_WITHNO_OPTIONS, new Boolean(true)); + logger.debug("setting QUESTIONS_WITHNO_OPTIONS to true."); + } logger.debug("final mapUpdatedQuestionsContent:" + mapUpdatedQuestionsContent); } return mapUpdatedQuestionsContent; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== diff -u -r25fb91f5a3a61767111f14f48c2fc95de22746c0 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 25fb91f5a3a61767111f14f48c2fc95de22746c0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -617,7 +617,11 @@ logger.debug("isAttemptCorrect: " + isAttemptCorrect); McQueContent mcQueContent=mcService.getQuestionContentByDisplayOrder(questionDisplayOrder, toolContentUID); - createIndividualOptions(request, mapCheckedOptions, mcQueContent, mcQueUsr, attempTime, timeZone, mark, passed, new Integer(highestAttemptOrder), isAttemptCorrect); + logger.debug("mcQueContent: " + mcQueContent); + if (mcQueContent != null) + { + createIndividualOptions(request, mapCheckedOptions, mcQueContent, mcQueUsr, attempTime, timeZone, mark, passed, new Integer(highestAttemptOrder), isAttemptCorrect); + } } } @@ -628,16 +632,28 @@ Integer IntegerMark= new Integer(mark); logger.debug("createIndividualOptions-> isAttemptCorrect: " + isAttemptCorrect); + logger.debug("mcQueContent: " + mcQueContent); + logger.debug("mapCheckedOptions: " + mapCheckedOptions); - Iterator itCheckedMap = mapCheckedOptions.entrySet().iterator(); - while (itCheckedMap.hasNext()) - { - Map.Entry checkedPairs = (Map.Entry)itCheckedMap.next(); - McOptsContent mcOptsContent= mcService.getOptionContentByOptionText(checkedPairs.getValue().toString(), mcQueContent.getUid()); - McUsrAttempt mcUsrAttempt=new McUsrAttempt(attempTime, timeZone, mcQueContent, mcQueUsr, mcOptsContent, IntegerMark, passed, highestAttemptOrder, new Boolean(isAttemptCorrect).booleanValue()); - mcService.createMcUsrAttempt(mcUsrAttempt); - logger.debug("created mcUsrAttempt in the db :" + mcUsrAttempt); - } + if (mcQueContent != null) + { + if (mapCheckedOptions != null) + { + Iterator itCheckedMap = mapCheckedOptions.entrySet().iterator(); + while (itCheckedMap.hasNext()) + { + Map.Entry checkedPairs = (Map.Entry)itCheckedMap.next(); + McOptsContent mcOptsContent= mcService.getOptionContentByOptionText(checkedPairs.getValue().toString(), mcQueContent.getUid()); + logger.debug("mcOptsContent: " + mcOptsContent); + if (mcOptsContent != null) + { + McUsrAttempt mcUsrAttempt=new McUsrAttempt(attempTime, timeZone, mcQueContent, mcQueUsr, mcOptsContent, IntegerMark, passed, highestAttemptOrder, new Boolean(isAttemptCorrect).booleanValue()); + mcService.createMcUsrAttempt(mcUsrAttempt); + logger.debug("created mcUsrAttempt in the db :" + mcUsrAttempt); + } + } + } + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -rf80f8ca251173376b790a2d05914a57cc1acb430 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision f80f8ca251173376b790a2d05914a57cc1acb430) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -19,10 +19,7 @@ */ package org.lamsfoundation.lams.tool.mc.web; -import java.io.DataInputStream; -import java.io.EOFException; import java.io.IOException; -import java.io.InputStream; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -1139,6 +1136,34 @@ Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent before submit: " + mapQuestionsContent); request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + + Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); + logger.debug("mapGeneralOptionsContent: " + mapGeneralOptionsContent); + + logger.debug("remove from mapQuestionsContent the questions with no options"); + /* remove from mapQuestionsContent the questions with no options */ + mapQuestionsContent=AuthoringUtil.updateQuestionsMapForNoOptions(request, mapQuestionsContent, mapGeneralOptionsContent); + logger.debug("returned mapQuestionsContent: " + mapQuestionsContent); + request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + logger.debug("persisted MAP_QUESTIONS_CONTENT: " + mapQuestionsContent); + + + Boolean questionsWithNoOptions=(Boolean) request.getSession().getAttribute(QUESTIONS_WITHNO_OPTIONS); + logger.debug("questionsWithNoOptions: " + questionsWithNoOptions); + /* + if (questionsWithNoOptions.toString().equals("true")) + { + errors= new ActionMessages(); + errors.add(Globals.ERROR_KEY,new ActionMessage("error.questions.withNoOptions")); + + saveErrors(request,errors); + mcAuthoringForm.resetUserAction(); + persistError(request,"error.questions.withNoOptionse"); + + return (mapping.findForward(LOAD_QUESTIONS)); + } + */ + /* make sure the questions Map is not empty*/ int mapSize=mapQuestionsContent.size(); @@ -1148,6 +1173,7 @@ { errors= new ActionMessages(); errors.add(Globals.ERROR_KEY,new ActionMessage("error.questions.submitted.none")); + saveErrors(request,errors); mcAuthoringForm.resetUserAction(); persistError(request,"error.questions.submitted.none"); @@ -1170,6 +1196,7 @@ return (mapping.findForward(LOAD_QUESTIONS)); } + boolean isTotalWeightsValid=AuthoringUtil.validateTotalWeight(request); logger.debug("isTotalWeightsValid:" + isTotalWeightsValid); if (isTotalWeightsValid == false) @@ -1344,10 +1371,12 @@ String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG); logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage); + /* mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("FINAL mapQuestionsContent after shrinking: " + mapQuestionsContent); logger.debug("mapQuestionsContent size after shrinking: " + mapQuestionsContent.size()); request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + */ Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentId:" + toolContentId); @@ -1398,15 +1427,8 @@ List existingQuestions = mcService.refreshQuestionContent(mcContentId); logger.debug("existingQuestions: " + existingQuestions); - Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); - logger.debug("mapGeneralOptionsContent: " + mapGeneralOptionsContent); + logger.debug("received MAP_QUESTIONS_CONTENT: " + mapQuestionsContent); - /* remove from mapQuestionsContent the questions with no options */ - mapQuestionsContent=AuthoringUtil.updateQuestionsMapForNoOptions(request, mapQuestionsContent, mapGeneralOptionsContent); - logger.debug("returned mapQuestionsContent: " + mapQuestionsContent); - request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); - logger.debug("persisted MAP_QUESTIONS_CONTENT: " + mapQuestionsContent); - logger.debug("will cleanupRedundantQuestions:"); /* Removes only unused question entries from the db. It keeps the valid entries since they get updated. */ AuthoringUtil.cleanupRedundantQuestions(request, existingQuestions, mapQuestionsContent, mcContent); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java =================================================================== diff -u -r43b99721a0fa18b4ee65f3e94caf81cc7782ce87 -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 43b99721a0fa18b4ee65f3e94caf81cc7782ce87) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -109,6 +109,8 @@ request.getSession().setAttribute(QUESTION_LISTING_MODE_SEQUENTIAL,QUESTION_LISTING_MODE_SEQUENTIAL); request.getSession().setAttribute(QUESTION_LISTING_MODE_COMBINED, QUESTION_LISTING_MODE_COMBINED); + request.getSession().setAttribute(QUESTIONS_WITHNO_OPTIONS, new Boolean(false)); + /* * mark the http session as a learning activity */ @@ -269,13 +271,12 @@ } - if (mcQueUsr != null) { logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); return (mapping.findForward(REDO_QUESTIONS)); } - + logger.debug("mcQueUsr is null, user is a first timer, load questions..." + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); } Index: lams_tool_lamc/web/AnswersContent.jsp =================================================================== diff -u -r4db5a791a1d9fc010b172c50f9f60677ed71d0fe -redc0e86bb2f19c6344f88b7b0194564480592f9a --- lams_tool_lamc/web/AnswersContent.jsp (.../AnswersContent.jsp) (revision 4db5a791a1d9fc010b172c50f9f60677ed71d0fe) +++ lams_tool_lamc/web/AnswersContent.jsp (.../AnswersContent.jsp) (revision edc0e86bb2f19c6344f88b7b0194564480592f9a) @@ -24,6 +24,10 @@ +answers here 1 : + +answers here 2 : + @@ -37,3 +41,4 @@ + Fisheye: Tag edc0e86bb2f19c6344f88b7b0194564480592f9a refers to a dead (removed) revision in file `lams_tool_lamc/web/LearningIndex.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 885c702d472ffd26ddc8c506553a2e053bd2d175 refers to a dead (removed) revision in file `lams_tool_lamc/web/SingleQuestionAnswersContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4db5a791a1d9fc010b172c50f9f60677ed71d0fe refers to a dead (removed) revision in file `lams_tool_lamc/web/learningIndex.jsp'. Fisheye: No comparison available. Pass `N' to diff?