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 @@
<%@ include file="errorbox.jsp" %> |
+ <%@ include file="errorbox.jsp" %> + | +
+ |
+
-
-
- |
- |
   |