(
new TextSearchConditionComparator()), qa.isAllowRichEditor(), qa.isUseSelectLeaderToolOuput(),
qa.maximumRates, qa.minimumRates, new TreeSet());
@@ -548,7 +551,22 @@
public void setLockWhenFinished(boolean lockWhenFinished) {
this.lockWhenFinished = lockWhenFinished;
}
+
+ /**
+ * @return Returns the noReeditAllowed.
+ */
+ public boolean isNoReeditAllowed() {
+ return noReeditAllowed;
+ }
+ /**
+ * @param noReeditAllowed
+ * The noReeditAllowed to set.
+ */
+ public void setNoReeditAllowed(boolean noReeditAllowed) {
+ this.noReeditAllowed = noReeditAllowed;
+ }
+
public boolean isAllowRichEditor() {
return allowRichEditor;
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20150619.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20150619.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20150619.sql 20 Jun 2015 20:48:46 -0000 1.1
@@ -0,0 +1,14 @@
+-- Turn off autocommit, so nothing is committed if there is an error
+SET AUTOCOMMIT = 0;
+SET FOREIGN_KEY_CHECKS=0;
+----------------------Put all sql statements below here-------------------------
+
+-- LDEV-3487 Don't allow question redos
+ALTER TABLE tl_laqa11_content ADD COLUMN no_reedit_allowed TINYINT(1) NOT NULL DEFAULT 0;
+
+----------------------Put all sql statements above here-------------------------
+
+-- If there were no errors, commit and restore autocommit to on
+COMMIT;
+SET AUTOCOMMIT = 1;
+SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java,v
diff -u -r1.7 -r1.8
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java 28 Aug 2014 16:14:03 -0000 1.7
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java 20 Jun 2015 20:48:46 -0000 1.8
@@ -106,6 +106,8 @@
protected String initialScreen;
protected String lockWhenFinished;
+
+ protected boolean noReeditAllowed;
protected String userUid;
@@ -656,8 +658,23 @@
public void setLockWhenFinished(String lockWhenFinished) {
this.lockWhenFinished = lockWhenFinished;
}
+
+ /**
+ * @return Returns the noReeditAllowed.
+ */
+ public boolean getNoReeditAllowed() {
+ return noReeditAllowed;
+ }
/**
+ * @param noReeditAllowed
+ * The noReeditAllowed to set.
+ */
+ public void setNoReeditAllowed(boolean noReeditAllowed) {
+ this.noReeditAllowed = noReeditAllowed;
+ }
+
+ /**
* @return Returns the showOtherAnswers.
*/
public String getShowOtherAnswers() {
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v
diff -u -r1.125 -r1.126
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 19 Jun 2015 13:57:59 -0000 1.125
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 20 Jun 2015 20:48:46 -0000 1.126
@@ -1254,6 +1254,7 @@
toolContentObj.setMonitoringReportTitle(null);
// in LAMS 2.0
toolContentObj.setLockWhenFinished(true);
+ toolContentObj.setNoReeditAllowed(false);
toolContentObj.setShowOtherAnswers(true);
toolContentObj.setAllowRateAnswers(false);
toolContentObj.setNotifyTeachersOnResponseSubmit(false);
@@ -1473,6 +1474,7 @@
qa.setDefineLater(false);
qa.setLockWhenFinished(JsonUtil.opt(toolContentJSON, RestTags.LOCK_WHEN_FINISHED, Boolean.FALSE));
+ qa.setNoReeditAllowed(JsonUtil.opt(toolContentJSON, "noReeditAllowed", Boolean.FALSE));
qa.setAllowRichEditor(JsonUtil.opt(toolContentJSON, RestTags.ALLOW_RICH_TEXT_EDITOR, Boolean.FALSE));
qa.setUseSelectLeaderToolOuput(JsonUtil.opt(toolContentJSON, RestTags.USE_SELECT_LEADER_TOOL_OUTPUT, Boolean.FALSE));
qa.setMinimumRates(JsonUtil.opt(toolContentJSON, RestTags.MINIMUM_RATES, 0));
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java,v
diff -u -r1.42 -r1.43
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 1 Jun 2015 23:37:45 -0000 1.42
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 20 Jun 2015 20:48:46 -0000 1.43
@@ -225,6 +225,7 @@
String showOtherAnswers = request.getParameter("showOtherAnswers");
String questionsSequenced = request.getParameter(QaAppConstants.QUESTIONS_SEQUENCED);
String lockWhenFinished = request.getParameter("lockWhenFinished");
+ String noReeditAllowed = request.getParameter("noReeditAllowed");
String allowRichEditor = request.getParameter("allowRichEditor");
String useSelectLeaderToolOuput = request.getParameter("useSelectLeaderToolOuput");
String reflect = request.getParameter(QaAppConstants.REFLECT);
@@ -234,6 +235,7 @@
boolean questionsSequencedBoolean = false;
boolean lockWhenFinishedBoolean = false;
+ boolean noReeditAllowedBoolean = false;
boolean usernameVisibleBoolean = false;
boolean allowRateQuestionsBoolean = false;
boolean notifyTeachersOnResponseSubmitBoolean = false;
@@ -249,6 +251,11 @@
if (lockWhenFinished != null && lockWhenFinished.equalsIgnoreCase("1")) {
lockWhenFinishedBoolean = true;
}
+
+ if (noReeditAllowed != null && noReeditAllowed.equalsIgnoreCase("1")) {
+ noReeditAllowedBoolean = true;
+ lockWhenFinishedBoolean = true;
+ }
if (usernameVisible != null && usernameVisible.equalsIgnoreCase("1")) {
usernameVisibleBoolean = true;
@@ -310,6 +317,7 @@
qaContent.setShowOtherAnswers(showOtherAnswersBoolean);
qaContent.setQuestionsSequenced(questionsSequencedBoolean);
qaContent.setLockWhenFinished(lockWhenFinishedBoolean);
+ qaContent.setNoReeditAllowed(noReeditAllowedBoolean);
qaContent.setReflect(reflectBoolean);
qaContent.setReflectionSubject(reflectionSubject);
qaContent.setAllowRichEditor(allowRichEditorBoolean);
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java,v
diff -u -r1.63 -r1.64
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 22 May 2015 23:03:21 -0000 1.63
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 20 Jun 2015 20:48:46 -0000 1.64
@@ -176,6 +176,13 @@
forwardName = QaAppConstants.LOAD_LEARNER;
}
}
+
+ //in case noReeditAllowed finalize response so user can't refresh the page and post answers again
+ if (errors.isEmpty() && qaContent.isNoReeditAllowed()) {
+ QaQueUsr qaQueUsr = getCurrentUser(toolSessionID);
+ qaQueUsr.setResponseFinalized(true);
+ QaLearningAction.qaService.updateUser(qaQueUsr);
+ }
generalLearnerFlowDTO.setMapAnswers(mapAnswers);
generalLearnerFlowDTO.setMapAnswersPresentable(mapAnswersPresentable);
@@ -193,6 +200,7 @@
boolean lockWhenFinished = qaContent.isLockWhenFinished();
generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+ generalLearnerFlowDTO.setNoReeditAllowed(qaContent.isNoReeditAllowed());
generalLearnerFlowDTO.setReflection(new Boolean(qaContent.isReflect()).toString());
request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
@@ -366,6 +374,7 @@
boolean lockWhenFinished = qaContent.isLockWhenFinished();
generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+ generalLearnerFlowDTO.setNoReeditAllowed(qaContent.isNoReeditAllowed());
boolean useSelectLeaderToolOuput = qaContent.isUseSelectLeaderToolOuput();
generalLearnerFlowDTO.setUseSelectLeaderToolOuput(new Boolean(useSelectLeaderToolOuput).toString());
@@ -460,6 +469,7 @@
boolean lockWhenFinished = qaContent.isLockWhenFinished();
generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+ generalLearnerFlowDTO.setNoReeditAllowed(qaContent.isNoReeditAllowed());
boolean allowRichEditor = qaContent.isAllowRichEditor();
generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString());
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java,v
diff -u -r1.91 -r1.92
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 22 May 2015 23:03:21 -0000 1.91
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 20 Jun 2015 20:48:46 -0000 1.92
@@ -329,6 +329,7 @@
// the learner is in the same session and has already responsed to this content
generalLearnerFlowDTO.setLockWhenFinished(new Boolean(qaContent.isLockWhenFinished()).toString());
+ generalLearnerFlowDTO.setNoReeditAllowed(qaContent.isNoReeditAllowed());
/*
* the report should have all the users' entries OR the report should have only the current
* session's entries
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java,v
diff -u -r1.85 -r1.86
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 21 May 2015 23:43:12 -0000 1.85
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 20 Jun 2015 20:48:46 -0000 1.86
@@ -179,6 +179,7 @@
qaAuthoringForm.setShowOtherAnswers(qaContent.isShowOtherAnswers() ? "1" : "0");
qaAuthoringForm.setQuestionsSequenced(qaContent.isQuestionsSequenced() ? "1" : "0");
qaAuthoringForm.setLockWhenFinished(qaContent.isLockWhenFinished() ? "1" : "0");
+ qaAuthoringForm.setNoReeditAllowed(qaContent.isNoReeditAllowed() ? "1" : "0");
qaAuthoringForm.setMaximumRates(qaContent.getMaximumRates());
qaAuthoringForm.setMinimumRates(qaContent.getMinimumRates());
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java,v
diff -u -r1.7 -r1.8
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 21 May 2015 23:43:13 -0000 1.7
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 20 Jun 2015 20:48:46 -0000 1.8
@@ -61,6 +61,7 @@
protected String showOtherAnswers;
protected String questionsSequenced;
protected String lockWhenFinished;
+ protected String noReeditAllowed;
protected String reflect;
protected String reflectionSubject;
protected int maximumRates;
@@ -124,6 +125,7 @@
this.monitoringReportTitle = null;
this.questionsSequenced = null;
this.lockWhenFinished = null;
+ this.noReeditAllowed = null;
this.reflect = null;
this.allowRichEditor = false;
this.useSelectLeaderToolOuput = false;
@@ -143,6 +145,7 @@
this.notifyTeachersOnResponseSubmit = OPTION_OFF;
this.questionsSequenced = OPTION_OFF;
this.lockWhenFinished = OPTION_OFF;
+ this.noReeditAllowed = OPTION_OFF;
this.reflect = OPTION_OFF;
this.allowRichEditor = false;
this.required = false;
@@ -725,8 +728,23 @@
public void setLockWhenFinished(String lockWhenFinished) {
this.lockWhenFinished = lockWhenFinished;
}
+
+ /**
+ * @return Returns the noReeditAllowed.
+ */
+ public String getNoReeditAllowed() {
+ return noReeditAllowed;
+ }
/**
+ * @param noReeditAllowed
+ * The noReeditAllowed to set.
+ */
+ public void setNoReeditAllowed(String noReeditAllowed) {
+ this.noReeditAllowed = noReeditAllowed;
+ }
+
+ /**
* @return Returns the showOtherAnswers.
*/
public String getShowOtherAnswers() {
Index: lams_tool_laqa/web/authoring/AdvancedContent.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/AdvancedContent.jsp,v
diff -u -r1.35 -r1.36
--- lams_tool_laqa/web/authoring/AdvancedContent.jsp 21 May 2015 23:43:12 -0000 1.35
+++ lams_tool_laqa/web/authoring/AdvancedContent.jsp 20 Jun 2015 20:48:46 -0000 1.36
@@ -34,14 +34,20 @@
$('#allow-rate-answers').click(function() {
$("#criterias-holder").toggle("slow");
});
+
+ $('#no-reedit-allowed').click(function() {
+ if ($(this).is(':checked')) {
+ $("#lockWhenFinished").prop('checked', true);
+ }
+ $("#lockWhenFinished").prop("disabled", $(this).is(':checked'));
+ });
});
-
+
@@ -119,24 +125,29 @@
-
+
-
+
+
+
+
+
+
-
+
Index: lams_tool_laqa/web/learning/IndividualLearnerResults.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/IndividualLearnerResults.jsp,v
diff -u -r1.43 -r1.44
--- lams_tool_laqa/web/learning/IndividualLearnerResults.jsp 29 Mar 2014 20:02:54 -0000 1.43
+++ lams_tool_laqa/web/learning/IndividualLearnerResults.jsp 20 Jun 2015 20:48:46 -0000 1.44
@@ -41,7 +41,7 @@
-
+
@@ -96,10 +96,12 @@
-
-
-
+
+
+
+
+
-
+
@@ -116,9 +116,11 @@
-
+
+
+