Index: lams_tool_lamc/db/model/lams_tool_mc.clay =================================================================== diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/db/model/lams_tool_mc.clay (.../lams_tool_mc.clay) (revision 306bd64453644ecb765fde5814bbcc308aa911a1) +++ lams_tool_lamc/db/model/lams_tool_mc.clay (.../lams_tool_mc.clay) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -245,7 +245,7 @@ - + @@ -270,8 +270,8 @@ - + @@ -293,6 +293,20 @@ + + + + + + + + + + + + + + Index: lams_tool_lamc/db/sql/create_lams_tool_lamc.sql =================================================================== diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/db/sql/create_lams_tool_lamc.sql (.../create_lams_tool_lamc.sql) (revision 306bd64453644ecb765fde5814bbcc308aa911a1) +++ lams_tool_lamc/db/sql/create_lams_tool_lamc.sql (.../create_lams_tool_lamc.sql) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -29,6 +29,8 @@ , question VARCHAR(255) , weight INT(5) NOT NULL DEFAULT 0 , disabled TINYINT(1) NOT NULL DEFAULT 1 + , feedbackCorrect VARCHAR(255) + , feedbackIncorrect VARCHAR(255) , display_order INT(5) , mc_content_id BIGINT(20) NOT NULL , PRIMARY KEY (uid) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -re8526e7f760e36faf92d8c56da58cf04d7e2b3db -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision e8526e7f760e36faf92d8c56da58cf04d7e2b3db) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -163,6 +163,8 @@ + public static final String RICHTEXT_FEEDBACK_CORRECT ="richTextFeedbackCorrect"; + public static final String RICHTEXT_FEEDBACK_INCORRECT ="richTextFeedbackInCorrect"; public static final String RICHTEXT_OFFLINEINSTRUCTIONS ="richTextOfflineInstructions"; public static final String RICHTEXT_ONLINEINSTRUCTIONS ="richTextOnlineInstructions"; public static final String RICHTEXT_TITLE ="richTextTitle"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQueContent.java =================================================================== diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQueContent.java (.../McQueContent.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McQueContent.java (.../McQueContent.java) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -51,6 +51,11 @@ /** persistent field */ private boolean disabled; + private String feedbackCorrect; + + private String feedbackIncorrect; + + /** non persistent field */ private Long mcContentId; @@ -92,6 +97,19 @@ } + public McQueContent(String question, Integer displayOrder, Integer weight, String feedbackCorrect, String feedbackIncorrect, boolean disabled, McContent mcContent, Set mcUsrAttempts, Set mcOptionsContents) { + this.question = question; + this.displayOrder = displayOrder; + this.weight = weight; + this.disabled = disabled; + this.feedbackCorrect=feedbackCorrect; + this.feedbackIncorrect=feedbackIncorrect; + this.mcContent=mcContent; + this.mcUsrAttempts = mcUsrAttempts; + this.mcOptionsContents = mcOptionsContents; + } + + public McQueContent(Long mcQueContentId, String question, Integer displayOrder, Set mcUsrAttempts, Set mcOptionsContents) { this.mcQueContentId = mcQueContentId; this.question = question; @@ -258,4 +276,28 @@ public void setWeight(Integer weight) { this.weight = weight; } + /** + * @return Returns the feedbackCorrect. + */ + public String getFeedbackCorrect() { + return feedbackCorrect; + } + /** + * @param feedbackCorrect The feedbackCorrect to set. + */ + public void setFeedbackCorrect(String feedbackCorrect) { + this.feedbackCorrect = feedbackCorrect; + } + /** + * @return Returns the feedbackIncorrect. + */ + public String getFeedbackIncorrect() { + return feedbackIncorrect; + } + /** + * @param feedbackIncorrect The feedbackIncorrect to set. + */ + public void setFeedbackIncorrect(String feedbackIncorrect) { + this.feedbackIncorrect = feedbackIncorrect; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties =================================================================== diff -u -re8526e7f760e36faf92d8c56da58cf04d7e2b3db -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision e8526e7f760e36faf92d8c56da58cf04d7e2b3db) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -62,11 +62,14 @@ option.off =OFF option.correct =Correct option.incorrect =Incorrect +label.feedback.incorrect =Feedback if answered incorrectly: +label.feedback.correct =Feedback if answered correctly: feedback =Please address the following issues before submit.
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. +error.weights.zero =Please correct this: The question weights can not be 0. error.weights.notInteger =Please correct this: The question weights must be an integer. error.emptyQuestion =Please enter the question text. The chosen question can not be empty. error.title =Please correct this: The field "Title" is mandatory.
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== diff -u -r735c5db341aaba22874662bf7e44ec91a24424c7 -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -236,6 +236,13 @@ String richTextInstructions=request.getParameter(RICHTEXT_INSTRUCTIONS); logger.debug("read parameter richTextInstructions: " + richTextInstructions); + String richTextFeedbackCorrect=request.getParameter(RICHTEXT_FEEDBACK_CORRECT); + logger.debug("read parameter richTextFeedbackCorrect: " + richTextFeedbackCorrect); + + String richTextFeedbackInCorrect=request.getParameter(RICHTEXT_FEEDBACK_INCORRECT); + logger.debug("read parameter richTextFeedbackInCorrect: " + richTextFeedbackInCorrect); + + if ((richTextTitle != null) && (richTextTitle.length() > 0)) { request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); @@ -245,6 +252,18 @@ { request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); } + + if ((richTextFeedbackCorrect != null) && (richTextFeedbackCorrect.length() > 0)) + { + request.getSession().setAttribute(RICHTEXT_FEEDBACK_CORRECT,richTextFeedbackCorrect); + } + + if ((richTextFeedbackInCorrect != null) && (richTextFeedbackInCorrect.length() > 0)) + { + request.getSession().setAttribute(RICHTEXT_FEEDBACK_INCORRECT,richTextFeedbackInCorrect); + } + + } public static void addFileToContentRepository(HttpServletRequest request, McAuthoringForm mcAuthoringForm, boolean isOfflineFile) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -re8526e7f760e36faf92d8c56da58cf04d7e2b3db -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision e8526e7f760e36faf92d8c56da58cf04d7e2b3db) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -26,7 +26,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; @@ -44,7 +43,6 @@ import org.apache.struts.action.ActionMessages; import org.apache.struts.actions.DispatchAction; import org.lamsfoundation.lams.tool.mc.McAppConstants; -import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McComparator; import org.lamsfoundation.lams.tool.mc.McContent; import org.lamsfoundation.lams.tool.mc.McOptsContent; @@ -526,7 +524,7 @@ request.setAttribute(USER_ACTION, userAction); logger.debug("userAction:" + userAction); - String optionIndex =mcAuthoringForm.getOptionIndex(); + String optionIndex =mcAuthoringForm.getDeletableOptionIndex(); logger.debug("optionIndex:" + optionIndex); Map mapOptionsContent=repopulateMap(request, "optionContent"); @@ -593,6 +591,19 @@ logger.debug("mcQueContent:" + mcQueContent); mcQueContent.setQuestion(selectedQuestion); + logger.debug("updated question set"); + + String richTextFeedbackCorrect=(String) request.getSession().getAttribute(RICHTEXT_FEEDBACK_CORRECT); + logger.debug("richTextFeedbackCorrect: " + richTextFeedbackCorrect); + if (richTextFeedbackCorrect == null) richTextFeedbackCorrect=""; + mcQueContent.setFeedbackCorrect(richTextFeedbackCorrect); + + String richTextFeedbackInCorrect=(String) request.getSession().getAttribute(RICHTEXT_FEEDBACK_INCORRECT); + logger.debug("richTextFeedbackInCorrect: " + richTextFeedbackInCorrect); + if (richTextFeedbackInCorrect == null) richTextFeedbackInCorrect=""; + mcQueContent.setFeedbackIncorrect(richTextFeedbackInCorrect); + + mcService.saveOrUpdateMcQueContent(mcQueContent); logger.debug("persisted selectedQuestion" + selectedQuestion); @@ -603,7 +614,8 @@ mcService.removeMcOptionsContentByQueId(selectedQuestionContentUid); logger.debug("removed all mcOptionsContents for mcQueContentId :" + selectedQuestionContentUid); - + + String isCheckBoxSelected=null; boolean isCorrect=false; for (int i=1; i <= MAX_OPTION_COUNT ; i++) @@ -634,10 +646,13 @@ request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); logger.debug("Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); - McOptsContent mcOptionsContent= new McOptsContent(isCorrect,selectedAnswer , mcQueContent, new HashSet()); - logger.debug("created mcOptionsContent: " + mcOptionsContent); - mcService.saveMcOptionsContent(mcOptionsContent); - logger.debug("final persistance of option"); + if ((selectedAnswer != null) && (selectedAnswer.length() > 0)) + { + McOptsContent mcOptionsContent= new McOptsContent(isCorrect,selectedAnswer , mcQueContent, new HashSet()); + logger.debug("created mcOptionsContent: " + mcOptionsContent); + mcService.saveMcOptionsContent(mcOptionsContent); + logger.debug("final persistance of option"); + } } } @@ -755,8 +770,9 @@ endLearningMessage=(String)request.getSession().getAttribute(END_LEARNING_MESSAGE); - String richTextTitle=(String) request.getSession().getAttribute(RICHTEXT_TITLE); + String richTextTitle=(String) request.getSession().getAttribute(RICHTEXT_TITLE); logger.debug("richTextTitle: " + richTextTitle); + String richTextInstructions=(String) request.getSession().getAttribute(RICHTEXT_INSTRUCTIONS); logger.debug("richTextInstructions: " + richTextInstructions); @@ -1332,6 +1348,22 @@ persistError(request,"error.weights.notInteger"); return false; } + + + int weight= new Integer(pairs.getValue().toString()).intValue(); + if (weight == 0) + { + ActionMessages errors= new ActionMessages(); + errors= new ActionMessages(); + errors.add(Globals.ERROR_KEY,new ActionMessage("error.weights.zero")); + saveErrors(request,errors); + mcAuthoringForm.resetUserAction(); + persistError(request,"error.weights.zero"); + return false; + + } + + } mcAuthoringForm.resetUserAction(); return true; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java =================================================================== diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -36,6 +36,7 @@ protected String questionIndex; protected String optionIndex; protected String selectedIndex; + protected String deletableOptionIndex; protected String editDefaultQuestion; protected String removeOptionContent; @@ -157,6 +158,7 @@ this.questionIndex=null; this.optionIndex=null; this.selectedIndex=null; + this.deletableOptionIndex=null; this.isRemoveContent=null; this.toolContentId=null; @@ -799,4 +801,16 @@ public void setInstructionsTabDone(String instructionsTabDone) { this.instructionsTabDone = instructionsTabDone; } + /** + * @return Returns the deletableOptionIndex. + */ + public String getDeletableOptionIndex() { + return deletableOptionIndex; + } + /** + * @param deletableOptionIndex The deletableOptionIndex to set. + */ + public void setDeletableOptionIndex(String deletableOptionIndex) { + this.deletableOptionIndex = deletableOptionIndex; + } } Index: lams_tool_lamc/web/AdvancedContent.jsp =================================================================== diff -u -r653f0f0eff40af5e6891c22ef2b8efe9bf2f75af -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/web/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 653f0f0eff40af5e6891c22ef2b8efe9bf2f75af) +++ lams_tool_lamc/web/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -3,13 +3,12 @@ <%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el" %> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> -
-
+
- +
- - - + + + + + + + + + + + - + - + - + -
- : + + : @@ -23,8 +22,8 @@
- : + + : @@ -38,8 +37,8 @@
- : + + : @@ -52,45 +51,77 @@
+ : + + + + + + + + +
+ : + + + + + + + + +
: + :
: + : +
: + : +
- -
- + + + + - -
+    +
- +
+
- - - - - - \ No newline at end of file Index: lams_tool_lamc/web/BasicContent.jsp =================================================================== diff -u -r653f0f0eff40af5e6891c22ef2b8efe9bf2f75af -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/web/BasicContent.jsp (.../BasicContent.jsp) (revision 653f0f0eff40af5e6891c22ef2b8efe9bf2f75af) +++ lams_tool_lamc/web/BasicContent.jsp (.../BasicContent.jsp) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -5,165 +5,157 @@ <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> <%@ taglib uri="fck-editor" prefix="FCK" %> -
- - - - - - - - - - - - - - - + - \ No newline at end of file +
: - - - + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - + + -
: + + +
: - - - + : + + +
- : - - "> -   - - - -
: " value="" - size="50" maxlength="255"> -   - - - -
+    +
- -
- - - - -
- - - -
-
- - - - - - - - - - - - - - - - - - - - + - - - - + - + + + + +
: - -
: - -
- : - -
+ + + + + + + + - - - - - - - - + + + + + + + + + + + +     + + + + + + + + + + + + + + +     + + + - - - -
+ +
+
+
+
+
+
: -   -
: + " value="" + size="50" maxlength="255" > + + + + " value="" + size="3" maxlength="3"> + + + + + + + + + + +
: + " value="" size="50" maxlength="255" > + + + + " value="" + size="3" maxlength="3"> + + + + + + + + + + +
- -
- - - - -
- - - -
-
+ + + +
+
Index: lams_tool_lamc/web/authoringMaincontent.jsp =================================================================== diff -u -re8526e7f760e36faf92d8c56da58cf04d7e2b3db -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision e8526e7f760e36faf92d8c56da58cf04d7e2b3db) +++ lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -265,123 +265,7 @@

