Index: lams_tool_lamc/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/conf/language/ApplicationResources.properties 18 Aug 2006 04:38:43 -0000 1.21 +++ lams_tool_lamc/conf/language/ApplicationResources.properties 18 Aug 2006 11:36:27 -0000 1.22 @@ -134,7 +134,7 @@ label.cancel =Cancel feedback =Please address the following issues before submit.
error.default.content.notSetup =The tool initialization error: The tool default content has not been set up properly. -error.questions.submitted.none =Please correct this: No questions have been submitted. Please also note that the questions with no candidate answers are being automatically removed. +error.questions.submitted.none =Please correct this: No questions have been submitted. error.question.empty =Please correct this: The question text can not be empty. error.weights.empty =Please correct this: The question weights can not be empty. error.checkBoxes.empty =Please correct this: No candidate answer has been selected. @@ -152,7 +152,7 @@ error.passMark.empty =Please correct this: Pass Mark can not be empty. options.count.zero =Please correct this: There must be at least one candidate answer. error.passmark.notInteger =Please correct this: Pass Mark can only be an integer. -error.weights.total.invalid =Please correct this: The total weight must equal 100. Please also note that the questions with no candidate answers are being automatically removed. +error.weights.total.invalid =Please correct this: The total weight must equal 100. error.learner.userId.required =Tool Activity Error! Can't continue. Tool Activity expects learner's user id. error.learner.user.doesNoExist =Tool Activity Error! Learner is not ready in the tool's database yet. error.file.notPersisted =An error occurred: The file is not viewable yet. Please save all the content first and check back. Index: lams_tool_lamc/db/sql/create_lams_tool_mc.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/db/sql/create_lams_tool_mc.sql,v diff -u -r1.12 -r1.13 --- lams_tool_lamc/db/sql/create_lams_tool_mc.sql 9 Aug 2006 12:53:09 -0000 1.12 +++ lams_tool_lamc/db/sql/create_lams_tool_mc.sql 18 Aug 2006 11:36:27 -0000 1.13 @@ -115,7 +115,7 @@ )TYPE=InnoDB; -INSERT INTO tl_lamc11_content(uid, content_id , creation_date , questions_sequenced , username_visible , created_by , monitoring_report_title , report_title , run_offline , define_later, synch_in_monitor, offline_instructions, online_instructions, end_learning_message, content_in_use, retries, show_feedback, show_report, pass_mark) VALUES (1, ${default_content_id} , NOW(), 0, 0,1,'Monitoring Report','Report', 0, 0, 0,'offline instructions','online instructions','Finished Activity...', 0, 0, 0, 0, 50); +INSERT INTO tl_lamc11_content(uid, content_id , title, instructions, creation_date , questions_sequenced , username_visible , created_by , monitoring_report_title , report_title , run_offline , define_later, synch_in_monitor, offline_instructions, online_instructions, end_learning_message, content_in_use, retries, show_feedback, show_report, pass_mark) VALUES (1, ${default_content_id} , 'MCQ Title', 'MCQ Instructions', NOW(), 0, 0,1,'Monitoring Report','Report', 0, 0, 0,'offline instructions','online instructions','Finished Activity...', 0, 0, 0, 0, 50); INSERT INTO tl_lamc11_que_content (uid,question, weight, disabled, display_order, mc_content_id, feedbackIncorrect, feedbackCorrect) VALUES (1, 'A Sample question?', 100, 0, 1,1, 'Your answer is incorrect', 'Correct'); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java,v diff -u -r1.86 -r1.87 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 23 Jul 2006 20:14:31 -0000 1.86 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 18 Aug 2006 11:36:27 -0000 1.87 @@ -83,6 +83,9 @@ public static final String COPY_TOOL_CONTENT = "copyToolContent"; public static final String REMOVE_TOOL_CONTENT = "removeToolContent"; + public static final String DEFAULT_MCQ_TITLE = "MCQ Title"; + public static final String DEFAULT_MCQ_INSTRUCTIONS = "MCQ Instructions"; + /* * refers to number of questions presented initially, we have a single record for default content */ Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java,v diff -u -r1.42 -r1.43 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 9 Aug 2006 16:50:36 -0000 1.42 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 18 Aug 2006 11:36:27 -0000 1.43 @@ -205,8 +205,11 @@ } - public static void persistInSessionRichText(HttpServletRequest request) + //consider adding if (!requestByStarter) to other properties as well + public static void saveInSessionRichText(HttpServletRequest request, boolean requestByStarter) { + logger.debug("saveInSessionRichText, requestByStarter: " + requestByStarter); + String richTextOfflineInstructions=request.getParameter(RICHTEXT_OFFLINEINSTRUCTIONS); logger.debug("read parameter richTextOfflineInstructions: " + richTextOfflineInstructions); String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); @@ -229,15 +232,19 @@ logger.debug("read parameter richTextInstructions: " + richTextInstructions); - if ((richTextTitle != null) && (richTextTitle.length() > 0)) + if (!requestByStarter) { - request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); + //if ((richTextTitle != null) && (richTextTitle.length() > 0)) + //{ + request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); + //} + + //if ((richTextInstructions != null) && (richTextInstructions.length() > 0)) + //{ + request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); + //} } - if ((richTextInstructions != null) && (richTextInstructions.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); - } String richTextIncorrectFeedback=request.getParameter(RICHTEXT_INCORRECT_FEEDBACK); logger.debug("read parameter richTextIncorrectFeedback: " + richTextIncorrectFeedback); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java,v diff -u -r1.45 -r1.46 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java 9 Aug 2006 17:53:42 -0000 1.45 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java 18 Aug 2006 11:36:27 -0000 1.46 @@ -72,13 +72,14 @@ * @param request * @param mcAuthoringForm */ - public static void readData(HttpServletRequest request, McAuthoringForm mcAuthoringForm) + public static void readData(HttpServletRequest request, McAuthoringForm mcAuthoringForm, boolean requestByStarter) { + logger.debug("readData requestByStarter: " + requestByStarter); /** define the next tab as Basic tab by default*/ mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); - McUtils.persistInSessionRichText(request); + McUtils.saveInSessionRichText(request, requestByStarter); AuthoringUtil.populateParameters(request, mcAuthoringForm); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java,v diff -u -r1.115 -r1.116 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 9 Aug 2006 17:53:42 -0000 1.115 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 18 Aug 2006 11:36:27 -0000 1.116 @@ -185,7 +185,7 @@ McUtils.cleanUpUserExceptions(request); McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.resetUserAction(); request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); @@ -225,7 +225,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent after shrinking: " + mapQuestionsContent); @@ -372,7 +372,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); Map mapWeights= AuthoringUtil.repopulateMap(request, "questionWeight"); request.getSession().setAttribute(MAP_WEIGHTS, mapWeights); @@ -497,7 +497,7 @@ logger.debug("mcService : " + mcService); - boolean performEditOptions=performEditOptions(mapping, form, request, response, false); + boolean performEditOptions=performEditOptions(mapping, form, request, response, false, false); logger.debug("performEditOptions: " + performEditOptions); Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); @@ -526,11 +526,11 @@ public boolean performEditOptions(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, boolean defaultStarter) throws IOException, + HttpServletResponse response, boolean defaultStarter, boolean requestByStarter) throws IOException, ServletException { McUtils.cleanUpUserExceptions(request); - logger.debug("starting performEditOptions..."); + logger.debug("starting performEditOptions...requestByStarter : " + requestByStarter); logger.debug("defaultStarter:" + defaultStarter); McUtils.debugMaps(request); request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); @@ -544,7 +544,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, requestByStarter); Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); logger.debug("initial test: current mapGeneralOptionsContent: " + mapGeneralOptionsContent); @@ -971,7 +971,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); @@ -1119,7 +1119,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); @@ -1256,7 +1256,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent before move down: " + mapQuestionsContent); @@ -1415,7 +1415,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent before move down: " + mapQuestionsContent); @@ -1566,7 +1566,7 @@ logger.debug("mcService : " + mcService); - boolean performDoneOptions=performDoneOptions(mapping, form, request, response, false); + boolean performDoneOptions=performDoneOptions(mapping, form, request, response, false, false); logger.debug("performDoneOptions: " + performDoneOptions); Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); @@ -1595,10 +1595,10 @@ public boolean performDoneOptions(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, boolean defaultStarter) throws IOException, + HttpServletResponse response, boolean defaultStarter, boolean requestByStarter) throws IOException, ServletException { - logger.debug("starting performDoneOptions..."); + logger.debug("starting performDoneOptions.., requestByStarter:" + requestByStarter); logger.debug("using defaultStarter: " + defaultStarter); McUtils.cleanUpUserExceptions(request); request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); @@ -1613,7 +1613,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, requestByStarter); mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); @@ -1875,7 +1875,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); @@ -2413,7 +2413,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); String uuid =mcAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); @@ -2475,7 +2475,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); String uuid =mcAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); @@ -2536,7 +2536,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); logger.debug("will uploadFile for offline file:"); McAttachmentDTO mcAttachmentDTO=AuthoringUtil.uploadFile(request, mcAuthoringForm, true); @@ -2620,7 +2620,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); logger.debug("will uploadFile for online file:"); McAttachmentDTO mcAttachmentDTO=AuthoringUtil.uploadFile(request, mcAuthoringForm, false); @@ -2701,7 +2701,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.resetUserAction(); @@ -2752,7 +2752,7 @@ String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); - AuthoringUtil.readData(request, mcAuthoringForm); + AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.resetUserAction(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java,v diff -u -r1.78 -r1.79 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 9 Aug 2006 12:53:09 -0000 1.78 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 18 Aug 2006 11:36:26 -0000 1.79 @@ -296,9 +296,9 @@ logger.debug("retrieving default content"); retrieveDefaultContent(request, mcAuthoringForm); McAction mcAction= new McAction(); - boolean performEditOptions=mcAction.performEditOptions(mapping, form, request, response, true); + boolean performEditOptions=mcAction.performEditOptions(mapping, form, request, response, true, true); logger.debug("performEditOptions: " + performEditOptions); - boolean performDoneOptions=mcAction.performDoneOptions(mapping, form, request, response, true); + boolean performDoneOptions=mcAction.performDoneOptions(mapping, form, request, response, true, true); logger.debug("performDoneOptions: " + performDoneOptions); } else @@ -654,7 +654,7 @@ if (mcContent.getTitle() == null) { - request.getSession().setAttribute(RICHTEXT_TITLE,"MCQ Title"); + request.getSession().setAttribute(RICHTEXT_TITLE,DEFAULT_MCQ_TITLE); } else { @@ -663,7 +663,7 @@ if (mcContent.getInstructions() == null) { - request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,"MCQ Instructions"); + request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,DEFAULT_MCQ_INSTRUCTIONS); } else {