Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/Attic/McResources.properties,v diff -u -r1.9 -r1.10 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties 20 Oct 2005 20:24:20 -0000 1.9 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties 20 Oct 2005 21:41:19 -0000 1.10 @@ -1,6 +1,8 @@ # Project lams_tool_lamc11 #Authoring mode resources label.authoring.mc =Multiple Choice +label.authoring.mc.basic =Please define the questions and their options. +label.authoring.mc.basic.editOptions =Please define the question and/or its options. label.authoring.title =Title label.authoring.instructions =Instructions @@ -28,6 +30,7 @@ label.report.title =Report Title label.monitoringReport.title =Monitoring Report Title label.report.endLearningMessage =End of Activity Message +label.question.only =Question label.question =Question: label.question1 =Question 1 radiobox.defineLater =Define Later @@ -50,7 +53,7 @@ error.instructions =The field "Instructions" is mandatory.
error.reportTitle =The field "Report Title (Advanced)" is mandatory.
error.defaultquestion.empty =The first question can not be empty.
-submit.successful =The content has been created successfully.
+submit.successful =The content has been created successfully. 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. Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java 20 Oct 2005 20:24:20 -0000 1.8 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java 20 Oct 2005 21:41:20 -0000 1.9 @@ -38,6 +38,8 @@ public McQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid); + public void cleanAllQuestions(final Long mcContentUid); + public void resetAllQuestions(final Long mcContentUid); public void removeQuestionContentByMcUid(final Long mcContentUid); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java,v diff -u -r1.12 -r1.13 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java 20 Oct 2005 20:24:20 -0000 1.12 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java 20 Oct 2005 21:41:20 -0000 1.13 @@ -46,6 +46,8 @@ private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId"; + private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId"; + private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from mcQueContent in class McQueContent where mcQueContent.question=:question and mcQueContent.mcContentId=:mcContentUid"; @@ -126,7 +128,29 @@ } + public void cleanAllQuestions(final Long mcContentUid) + { + HibernateTemplate templ = this.getHibernateTemplate(); + List list = getSession().createQuery(CLEAN_QUESTION_CONTENT_BY_CONTENT_ID) + .setLong("mcContentId", mcContentUid.longValue()) + .list(); + + if(list != null && list.size() > 0){ + Iterator listIterator=list.iterator(); + while (listIterator.hasNext()) + { + McQueContent mcQueContent=(McQueContent)listIterator.next(); + if ((mcQueContent != null) && (mcQueContent.isDisabled())); + { + this.getSession().setFlushMode(FlushMode.AUTO); + templ.delete(mcQueContent); + } + } + } + } + + public void saveMcQueContent(McQueContent mcQueContent) { this.getHibernateTemplate().save(mcQueContent); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java,v diff -u -r1.9 -r1.10 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 20 Oct 2005 20:24:20 -0000 1.9 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 20 Oct 2005 21:41:19 -0000 1.10 @@ -79,6 +79,8 @@ public void resetAllQuestions(final Long mcContentUid) throws McApplicationException; + public void cleanAllQuestions(final Long mcContentUid) throws McApplicationException; + public void removeMcOptionsContentByQueId(Long mcQueContentId) throws McApplicationException; public void removeMcOptionsContent(McOptsContent mcOptsContent); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java,v diff -u -r1.10 -r1.11 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 20 Oct 2005 20:24:20 -0000 1.10 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 20 Oct 2005 21:41:19 -0000 1.11 @@ -226,6 +226,21 @@ } + + public void cleanAllQuestions(final Long mcContentUid) throws McApplicationException + { + try + { + mcQueContentDAO.cleanAllQuestions(mcContentUid); + } + catch (DataAccessException e) + { + throw new McApplicationException("Exception occured when lams is cleaning all questions: " + + e.getMessage(), + e); + } + } + public void createMcSession(McSession mcSession) throws McApplicationException { 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.14 -r1.15 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 20 Oct 2005 20:24:20 -0000 1.14 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 20 Oct 2005 21:41:19 -0000 1.15 @@ -562,6 +562,7 @@ Map mapQuestionsContent=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); @@ -588,6 +589,15 @@ } } } + + mcService.cleanAllQuestions(mcContent.getUid()); + logger.debug("all questions cleaned for :" + mcContent.getUid()); + + ActionMessages errors= new ActionMessages(); + errors.add(Globals.ERROR_KEY,new ActionMessage("submit.successful")); + logger.debug("add submit.successful to ActionMessages"); + saveErrors(request,errors); + mcAuthoringForm.resetUserAction(); return (mapping.findForward(LOAD_QUESTIONS)); } Index: lams_tool_lamc/web/authoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/Attic/authoringMaincontent.jsp,v diff -u -r1.13 -r1.14 --- lams_tool_lamc/web/authoringMaincontent.jsp 20 Oct 2005 20:24:19 -0000 1.13 +++ lams_tool_lamc/web/authoringMaincontent.jsp 20 Oct 2005 21:41:19 -0000 1.14 @@ -42,7 +42,7 @@ -

Multipe Choice

+

@@ -89,14 +89,15 @@
-

Please define the questions and their options.

+

+
<%@ include file="errorbox.jsp" %>
@@ -197,7 +198,7 @@
-

Advanced Question Definitions

+

Advanced Definitions

The advanced contents should go here
Index: lams_tool_lamc/web/editOptionsContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/Attic/editOptionsContent.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/web/editOptionsContent.jsp 20 Oct 2005 09:35:18 -0000 1.4 +++ lams_tool_lamc/web/editOptionsContent.jsp 20 Oct 2005 21:41:19 -0000 1.5 @@ -42,7 +42,7 @@ -

Multipe Choice

+

@@ -98,19 +98,29 @@
-

Edit Question Options

+

+ +
+ + + +
+ <%@ include file="errorbox.jsp" %> +
+
- +
+ + + +
+ :   + " + size="50" maxlength="255"> +
+ - - - Index: lams_tool_lamc/web/errorbox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/Attic/errorbox.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_lamc/web/errorbox.jsp 19 Oct 2005 16:14:00 -0000 1.2 +++ lams_tool_lamc/web/errorbox.jsp 20 Oct 2005 21:41:19 -0000 1.3 @@ -27,4 +27,7 @@
  • - \ No newline at end of file + + + +
    -

    - :   - -

    -