Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties =================================================================== diff -u -rd6cf8ad18993af7a9d51820aa2cd2274d1560ac7 -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision d6cf8ad18993af7a9d51820aa2cd2274d1560ac7) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -2,13 +2,15 @@ #Authoring mode resources label.authoring.mc =Multiple Choice label.authoring.mc.basic =Please define the questions. +label.mc.questions =Multiple Choice Questions label.authoring.mc.basic.editOptions =Please define the question and/or its options. label.authoring.title =Title label.authoring.instructions =Instructions label.Questions =Questions label.weight =Weight label.action =Action label.actions =Actions +label.add.question =Add Question label.fileContent =File Content button.basic =Basic @@ -72,6 +74,7 @@ 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. 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. Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r27704d3c27e7319c0a145e10dd99717b6f5ed82c -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 27704d3c27e7319c0a145e10dd99717b6f5ed82c) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -1,5 +1,4 @@ -/* - *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +/* *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) * *This program is free software; you can redistribute it and/or modify *it under the terms of the GNU General Public License as published by @@ -293,7 +292,7 @@ } mcAuthoringForm.resetUserAction(); - return (mapping.findForward(LOAD_FILE_CONTENT)); + return null; } @@ -392,7 +391,7 @@ logger.debug("updated SELECTED_QUESTION"); } - mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setRemoveQuestion(null); mcAuthoringForm.setEditOptions(null); mcAuthoringForm.setMoveUp(null); @@ -402,13 +401,15 @@ mcAuthoringForm.setViewFileItem(null); + /* String addQuestion=request.getParameter("addQuestion"); logger.debug("parameter addQuestion" + addQuestion); if ((addQuestion != null) && addQuestion.equals("1")) { logger.debug("parameter addQuestion is selected " + addQuestion); mcAuthoringForm.setAddQuestion("1"); } + */ String editOptions=request.getParameter("editOptions"); @@ -503,6 +504,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -517,6 +521,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -538,6 +545,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -557,7 +567,10 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); - return (mapping.findForward(LOAD_QUESTIONS)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); + return (mapping.findForward(LOAD_QUESTIONS)); } /** @@ -1306,12 +1319,31 @@ request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); + ActionMessages errors= new ActionMessages(); + Map mapQuestionsContent=repopulateMap(request, "questionContent"); - logger.debug("mapQuestionsContent before move down: " + mapQuestionsContent); + logger.debug("mapQuestionsContent before submit: " + mapQuestionsContent); request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + + /* make sure the questions Map is not empty*/ + int mapSize=mapQuestionsContent.size(); + logger.debug("mapSize: " + mapSize); - ActionMessages errors= new ActionMessages(); - + if (mapSize == 0) + { + request.getSession().setAttribute(CURRENT_TAB, new Long(1)); + + 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"); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); + return (mapping.findForward(LOAD_QUESTIONS)); + } + boolean weightsValid=validateQuestionWeights(request,mcAuthoringForm); logger.debug("weightsValid:" + weightsValid); if (weightsValid == false) @@ -1322,6 +1354,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -1342,6 +1377,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -1401,6 +1439,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } } @@ -1427,6 +1468,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -1457,7 +1501,7 @@ logger.debug("richTextInstructions: " + richTextInstructions); - if ((richTextTitle == null) || (richTextTitle.length() == 0) || richTextTitle.equalsIgnoreCase(RICHTEXT_BLANK)) + if ((richTextTitle == null) || (richTextTitle.length() == 0) || richTextTitle.equalsIgnoreCase(RICHTEXT_BLANK)) { errors.add(Globals.ERROR_KEY,new ActionMessage("error.title")); logger.debug("add title to ActionMessages"); @@ -1480,6 +1524,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -1572,6 +1619,9 @@ int maxQuestionIndex=mapQuestionsContent.size(); request.getSession().setAttribute(MAX_QUESTION_INDEX, new Integer(maxQuestionIndex)); logger.debug("MAX_QUESTION_INDEX: " + request.getSession().getAttribute(MAX_QUESTION_INDEX)); + + mcAuthoringForm.setAddQuestion(null); + mcAuthoringForm.setSubmitQuestions(null); return (mapping.findForward(LOAD_QUESTIONS)); } Index: lams_tool_lamc/web/BasicContent.jsp =================================================================== diff -u -rfd6328a28e3ebbd9700e73f6120398153b2dacb1 -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/web/BasicContent.jsp (.../BasicContent.jsp) (revision fd6328a28e3ebbd9700e73f6120398153b2dacb1) +++ lams_tool_lamc/web/BasicContent.jsp (.../BasicContent.jsp) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -52,80 +52,66 @@ --> - + + + + + + + + - - - - - - - - - - + + + + + + - - - + - - - + + ; document.forms[0].submit();"> + ; document.forms[0].submit();"> + + - - - - - - - + + + +
+ +
+ + + +
: - " value="" - size="50" maxlength="255" > - - ; document.forms[0].submit();"> - - - - " value="" - size="3" maxlength="3"> - - - -
: + " value="" + size="50" maxlength="255" > + - ; document.forms[0].editOptions.value=1; document.forms[0].submit();"> - -
+ + ; document.forms[0].submit();"> + + + + ; document.forms[0].submit();"> + - - - - -
: - " value="" - size="50" maxlength="255" > - - - - ; document.forms[0].submit();"> - - ; document.forms[0].submit();"> - - - - " value="" - size="3" maxlength="3"> - - - - - ; document.forms[0].editOptions.value=1; document.forms[0].submit();"> - ; document.forms[0].removeQuestion.value=1; document.forms[0].submit();"> -
+ + + " value="" + size="3" maxlength="3"> + + + + + ; document.forms[0].editOptions.value=1; document.forms[0].submit();"> + ; document.forms[0].removeQuestion.value=1; document.forms[0].submit();"> +
- Index: lams_tool_lamc/web/allInstructionsContent.jsp =================================================================== diff -u -r7018cf59202a9562124f6ea36ea1b2a95f5897bb -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/web/allInstructionsContent.jsp (.../allInstructionsContent.jsp) (revision 7018cf59202a9562124f6ea36ea1b2a95f5897bb) +++ lams_tool_lamc/web/allInstructionsContent.jsp (.../allInstructionsContent.jsp) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -14,10 +14,8 @@ } String root = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; String pathToLams = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/../.."; - %> - Fisheye: Tag 7d4312121d0ac51529464536ca8203c445f5d433 refers to a dead (removed) revision in file `lams_tool_lamc/web/answersContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/authoringMaincontent.jsp =================================================================== diff -u -rd6cf8ad18993af7a9d51820aa2cd2274d1560ac7 -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision d6cf8ad18993af7a9d51820aa2cd2274d1560ac7) +++ lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -14,10 +14,8 @@ } String root = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; String pathToLams = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/../.."; - %> - Index: lams_tool_lamc/web/header.jsp =================================================================== diff -u -r653f0f0eff40af5e6891c22ef2b8efe9bf2f75af -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/web/header.jsp (.../header.jsp) (revision 653f0f0eff40af5e6891c22ef2b8efe9bf2f75af) +++ lams_tool_lamc/web/header.jsp (.../header.jsp) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -20,12 +20,3 @@ --> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> <%@ page contentType="text/html; charset=iso-8859-1" language="java" %> -<% -String protocol = request.getProtocol(); -if(protocol.startsWith("HTTPS")){ - protocol = "https://"; -}else{ - protocol = "http://"; -} -String pathToRoot = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; -%> Index: lams_tool_lamc/web/index.jsp =================================================================== diff -u -r64c79423986902d74a3b2eb5a009c8f24228f65d -r7d4312121d0ac51529464536ca8203c445f5d433 --- lams_tool_lamc/web/index.jsp (.../index.jsp) (revision 64c79423986902d74a3b2eb5a009c8f24228f65d) +++ lams_tool_lamc/web/index.jsp (.../index.jsp) (revision 7d4312121d0ac51529464536ca8203c445f5d433) @@ -6,8 +6,6 @@ <%@ taglib uri="fck-editor" prefix="FCK" %> - - <% String userContentId="1234"; Fisheye: Tag 7d4312121d0ac51529464536ca8203c445f5d433 refers to a dead (removed) revision in file `lams_tool_lamc/web/loadFileContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 7d4312121d0ac51529464536ca8203c445f5d433 refers to a dead (removed) revision in file `lams_tool_lamc/web/questionsContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 7d4312121d0ac51529464536ca8203c445f5d433 refers to a dead (removed) revision in file `lams_tool_lamc/web/rootPath.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 7d4312121d0ac51529464536ca8203c445f5d433 refers to a dead (removed) revision in file `lams_tool_lamc/web/standardTabHeader.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/survey.jpg =================================================================== diff -u -r61b5e4280bd941e994fbb7f9f5d3ad39b5ff570c -r7d4312121d0ac51529464536ca8203c445f5d433 Binary files differ