(
new QaStringComparator());
Long mapIndex = new Long(1);
@@ -1080,12 +1080,7 @@
return getQaOutputFactory().getToolOutput(names, this, toolSessionId, learnerId);
}
- /**
- * Get the tool output for the given tool output name.
- *
- * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, java.lang.Long,
- * java.lang.Long)
- */
+ @Override
public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) {
return getQaOutputFactory().getToolOutput(name, this, toolSessionId, learnerId);
}
@@ -1223,6 +1218,7 @@
toolContentObj.setMonitoringReportTitle(null);
// in LAMS 2.0
toolContentObj.setLockWhenFinished(true);
+ toolContentObj.setNoReeditAllowed(false);
toolContentObj.setShowOtherAnswers(true);
toolContentObj.setAllowRateAnswers(false);
toolContentObj.setNotifyTeachersOnResponseSubmit(false);
@@ -1442,6 +1438,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.39.2.2 -r1.39.2.3
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 15 Jun 2015 22:24:55 -0000 1.39.2.2
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 3 Jul 2015 17:01:11 -0000 1.39.2.3
@@ -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.53.2.7 -r1.53.2.8
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 3 Jul 2015 16:43:31 -0000 1.53.2.7
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 3 Jul 2015 17:01:11 -0000 1.53.2.8
@@ -186,6 +186,12 @@
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.setResponseFinalized(true);
+ QaLearningAction.qaService.updateUser(qaQueUsr);
+ }
generalLearnerFlowDTO.setMapAnswers(mapAnswers);
generalLearnerFlowDTO.setMapAnswersPresentable(mapAnswersPresentable);
@@ -203,6 +209,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);
@@ -247,9 +254,15 @@
HttpServletResponse response) throws IOException, ServletException {
initializeQAService();
QaLearningForm qaLearningForm = (QaLearningForm) form;
+ String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+
+ QaQueUsr qaQueUsr = getCurrentUser(toolSessionID);
+ //prohibit users from autosaving answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers)
+ if (qaQueUsr.isResponseFinalized()) {
+ return null;
+ }
LearningUtil.saveFormRequestData(request, qaLearningForm);
- String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
QaSession qaSession = QaLearningAction.qaService.getSessionById(new Long(toolSessionID).longValue());
QaContent qaContent = qaSession.getQaContent();
int intTotalQuestionCount = qaContent.getQaQueContents().size();
@@ -322,6 +335,10 @@
QaQueUsr qaQueUsr = getCurrentUser(toolSessionID);
LearningUtil.populateAnswers(sessionMap, qaContent, qaQueUsr, mapQuestions, generalLearnerFlowDTO,
QaLearningAction.qaService);
+
+ //in order to track whether redo button is pressed store this info
+ qaQueUsr.setResponseFinalized(false);
+ QaLearningAction.qaService.updateUser(qaQueUsr);
request.setAttribute(QaAppConstants.GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
qaLearningForm.resetAll();
@@ -376,6 +393,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());
@@ -470,6 +488,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());
@@ -942,6 +961,7 @@
//handle rating criterias
int commentsMinWordsLimit = 0;
boolean isCommentsEnabled = false;
+ int countRatedQuestions = 0;
if (qaContent.isAllowRateAnswers()) {
// create itemIds list
@@ -971,13 +991,13 @@
response.setItemRatingDto(itemRatingDto);
}
-
+
// store how many items are rated
- int countRatedQuestions = qaService.getCountItemsRatedByUser(qaContent.getQaContentId(), userId.intValue());
- sessionMap.put(AttributeNames.ATTR_COUNT_RATED_ITEMS, countRatedQuestions);
+ countRatedQuestions = qaService.getCountItemsRatedByUser(qaContent.getQaContentId(), userId.intValue());
}
sessionMap.put("commentsMinWordsLimit", commentsMinWordsLimit);
sessionMap.put("isCommentsEnabled", isCommentsEnabled);
+ sessionMap.put(AttributeNames.ATTR_COUNT_RATED_ITEMS, countRatedQuestions);
generalLearnerFlowDTO.setUserResponses(userResponses);
generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).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.86.2.6 -r1.86.2.7
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 3 Jul 2015 16:43:31 -0000 1.86.2.6
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 3 Jul 2015 17:01:11 -0000 1.86.2.7
@@ -330,6 +330,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.83.2.2 -r1.83.2.3
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 15 Jun 2015 22:24:55 -0000 1.83.2.2
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 3 Jul 2015 17:01:11 -0000 1.83.2.3
@@ -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.6.2.1 -r1.6.2.2
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 15 Jun 2015 22:24:56 -0000 1.6.2.1
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 3 Jul 2015 17:01:11 -0000 1.6.2.2
@@ -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.34.2.1 -r1.34.2.2
--- lams_tool_laqa/web/authoring/AdvancedContent.jsp 15 Jun 2015 22:24:55 -0000 1.34.2.1
+++ lams_tool_laqa/web/authoring/AdvancedContent.jsp 3 Jul 2015 17:01:11 -0000 1.34.2.2
@@ -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.43.2.1
--- lams_tool_laqa/web/learning/IndividualLearnerResults.jsp 29 Mar 2014 20:02:54 -0000 1.43
+++ lams_tool_laqa/web/learning/IndividualLearnerResults.jsp 3 Jul 2015 17:01:11 -0000 1.43.2.1
@@ -41,7 +41,7 @@
-
+
@@ -96,10 +96,12 @@
-
-
-
+
+
+
+
+
";
Index: lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp,v
diff -u -r1.32.2.4 -r1.32.2.5
--- lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp 15 Jun 2015 22:24:55 -0000 1.32.2.4
+++ lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp 3 Jul 2015 17:01:11 -0000 1.32.2.5
@@ -39,7 +39,7 @@
COUNT_RATED_ITEMS = ${sessionMap.countRatedItems},
COMMENT_TEXTAREA_TIP_LABEL = '',
WARN_COMMENTS_IS_BLANK_LABEL = '',
- WARN_MIN_NUMBER_WORDS_LABEL = '';
+ WARN_MIN_NUMBER_WORDS_LABEL = "";
Index: lams_tool_laqa/web/learning/mobile/CombinedAnswersContent.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/CombinedAnswersContent.jsp,v
diff -u -r1.2.2.1 -r1.2.2.2
--- lams_tool_laqa/web/learning/mobile/CombinedAnswersContent.jsp 15 Jun 2015 22:24:55 -0000 1.2.2.1
+++ lams_tool_laqa/web/learning/mobile/CombinedAnswersContent.jsp 3 Jul 2015 17:01:11 -0000 1.2.2.2
@@ -12,69 +12,63 @@
-
-
+
+
+
+
-
-
-
-
-
-
- :
-
+
-
+
+
+ :
${questionEntry.value.minWordsLimit}
-
+
-
-
+
+
-
-
-
- class="min-words-limit-enabled"
- >
-
-
-
-
-
+ min-words-limit-enabled"
+ >
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
Index: lams_tool_laqa/web/learning/mobile/IndividualLearnerResults.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/IndividualLearnerResults.jsp,v
diff -u -r1.7 -r1.7.2.1
--- lams_tool_laqa/web/learning/mobile/IndividualLearnerResults.jsp 29 Mar 2014 20:02:55 -0000 1.7
+++ lams_tool_laqa/web/learning/mobile/IndividualLearnerResults.jsp 3 Jul 2015 17:01:11 -0000 1.7.2.1
@@ -65,7 +65,7 @@
-
+
@@ -116,9 +116,11 @@
-
+
+
+
Index: lams_tool_laqa/web/learning/mobile/LearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/LearnerRep.jsp,v
diff -u -r1.10.2.4 -r1.10.2.5
--- lams_tool_laqa/web/learning/mobile/LearnerRep.jsp 15 Jun 2015 22:24:54 -0000 1.10.2.4
+++ lams_tool_laqa/web/learning/mobile/LearnerRep.jsp 3 Jul 2015 17:01:11 -0000 1.10.2.5
@@ -41,7 +41,7 @@
COUNT_RATED_ITEMS = ${sessionMap.countRatedItems},
COMMENT_TEXTAREA_TIP_LABEL = '',
WARN_COMMENTS_IS_BLANK_LABEL = '',
- WARN_MIN_NUMBER_WORDS_LABEL = '';
+ WARN_MIN_NUMBER_WORDS_LABEL = "";
Index: lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp,v
diff -u -r1.11.2.4 -r1.11.2.5
--- lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp 15 Jun 2015 22:24:55 -0000 1.11.2.4
+++ lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp 3 Jul 2015 17:01:11 -0000 1.11.2.5
@@ -42,7 +42,7 @@
COUNT_RATED_ITEMS = ${sessionMap.countRatedItems},
COMMENT_TEXTAREA_TIP_LABEL = '',
WARN_COMMENTS_IS_BLANK_LABEL = '',
- WARN_MIN_NUMBER_WORDS_LABEL = '';
+ WARN_MIN_NUMBER_WORDS_LABEL = "";