Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -r7ae4a0ef94c0ee40dbe85263bd7ea102559b0918 -raa3eef2f8bc90640f43a1a493154ba94c3e02c00 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 7ae4a0ef94c0ee40dbe85263bd7ea102559b0918) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision aa3eef2f8bc90640f43a1a493154ba94c3e02c00) @@ -69,7 +69,7 @@ * refers to number of questions presented initially, we have a single record for default content */ public static final Long INITIAL_QUESTION_COUNT =new Long(1); - public static final long MAX_QUESTION_COUNT =50; + public static final long MAX_QUESTION_COUNT =30; /** * Struts level constants Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r7ae4a0ef94c0ee40dbe85263bd7ea102559b0918 -raa3eef2f8bc90640f43a1a493154ba94c3e02c00 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 7ae4a0ef94c0ee40dbe85263bd7ea102559b0918) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision aa3eef2f8bc90640f43a1a493154ba94c3e02c00) @@ -233,12 +233,33 @@ logger.debug("updated Questions Map size: " + mapQuestionsContent.size()); request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); logger.debug("updated Questions Map: " + request.getSession().getAttribute(MAP_QUESTIONS_CONTENT)); + + mcAuthoringForm.resetUserAction(); return (mapping.findForward(LOAD_QUESTIONS)); } + else if (mcAuthoringForm.getRemoveQuestion() != null) + { + userAction="removeQuestion"; + request.setAttribute(USER_ACTION, userAction); + + String questionIndex =mcAuthoringForm.getQuestionIndex(); + logger.debug("questionIndex:" + questionIndex); + String deletableQuestionEntry=(String)mapQuestionsContent.get(questionIndex); + logger.debug("deletableQuestionEntry:" + deletableQuestionEntry); + mapQuestionsContent.remove(questionIndex); + logger.debug("removed entry:" + deletableQuestionEntry + " from the Map"); + request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + logger.debug("updated Questions Map: " + request.getSession().getAttribute(MAP_QUESTIONS_CONTENT)); + + mcAuthoringForm.resetUserAction(); + return (mapping.findForward(LOAD_QUESTIONS)); + } else if (mcAuthoringForm.getEditDefaultQuestion() != null) { userAction="editDefaultQuestion"; request.setAttribute(USER_ACTION, userAction); + + mcAuthoringForm.resetUserAction(); return (mapping.findForward(EDIT_OPTS_CONTENT)); } @@ -248,6 +269,8 @@ IMcService mcService =McUtils.getToolService(request); logger.debug("mcService:" + mcService); + + mcAuthoringForm.resetUserAction(); return (mapping.findForward(LOAD_QUESTIONS)); } @@ -298,17 +321,14 @@ for (long i=1; i <= MAX_QUESTION_COUNT ; i++) { String candidateQuestionEntry =request.getParameter("questionContent" + i); - logger.debug("candidateQuestionEntry:" + candidateQuestionEntry); if ( (candidateQuestionEntry != null) && (candidateQuestionEntry.length() > 0) && !(candidateQuestionEntry.equals("")) ) { mapCounter++; - logger.debug("mapCounter:" + mapCounter); mapTempQuestionsContent.put(new Long(mapCounter).toString(), candidateQuestionEntry); - logger.debug("added new entry: " + candidateQuestionEntry); } } logger.debug("return repopulated Map: " + mapTempQuestionsContent); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java =================================================================== diff -u -re6d1e7b2b7a185ef297334af35e9aec398a29930 -raa3eef2f8bc90640f43a1a493154ba94c3e02c00 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision e6d1e7b2b7a185ef297334af35e9aec398a29930) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision aa3eef2f8bc90640f43a1a493154ba94c3e02c00) @@ -26,6 +26,7 @@ protected String addOptionContent; protected String removeOptionContent; protected String addQuestion; + protected String removeQuestion; protected String addContent; protected String removeContent; @@ -79,6 +80,7 @@ this.addOptionContent=null; this.removeOptionContent=null; this.addQuestion=null; + this.removeQuestion=null; this.addContent=null; this.removeContent=null; @@ -101,6 +103,7 @@ this.addOptionContent=null; this.removeOptionContent=null; this.addQuestion=null; + this.removeQuestion=null; this.addContent=null; this.removeContent=null; @@ -598,4 +601,16 @@ public void setAddQuestion(String addQuestion) { this.addQuestion = addQuestion; } + /** + * @return Returns the removeQuestion. + */ + public String getRemoveQuestion() { + return removeQuestion; + } + /** + * @param removeQuestion The removeQuestion to set. + */ + public void setRemoveQuestion(String removeQuestion) { + this.removeQuestion = removeQuestion; + } } Index: lams_tool_lamc/web/authoringMaincontent.jsp =================================================================== diff -u -r7ae4a0ef94c0ee40dbe85263bd7ea102559b0918 -raa3eef2f8bc90640f43a1a493154ba94c3e02c00 --- lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision 7ae4a0ef94c0ee40dbe85263bd7ea102559b0918) +++ lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision aa3eef2f8bc90640f43a1a493154ba94c3e02c00) @@ -150,7 +150,7 @@ size="50" maxlength="255">