Advanced Definitions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- : - - - - - - - - -
- : - - - - - - - - -
- : - - - - - - - - -
- : - - - - - - - - -
- : - - - - - - - - -
- : - -
- : - - -
- : - - -
-    -
- - - -
- +
Index: lams_tool_lamc/web/editOptionsContent.jsp =================================================================== diff -u -re8526e7f760e36faf92d8c56da58cf04d7e2b3db -r2dbeea64b0b9925ebfcc5b10ced841ad134a0f38 --- lams_tool_lamc/web/editOptionsContent.jsp (.../editOptionsContent.jsp) (revision e8526e7f760e36faf92d8c56da58cf04d7e2b3db) +++ lams_tool_lamc/web/editOptionsContent.jsp (.../editOptionsContent.jsp) (revision 2dbeea64b0b9925ebfcc5b10ced841ad134a0f38) @@ -118,13 +118,15 @@ - +
- - + +       +
- - + +       +
@@ -134,35 +136,39 @@ - + : + " value="" size="50" maxlength="255"> - + +       + - + - + - + - + - +       + @@ -177,32 +183,34 @@ " value="" size="50" maxlength="255"> - -\ +       + + - + - + - + - + - - @@ -211,20 +219,57 @@ "> - +    + + +    + + + + + + + + + + + + + +   +   + + + + + + + + + + + + +   +   + + + - +   + +

@@ -237,9 +282,9 @@
-

Advanced Question Definitions

+

Advanced Definitions

-The advanced contents should go here +
@@ -283,6 +328,3 @@ - - -