Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/AnswerDTO.java
===================================================================
diff -u
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/AnswerDTO.java (revision 0)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/AnswerDTO.java (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -0,0 +1,224 @@
+/***************************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.mc;
+
+import java.util.List;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent;
+
+/**
+ *
+ * DTO that holds question and candidate answers for the learner environment
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class AnswerDTO implements Comparable {
+ protected String question;
+
+ protected String displayOrder;
+
+ protected Long questionUid;
+
+ protected Integer mark;
+
+ protected McOptsContent answerOption;
+
+ protected List options;
+
+ protected boolean attemptCorrect;
+
+ protected String feedbackIncorrect;
+
+ protected String feedbackCorrect;
+
+ protected String feedback;
+
+ /**
+ * @return Returns the answerOption.
+ */
+ public McOptsContent getAnswerOption() {
+ return answerOption;
+ }
+
+ /**
+ * @param answerOption
+ * The answerOption to set.
+ */
+ public void setAnswerOption(McOptsContent answerOption) {
+ this.answerOption = answerOption;
+ }
+
+ /**
+ * @return Returns the options.
+ */
+ public List getOptions() {
+ return options;
+ }
+
+ /**
+ * @param options
+ * The options to set.
+ */
+ public void setOptions(List options) {
+ this.options = options;
+ }
+
+ /**
+ * @return Returns the question.
+ */
+ public String getQuestion() {
+ return question;
+ }
+
+ /**
+ * @param question
+ * The question to set.
+ */
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("question: ", getQuestion()).append("displayOrder: ", getDisplayOrder())
+ .append("answerOption: ", getAnswerOption()).toString();
+ }
+
+ @Override
+ public int compareTo(Object o) {
+ AnswerDTO answerDto = (AnswerDTO) o;
+
+ if (answerDto == null) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * @return Returns the displayOrder.
+ */
+ public String getDisplayOrder() {
+ return displayOrder;
+ }
+
+ /**
+ * @param displayOrder
+ * The displayOrder to set.
+ */
+ public void setDisplayOrder(String displayOrder) {
+ this.displayOrder = displayOrder;
+ }
+
+ /**
+ * @return Returns the questionUid.
+ */
+ public Long getQuestionUid() {
+ return questionUid;
+ }
+
+ /**
+ * @param questionUid
+ * The questionUid to set.
+ */
+ public void setQuestionUid(Long questionUid) {
+ this.questionUid = questionUid;
+ }
+
+ /**
+ * @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 attemptCorrect.
+ */
+ public boolean isAttemptCorrect() {
+ return attemptCorrect;
+ }
+
+ /**
+ * @param attemptCorrect
+ * The attemptCorrect to set.
+ */
+ public void setAttemptCorrect(boolean attemptCorrect) {
+ this.attemptCorrect = attemptCorrect;
+ }
+
+ /**
+ * @return Returns the feedbackIncorrect.
+ */
+ public String getFeedbackIncorrect() {
+ return feedbackIncorrect;
+ }
+
+ /**
+ * @param feedbackIncorrect
+ * The feedbackIncorrect to set.
+ */
+ public void setFeedbackIncorrect(String feedbackIncorrect) {
+ this.feedbackIncorrect = feedbackIncorrect;
+ }
+
+ /**
+ * @return Returns the mark.
+ */
+ public Integer getMark() {
+ return mark;
+ }
+
+ /**
+ * @param mark
+ * The mark to set.
+ */
+ public void setMark(Integer mark) {
+ this.mark = mark;
+ }
+
+ /**
+ * @return Returns the feedback.
+ */
+ public String getFeedback() {
+ return feedback;
+ }
+
+ /**
+ * @param feedback
+ * The feedback to set.
+ */
+ public void setFeedback(String feedback) {
+ this.feedback = feedback;
+ }
+}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java
===================================================================
diff -u -r8a907fb13d71011aa7faf97c4a4ca8aedda0a00b -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 8a907fb13d71011aa7faf97c4a4ca8aedda0a00b)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -210,7 +210,7 @@
public static final String MAP_QUESTION_CONTENT_LEARNER = "mapQuestionContentLearner";
public static final String LEARNER_ANSWERS_DTO_LIST = "learnerAnswersDTOList";
public static final String MC_GENERAL_LEARNER_FLOW_DTO = "mcGeneralLearnerFlowDTO";
- public static final String LIST_SELECTED_QUESTION_CANDIDATEANSWERS_DTO = "listSelectedQuestionCandidateAnswersDto";
+ public static final String ANSWER_DTOS = "answerDtos";
public static final String CURRENT_QUESTION_INDEX = "currentQuestionIndex";
public static final String TOTAL_QUESTION_COUNT = "totalQuestionCount";
public static final String HR_COLUMN_COUNT = "hrColumnCount";
@@ -223,7 +223,6 @@
public static final String NOTEBOOK = "notebook";
public static final String ENTRY_TEXT = "entryText";
- public static final String MC_LEARNER_STARTER_DTO = "mcLearnerStarterDTO";
public static final String IS_USERNAME_VISIBLE = "isUsernameVisible";
public static final String IS_CONTENT_IN_USE = "isContentInUse";
public static final String IS_MONITORED_CONTENT_IN_USE = "isMonitoredContentInUse";
@@ -267,9 +266,6 @@
public static final String SESSION_DTOS = "sessionDtos";
public static final String TIMEZONE = "timeZone";
- public static final String QUESTION_LISTING_MODE = "questionListingMode";
- public static final String QUESTION_LISTING_MODE_SEQUENTIAL = "questionListingModeSequential";
- public static final String QUESTION_LISTING_MODE_COMBINED = "questionListingModeCombined";
public static final String PREVIEW_ONLY = "previewOnly";
public static final String MODE = "mode";
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java
===================================================================
diff -u -r26ea61eae29934bddf4595c3c1aededeeeaca933 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java (.../McGeneralLearnerFlowDTO.java) (revision 26ea61eae29934bddf4595c3c1aededeeeaca933)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralLearnerFlowDTO.java (.../McGeneralLearnerFlowDTO.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -95,8 +95,6 @@
protected Integer questionIndex;
- protected String questionListingMode;
-
protected Integer totalMarksPossible;
protected Map mapFeedbackContent;
@@ -119,21 +117,6 @@
}
/**
- * @return Returns the questionListingMode.
- */
- public String getQuestionListingMode() {
- return questionListingMode;
- }
-
- /**
- * @param questionListingMode
- * The questionListingMode to set.
- */
- public void setQuestionListingMode(String questionListingMode) {
- this.questionListingMode = questionListingMode;
- }
-
- /**
* @return Returns the questionIndex.
*/
public Integer getQuestionIndex() {
@@ -392,10 +375,10 @@
.append("passMarkApplicable: ", passMarkApplicable).append("userPassed: ", userPassed)
.append("userOverPassMark: ", userOverPassMark).append("reportTitleLearner: ", reportTitleLearner)
.append("activityInstructions: ", activityInstructions).append("activityTitle: ", activityTitle)
- .append("questionListingMode: ", questionListingMode).append("learnerProgress: ", learnerProgress)
- .append("displayAnswers: ", displayAnswers).append("reflection: ", reflection)
- .append("reflectionSubject: ", reflectionSubject).append("notebookEntry: ", notebookEntry)
- .append("notebookEntriesVisible: ", notebookEntriesVisible).toString();
+ .append("learnerProgress: ", learnerProgress).append("displayAnswers: ", displayAnswers)
+ .append("reflection: ", reflection).append("reflectionSubject: ", reflectionSubject)
+ .append("notebookEntry: ", notebookEntry).append("notebookEntriesVisible: ", notebookEntriesVisible)
+ .toString();
}
/**
Fisheye: Tag c50fe13d18f2af436354f5a9ececd048a9ec752d refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerAnswersDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c50fe13d18f2af436354f5a9ececd048a9ec752d refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerStarterDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c50fe13d18f2af436354f5a9ececd048a9ec752d refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McTempDataHolderDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java
===================================================================
diff -u -r26ea61eae29934bddf4595c3c1aededeeeaca933 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 26ea61eae29934bddf4595c3c1aededeeeaca933)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -159,9 +159,6 @@
request.getSession().removeAttribute(EDITACTIVITY_EDITMODE);
request.getSession().removeAttribute(FORM_INDEX);
request.getSession().removeAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO);
- request.getSession().removeAttribute(QUESTION_LISTING_MODE);
- request.getSession().removeAttribute(QUESTION_LISTING_MODE_SEQUENTIAL);
- request.getSession().removeAttribute(QUESTION_LISTING_MODE_COMBINED);
request.getSession().removeAttribute(PREVIEW_ONLY);
request.getSession().removeAttribute(TIMEZONE);
request.getSession().removeAttribute(MODE);
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java
===================================================================
diff -u -rec160e8c6dc2160cae9be746014c90a1239b5e0b -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision ec160e8c6dc2160cae9be746014c90a1239b5e0b)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -32,7 +32,7 @@
import org.lamsfoundation.lams.tool.exception.DataMissingException;
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.mc.McApplicationException;
-import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO;
+import org.lamsfoundation.lams.tool.mc.AnswerDTO;
import org.lamsfoundation.lams.tool.mc.McOptionDTO;
import org.lamsfoundation.lams.tool.mc.McQuestionDTO;
import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO;
@@ -85,7 +85,7 @@
McQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionUid) throws McApplicationException;
- void saveUserAttempt(McQueUsr user, List selectedQuestionAndCandidateAnswersDTO);
+ void saveUserAttempt(McQueUsr user, List answerDtos);
void updateMcUsrAttempt(McUsrAttempt mcUsrAttempt) throws McApplicationException;
@@ -193,7 +193,7 @@
* user; pass null if there is no need to populate previous answers
* @return
*/
- List buildLearnerAnswersDTOList(McContent mcContent, McQueUsr user);
+ List getAnswersFromDatabase(McContent mcContent, McQueUsr user);
/**
* Returns userMarksDtos grouped by sessions. Used *only* for export portfolio.
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java
===================================================================
diff -u -rec160e8c6dc2160cae9be746014c90a1239b5e0b -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision ec160e8c6dc2160cae9be746014c90a1239b5e0b)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -83,7 +83,7 @@
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.mc.McAppConstants;
import org.lamsfoundation.lams.tool.mc.McApplicationException;
-import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO;
+import org.lamsfoundation.lams.tool.mc.AnswerDTO;
import org.lamsfoundation.lams.tool.mc.McOptionDTO;
import org.lamsfoundation.lams.tool.mc.McQuestionDTO;
import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO;
@@ -444,25 +444,25 @@
}
@Override
- public void saveUserAttempt(McQueUsr user, List selectedQuestionAndCandidateAnswersDTO) {
+ public void saveUserAttempt(McQueUsr user, List answerDtos) {
Date attemptTime = new Date(System.currentTimeMillis());
- for (McLearnerAnswersDTO mcLearnerAnswersDTO : selectedQuestionAndCandidateAnswersDTO) {
+ for (AnswerDTO answerDto : answerDtos) {
- Long questionUid = mcLearnerAnswersDTO.getQuestionUid();
+ Long questionUid = answerDto.getQuestionUid();
McQueContent question = this.getQuestionByUid(questionUid);
if (question == null) {
throw new McApplicationException(
- "Can't find question with specified question uid: " + mcLearnerAnswersDTO.getQuestionUid());
+ "Can't find question with specified question uid: " + answerDto.getQuestionUid());
}
- McOptsContent answerOption = mcLearnerAnswersDTO.getAnswerOption();
+ McOptsContent answerOption = answerDto.getAnswerOption();
if (answerOption != null) {
- Integer mark = mcLearnerAnswersDTO.getMark();
+ Integer mark = answerDto.getMark();
boolean passed = user.isMarkPassed(mark);
- boolean isAttemptCorrect = new Boolean(mcLearnerAnswersDTO.getAttemptCorrect());
+ boolean isAttemptCorrect = answerDto.isAttemptCorrect();
McUsrAttempt userAttempt = this.getUserAttemptByQuestion(user.getUid(), questionUid);
if (userAttempt != null) {
@@ -486,7 +486,6 @@
// create new userAttempt
userAttempt = new McUsrAttempt(attemptTime, question, user, answerOption, mark, passed,
isAttemptCorrect);
-
}
mcUsrAttemptDAO.saveMcUsrAttempt(userAttempt);
@@ -506,12 +505,12 @@
}
@Override
- public List buildLearnerAnswersDTOList(McContent mcContent, McQueUsr user) {
- List learnerAnswersDTOList = new LinkedList();
+ public List getAnswersFromDatabase(McContent mcContent, McQueUsr user) {
+ List answerDtos = new LinkedList();
List questions = this.getQuestionsByContentUid(mcContent.getUid());
for (McQueContent question : questions) {
- McLearnerAnswersDTO learnerAnswersDTO = new McLearnerAnswersDTO();
+ AnswerDTO answerDto = new AnswerDTO();
Set optionSet = question.getMcOptionsContents();
List optionList = new LinkedList(optionSet);
@@ -522,28 +521,28 @@
optionList = new LinkedList(shuffledList);
}
- learnerAnswersDTO.setQuestion(question.getQuestion());
- learnerAnswersDTO.setDisplayOrder(question.getDisplayOrder().toString());
- learnerAnswersDTO.setQuestionUid(question.getUid());
+ answerDto.setQuestion(question.getQuestion());
+ answerDto.setDisplayOrder(question.getDisplayOrder().toString());
+ answerDto.setQuestionUid(question.getUid());
- learnerAnswersDTO.setMark(question.getMark());
- learnerAnswersDTO.setOptions(optionList);
+ answerDto.setMark(question.getMark());
+ answerDto.setOptions(optionList);
- learnerAnswersDTOList.add(learnerAnswersDTO);
+ answerDtos.add(answerDto);
}
// populate answers
if (user != null) {
- for (McLearnerAnswersDTO learnerAnswersDTO : learnerAnswersDTOList) {
- Long questionUid = learnerAnswersDTO.getQuestionUid();
+ for (AnswerDTO answerDto : answerDtos) {
+ Long questionUid = answerDto.getQuestionUid();
McUsrAttempt dbAttempt = this.getUserAttemptByQuestion(user.getUid(), questionUid);
if (dbAttempt != null) {
Long selectedOptionUid = dbAttempt.getMcOptionsContent().getUid();
// mark selected option as selected
- for (McOptsContent option : learnerAnswersDTO.getOptions()) {
+ for (McOptsContent option : answerDto.getOptions()) {
if (selectedOptionUid.equals(option.getUid())) {
option.setSelected(true);
}
@@ -552,7 +551,7 @@
}
}
- return learnerAnswersDTOList;
+ return answerDtos;
}
@Override
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java
===================================================================
diff -u -r7c19f4b889eb8c768d97d756f6ce428283136f19 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 7c19f4b889eb8c768d97d756f6ce428283136f19)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -30,7 +30,7 @@
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.tool.mc.McAppConstants;
import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO;
-import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO;
+import org.lamsfoundation.lams.tool.mc.AnswerDTO;
import org.lamsfoundation.lams.tool.mc.pojos.McContent;
/**
@@ -63,11 +63,7 @@
mcLearningForm.setLearnerProgress(learnerProgress);
String learnerProgressUserId = request.getParameter("learnerProgressUserId");
mcLearningForm.setLearnerProgressUserId(learnerProgressUserId);
-
}
-
- String questionListingMode = request.getParameter("questionListingMode");
- mcLearningForm.setQuestionListingMode(questionListingMode);
}
/**
@@ -82,23 +78,17 @@
mcGeneralLearnerFlowDTO.setReportTitleLearner("Report");
mcGeneralLearnerFlowDTO.setLearnerProgress(new Boolean(false).toString());
- if (mcContent.isQuestionsSequenced()) {
- mcGeneralLearnerFlowDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL);
- } else {
- mcGeneralLearnerFlowDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_COMBINED);
- }
-
mcGeneralLearnerFlowDTO.setTotalQuestionCount(new Integer(mcContent.getMcQueContents().size()));
return mcGeneralLearnerFlowDTO;
}
/**
* Should we show the marks for each question - we show the marks if any of the questions have a mark > 1.
*/
- public static Boolean isShowMarksOnQuestion(List listQuestionAndCandidateAnswersDTO) {
+ public static Boolean isShowMarksOnQuestion(List listQuestionAndCandidateAnswersDTO) {
Iterator iter = listQuestionAndCandidateAnswersDTO.iterator();
while (iter.hasNext()) {
- McLearnerAnswersDTO elem = (McLearnerAnswersDTO) iter.next();
+ AnswerDTO elem = (AnswerDTO) iter.next();
if (elem.getMark().intValue() > 1) {
return Boolean.TRUE;
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java
===================================================================
diff -u -r7c19f4b889eb8c768d97d756f6ce428283136f19 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 7c19f4b889eb8c768d97d756f6ce428283136f19)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -29,7 +29,6 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
-import java.util.regex.Pattern;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -40,19 +39,17 @@
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionRedirect;
import org.apache.tomcat.util.json.JSONException;
import org.apache.tomcat.util.json.JSONObject;
import org.lamsfoundation.lams.learning.web.util.LearningWebUtil;
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
import org.lamsfoundation.lams.tool.exception.DataMissingException;
import org.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.mc.AnswerDTO;
import org.lamsfoundation.lams.tool.mc.McAppConstants;
import org.lamsfoundation.lams.tool.mc.McComparator;
import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO;
-import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO;
-import org.lamsfoundation.lams.tool.mc.McTempDataHolderDTO;
import org.lamsfoundation.lams.tool.mc.McUtils;
import org.lamsfoundation.lams.tool.mc.pojos.McContent;
import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent;
@@ -68,10 +65,7 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
-import org.springframework.dao.DataIntegrityViolationException;
-import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException;
-
/**
* @author Ozgur Demirtas
*/
@@ -177,23 +171,15 @@
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
// requested learner finished, the learner should be directed to next activity
- String userID = "";
HttpSession ss = SessionManager.getSession();
+ UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
- if (ss != null) {
- UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
- if (user != null && user.getUserID() != null) {
- userID = user.getUserID().toString();
- }
- }
-
// attempting to leave/complete session with toolSessionId:
-
McUtils.cleanUpSessionAbsolute(request);
String nextUrl = null;
try {
- nextUrl = mcService.leaveToolSession(new Long(toolSessionID), new Long(userID));
+ nextUrl = mcService.leaveToolSession(new Long(toolSessionID), userDto.getUserID().longValue());
} catch (DataMissingException e) {
McLearningAction.logger.error("failure getting nextUrl: " + e);
return mapping.findForward(McAppConstants.LEARNING_STARTER);
@@ -213,58 +199,49 @@
/**
*
*/
- protected List buildSelectedQuestionAndCandidateAnswersDTO(List learnerInput,
- McTempDataHolderDTO mcTempDataHolderDTO, McContent content) {
+ protected List buildAnswerDtos(List answers, McContent content) {
- int learnerMark = 0;
- int totalMarksPossible = 0;
+ List answerDtos = new LinkedList();
- List questionAndCandidateAnswersList = new LinkedList();
-
for (McQueContent question : (Set) content.getMcQueContents()) {
String questionUid = question.getUid().toString();
- int currentMark = question.getMark().intValue();
- totalMarksPossible += currentMark;
+ int questionMark = question.getMark().intValue();
- McLearnerAnswersDTO mcLearnerAnswersDTO = new McLearnerAnswersDTO();
- mcLearnerAnswersDTO.setQuestion(question.getQuestion());
- mcLearnerAnswersDTO.setDisplayOrder(question.getDisplayOrder().toString());
- mcLearnerAnswersDTO.setQuestionUid(question.getUid());
- mcLearnerAnswersDTO.setFeedback(question.getFeedback() != null ? question.getFeedback() : "");
+ AnswerDTO answerDto = new AnswerDTO();
+ answerDto.setQuestion(question.getQuestion());
+ answerDto.setDisplayOrder(question.getDisplayOrder().toString());
+ answerDto.setQuestionUid(question.getUid());
+ answerDto.setFeedback(question.getFeedback() != null ? question.getFeedback() : "");
//search for according answer
McOptsContent answerOption = null;
- for (String input : learnerInput) {
- int pos = input.indexOf("-");
- String inputQuestionUid = input.substring(0, pos);
+ for (String answer : answers) {
+ int hyphenPosition = answer.indexOf("-");
+ String answeredQuestionUid = answer.substring(0, hyphenPosition);
- if (questionUid.equals(inputQuestionUid)) {
- String answerOptionUid = input.substring(pos + 1);
- answerOption = question.getOptionsContentByUID(new Long(answerOptionUid));
- mcLearnerAnswersDTO.setAnswerOption(answerOption);
+ if (questionUid.equals(answeredQuestionUid)) {
+ String answeredOptionUid = answer.substring(hyphenPosition + 1);
+ answerOption = question.getOptionsContentByUID(new Long(answeredOptionUid));
+ answerDto.setAnswerOption(answerOption);
break;
}
}
boolean isCorrect = (answerOption != null) && answerOption.isCorrectOption();
- mcLearnerAnswersDTO.setAttemptCorrect(new Boolean(isCorrect).toString());
+ answerDto.setAttemptCorrect(isCorrect);
if (isCorrect) {
- mcLearnerAnswersDTO.setFeedbackCorrect(question.getFeedback());
- mcLearnerAnswersDTO.setMark(new Integer(currentMark));
- learnerMark += currentMark;
+ answerDto.setFeedbackCorrect(question.getFeedback());
+ answerDto.setMark(questionMark);
} else {
- mcLearnerAnswersDTO.setFeedbackIncorrect(question.getFeedback());
- mcLearnerAnswersDTO.setMark(new Integer(0));
+ answerDto.setFeedbackIncorrect(question.getFeedback());
+ answerDto.setMark(0);
}
- questionAndCandidateAnswersList.add(mcLearnerAnswersDTO);
+ answerDtos.add(answerDto);
}
- mcTempDataHolderDTO.setLearnerMark(new Integer(learnerMark));
- mcTempDataHolderDTO.setTotalMarksPossible(new Integer(totalMarksPossible));
-
- return questionAndCandidateAnswersList;
+ return answerDtos;
}
/**
@@ -279,57 +256,48 @@
String httpSessionID = mcLearningForm.getHttpSessionID();
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
+ request.getSession().setAttribute(httpSessionID, sessionMap);
+
+ String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+ McSession session = mcService.getMcSessionById(new Long(toolSessionID));
+ String toolContentId = session.getMcContent().getMcContentId().toString();
+ McContent mcContent = mcService.getMcContent(new Long(toolContentId));
- String questionListingMode = mcLearningForm.getQuestionListingMode();
-
- List learnerInput = McLearningAction.parseLearnerAnswers(mcLearningForm, request);
-
- if (questionListingMode.equals(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL)) {
- sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, learnerInput);
+ List answers = McLearningAction.parseLearnerAnswers(mcLearningForm, request, mcContent.isQuestionsSequenced());
+ if (mcContent.isQuestionsSequenced()) {
+ sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, answers);
}
mcLearningForm.resetCa(mapping, request);
- String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McSession mcSession = mcService.getMcSessionById(new Long(toolSessionID));
- String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- /* process the answers */
- McContent mcContent = mcService.getMcContent(new Long(toolContentId));
+ McQueUsr user = getCurrentUser(toolSessionID);
- McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
-
- McTempDataHolderDTO mcTempDataHolderDTO = new McTempDataHolderDTO();
- List selectedQuestionAndCandidateAnswersDTO = buildSelectedQuestionAndCandidateAnswersDTO(
- learnerInput, mcTempDataHolderDTO, mcContent);
- request.setAttribute(McAppConstants.LIST_SELECTED_QUESTION_CANDIDATEANSWERS_DTO,
- selectedQuestionAndCandidateAnswersDTO);
-
- mcGeneralLearnerFlowDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_COMBINED);
-
- Integer learnerMark = mcTempDataHolderDTO.getLearnerMark();
- mcGeneralLearnerFlowDTO.setLearnerMark(learnerMark);
- int totalQuestionCount = mcContent.getMcQueContents().size();
- mcGeneralLearnerFlowDTO.setTotalQuestionCount(new Integer(totalQuestionCount));
- mcGeneralLearnerFlowDTO.setTotalMarksPossible(mcTempDataHolderDTO.getTotalMarksPossible());
-
- request.getSession().setAttribute(httpSessionID, sessionMap);
-
- HttpSession ss = SessionManager.getSession();
- UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
- String userID = userDto.getUserID().toString();
- McQueUsr user = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
-
//prohibit users from submitting answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers)
if (user.isResponseFinalised()) {
return viewAnswers(mapping, mcLearningForm, request, response);
}
+ /* process the answers */
+ List answerDtos = buildAnswerDtos(answers, mcContent);
+ mcService.saveUserAttempt(user, answerDtos);
+ request.setAttribute(McAppConstants.ANSWER_DTOS, answerDtos);
+
+ //calculate total learner mark
+ int learnerMark = 0;
+ for (AnswerDTO answerDto : answerDtos) {
+ learnerMark += answerDto.getMark();
+ }
+
+ McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
+ mcGeneralLearnerFlowDTO.setLearnerMark(learnerMark);
+ mcGeneralLearnerFlowDTO.setTotalQuestionCount(mcContent.getMcQueContents().size());
+ mcGeneralLearnerFlowDTO.setTotalMarksPossible(mcContent.getTotalMarksPossible());
+
// Have to work out in advance if passed so that we can store it against the attempts
boolean passed = user.isMarkPassed(learnerMark);
mcGeneralLearnerFlowDTO.setUserOverPassMark(new Boolean(passed).toString());
mcGeneralLearnerFlowDTO.setPassMarkApplicable(new Boolean(mcContent.getPassMark() != null).toString());
- McLearningAction.saveUserAttempt(user, selectedQuestionAndCandidateAnswersDTO);
Integer numberOfAttempts = user.getNumberOfAttempts() + 1;
user.setNumberOfAttempts(numberOfAttempts);
@@ -341,7 +309,7 @@
mcGeneralLearnerFlowDTO.setShowMarks(new Boolean(mcContent.isShowMarks()).toString());
if (mcContent.isShowMarks()) {
- Integer[] markStatistics = mcService.getMarkStatistics(mcSession);
+ Integer[] markStatistics = mcService.getMarkStatistics(session);
mcGeneralLearnerFlowDTO.setTopMark(markStatistics[0]);
mcGeneralLearnerFlowDTO.setLowestMark(markStatistics[1]);
mcGeneralLearnerFlowDTO.setAverageMark(markStatistics[2]);
@@ -382,10 +350,7 @@
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
McContent mcContent = mcService.getMcContent(new Long(toolContentId));
- HttpSession ss = SessionManager.getSession();
- UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
- String userID = userDto.getUserID().toString();
- McQueUsr user = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
+ McQueUsr user = getCurrentUser(toolSessionID);
String httpSessionID = mcLearningForm.getHttpSessionID();
SessionMap sessionMap = (SessionMap) request.getSession()
@@ -397,16 +362,14 @@
}
//parse learner input
- List learnerInput = McLearningAction.parseLearnerAnswers(mcLearningForm, request);
- sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, learnerInput);
+ List answers = McLearningAction.parseLearnerAnswers(mcLearningForm, request, mcContent.isQuestionsSequenced());
+ sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, answers);
//save user attempt
- List selectedQuestionAndCandidateAnswersDTO = buildSelectedQuestionAndCandidateAnswersDTO(
- learnerInput, new McTempDataHolderDTO(), mcContent);
- McLearningAction.saveUserAttempt(user, selectedQuestionAndCandidateAnswersDTO);
-
- McQueUsr mcQueUsr = getCurrentUser(toolSessionID);
- List learnerAnswersDTOList = mcService.buildLearnerAnswersDTOList(mcContent, mcQueUsr);
+ List answerDtos = buildAnswerDtos(answers, mcContent);
+ mcService.saveUserAttempt(user, answerDtos);
+
+ List learnerAnswersDTOList = mcService.getAnswersFromDatabase(mcContent, user);
request.setAttribute(McAppConstants.LEARNER_ANSWERS_DTO_LIST, learnerAnswersDTOList);
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
@@ -419,14 +382,9 @@
}
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
-
- // String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(mcContent.getReflectionSubject());
-
mcGeneralLearnerFlowDTO.setRetries(new Boolean(mcContent.isRetries()).toString());
-
mcGeneralLearnerFlowDTO.setTotalMarksPossible(mcContent.getTotalMarksPossible());
-
mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(questionIndex));
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
@@ -562,9 +520,7 @@
}
}
mcGeneralLearnerFlowDTO.setAttemptMap(attemptMap);
-
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
- // String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(mcContent.getReflectionSubject());
NotebookEntry notebookEntry = mcService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL,
@@ -623,17 +579,13 @@
List sequentialCheckedCa = new LinkedList();
sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, sequentialCheckedCa);
- List learnerAnswersDTOList = mcService.buildLearnerAnswersDTOList(mcContent, mcQueUsr);
+ List learnerAnswersDTOList = mcService.getAnswersFromDatabase(mcContent, mcQueUsr);
request.setAttribute(McAppConstants.LEARNER_ANSWERS_DTO_LIST, learnerAnswersDTOList);
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(1));
-
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
-
- //String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(mcContent.getReflectionSubject());
-
mcGeneralLearnerFlowDTO.setRetries(new Boolean(mcContent.isRetries()).toString());
String passMarkApplicable = new Boolean(mcContent.isPassMarkApplicable()).toString();
@@ -794,63 +746,32 @@
return null;
}
- List learnerInput = McLearningAction.parseLearnerAnswers(mcLearningForm, request);
+ List answers = McLearningAction.parseLearnerAnswers(mcLearningForm, request, mcContent.isQuestionsSequenced());
- List selectedQuestionAndCandidateAnswersDTO = buildSelectedQuestionAndCandidateAnswersDTO(
- learnerInput, new McTempDataHolderDTO(), mcContent);
- McLearningAction.saveUserAttempt(user, selectedQuestionAndCandidateAnswersDTO);
+ List answerDtos = buildAnswerDtos(answers, mcContent);
+ mcService.saveUserAttempt(user, answerDtos);
return null;
}
- /**
- * Makes a call to mcService.saveUserAttempt(). This method is designed purely for exception handling purposes. It
- * needs to be performed inside Action class as otherwise Hibernate tries to flush the session which leads to
- * another exception.
- */
- private static void saveUserAttempt(McQueUsr user,
- List selectedQuestionAndCandidateAnswersDTO) {
- try {
- mcService.saveUserAttempt(user, selectedQuestionAndCandidateAnswersDTO);
-
- } catch (DataIntegrityViolationException e) {
-
- // log DB exceptions occurred due to creating non-unique McUsrAttempt. And propagate all the other exceptions
- if (e.getRootCause() instanceof MySQLIntegrityConstraintViolationException) {
- String rootCauseMessage = e.getRootCause().getMessage();
-
- Pattern pattern = Pattern.compile("Duplicate entry.*attempt_unique_index");
- if ((rootCauseMessage != null) && pattern.matcher(rootCauseMessage).find()) {
- logger.error("Prevented creation of McUsrAttempt which was not unique for user and question: "
- + rootCauseMessage);
- return;
- }
- }
-
- throw e;
- }
- }
-
- private static List parseLearnerAnswers(McLearningForm mcLearningForm, HttpServletRequest request) {
+ private static List parseLearnerAnswers(McLearningForm mcLearningForm, HttpServletRequest request, boolean isQuestionsSequenced) {
String httpSessionID = mcLearningForm.getHttpSessionID();
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- String questionListingMode = mcLearningForm.getQuestionListingMode();
+ List answers = new LinkedList();
+ if (isQuestionsSequenced) {
- List learnerInput = new LinkedList();
- if (questionListingMode.equals(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL)) {
-
- List previousLearnerInput = (List) sessionMap
+ List previousAnswers = (List) sessionMap
.get(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY);
- learnerInput.addAll(previousLearnerInput);
+ answers.addAll(previousAnswers);
/* checkedCa refers to candidate answers */
String[] checkedCa = mcLearningForm.getCheckedCa();
if (checkedCa != null) {
for (int i = 0; i < checkedCa.length; i++) {
String currentCa = checkedCa[i];
- learnerInput.add(currentCa);
+ answers.add(currentCa);
}
}
@@ -862,13 +783,13 @@
if (key.startsWith("checkedCa")) {
String currentCheckedCa = request.getParameter(key);
if (currentCheckedCa != null) {
- learnerInput.add(currentCheckedCa);
+ answers.add(currentCheckedCa);
}
}
}
}
- return learnerInput;
+ return answers;
}
private McQueUsr getCurrentUser(String toolSessionId) {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java
===================================================================
diff -u -r7c19f4b889eb8c768d97d756f6ce428283136f19 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision 7c19f4b889eb8c768d97d756f6ce428283136f19)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java (.../McLearningForm.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -63,8 +63,6 @@
protected String learnerProgress;
protected String learnerProgressUserId;
- protected String questionListingMode;
-
protected String entryText;
protected String questionIndex;
@@ -366,21 +364,6 @@
}
/**
- * @return Returns the questionListingMode.
- */
- public String getQuestionListingMode() {
- return questionListingMode;
- }
-
- /**
- * @param questionListingMode
- * The questionListingMode to set.
- */
- public void setQuestionListingMode(String questionListingMode) {
- this.questionListingMode = questionListingMode;
- }
-
- /**
* @return Returns the toolContentID.
*/
public String getToolContentID() {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java
===================================================================
diff -u -r7c19f4b889eb8c768d97d756f6ce428283136f19 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 7c19f4b889eb8c768d97d756f6ce428283136f19)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -46,11 +46,10 @@
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
import org.lamsfoundation.lams.tool.ToolAccessMode;
+import org.lamsfoundation.lams.tool.mc.AnswerDTO;
import org.lamsfoundation.lams.tool.mc.McAppConstants;
import org.lamsfoundation.lams.tool.mc.McApplicationException;
import org.lamsfoundation.lams.tool.mc.McGeneralLearnerFlowDTO;
-import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO;
-import org.lamsfoundation.lams.tool.mc.McLearnerStarterDTO;
import org.lamsfoundation.lams.tool.mc.McUtils;
import org.lamsfoundation.lams.tool.mc.pojos.McContent;
import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr;
@@ -123,19 +122,6 @@
return (mapping.findForward(McAppConstants.ERROR_LIST));
}
- /*
- * The content we retrieved above must have been created before in Authoring time. And the passed tool session
- * id already refers to it.
- */
- McLearnerStarterDTO mcLearnerStarterDTO = new McLearnerStarterDTO();
- if (mcContent.isQuestionsSequenced()) {
- mcLearnerStarterDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL);
- mcLearningForm.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL);
- } else {
- mcLearnerStarterDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_COMBINED);
- mcLearningForm.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_COMBINED);
- }
-
String mode = request.getParameter(McAppConstants.MODE);
McQueUsr user = null;
if ((mode != null) && mode.equals(ToolAccessMode.TEACHER.toString())) {
@@ -159,17 +145,14 @@
TimeZone learnerTimeZone = learnerDto.getTimeZone();
Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline);
Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date());
- mcLearnerStarterDTO.setSubmissionDeadline(submissionDeadline);
+ request.setAttribute("submissionDeadline", submissionDeadline);
// calculate whether submission deadline has passed, and if so forward to "submissionDeadline"
if (currentLearnerDate.after(tzSubmissionDeadline)) {
- request.setAttribute(McAppConstants.MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO);
return mapping.findForward("submissionDeadline");
}
}
- mcLearnerStarterDTO.setActivityTitle(mcContent.getTitle());
- request.setAttribute(McAppConstants.MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO);
mcLearningForm.setToolContentID(mcContent.getMcContentId().toString());
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
@@ -191,7 +174,7 @@
}
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- List learnerAnswersDTOList = mcService.buildLearnerAnswersDTOList(mcContent, user);
+ List learnerAnswersDTOList = mcService.getAnswersFromDatabase(mcContent, user);
request.setAttribute(McAppConstants.LEARNER_ANSWERS_DTO_LIST, learnerAnswersDTOList);
// should we show the marks for each question - we show the marks if any of the questions
// have a mark > 1.
@@ -250,7 +233,6 @@
return redirect;
}
- request.setAttribute(McAppConstants.MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO);
return (mapping.findForward(McAppConstants.LOAD_LEARNER));
}
Index: lams_tool_lamc/web/learning/AnswersContent.jsp
===================================================================
diff -u -r65a83a957c6c1160566e3e9d11a9c9a4d6e704f6 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision 65a83a957c6c1160566e3e9d11a9c9a4d6e704f6)
+++ lams_tool_lamc/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -36,7 +36,7 @@
//autoSaveAnswers if hasEditRight
if (${hasEditRight}) {
- var interval = "30000"; // = 30 seconds
+ var interval = "300000"; // = 30 seconds
window.setInterval(
function(){
//ajax form submit
@@ -73,7 +73,7 @@
function verifyAllQuestionsAnswered() {
// in case oneQuestionPerPage option is ON user has to select 1 answer, and all answers otherwise
- var isOneQuestionPerPage = ${mcGeneralLearnerFlowDTO.questionListingMode == 'questionListingModeSequential'};
+ var isOneQuestionPerPage = ${sessionMap.content.questionsSequenced};
var answersRequiredNumber = (isOneQuestionPerPage) ? 1 : ${fn:length(requestScope.learnerAnswersDTOList)};
//check each question is answered
@@ -133,8 +133,7 @@
-
-
+
<%@ include file="/common/messages.jsp"%>
@@ -147,7 +146,7 @@
-
+
Index: lams_tool_lamc/web/learning/CombinedAnswersContent.jsp
===================================================================
diff -u -r816baa75867795676ea15c9dfcc4feef712edc47 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 816baa75867795676ea15c9dfcc4feef712edc47)
+++ lams_tool_lamc/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -13,10 +13,10 @@
-
+
-
+
Index: lams_tool_lamc/web/learning/IndividualLearnerResults.jsp
===================================================================
diff -u -r4d139bddc3cdd41d32d9f3033f2100c711d8c0c5 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision 4d139bddc3cdd41d32d9f3033f2100c711d8c0c5)
+++ lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -46,7 +46,6 @@
-
@@ -94,7 +93,7 @@
-
+
@@ -117,12 +116,14 @@
-
-
images/tick.gif" border="0" class="middle">
-
-
-
images/cross.gif" border="0" class="middle">
-
+
+
+
images/tick.gif" border="0" class="middle">
+
+
+
images/cross.gif" border="0" class="middle">
+
+
Index: lams_tool_lamc/web/learning/SingleQuestionAnswersContent.jsp
===================================================================
diff -u -r4d139bddc3cdd41d32d9f3033f2100c711d8c0c5 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/SingleQuestionAnswersContent.jsp (.../SingleQuestionAnswersContent.jsp) (revision 4d139bddc3cdd41d32d9f3033f2100c711d8c0c5)
+++ lams_tool_lamc/web/learning/SingleQuestionAnswersContent.jsp (.../SingleQuestionAnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -13,10 +13,10 @@
-
+
-
+
Index: lams_tool_lamc/web/learning/ViewAnswers.jsp
===================================================================
diff -u -r4d139bddc3cdd41d32d9f3033f2100c711d8c0c5 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision 4d139bddc3cdd41d32d9f3033f2100c711d8c0c5)
+++ lams_tool_lamc/web/learning/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -58,7 +58,6 @@
-
Index: lams_tool_lamc/web/learning/mobile/AnswersContent.jsp
===================================================================
diff -u -r65a83a957c6c1160566e3e9d11a9c9a4d6e704f6 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/AnswersContent.jsp (.../AnswersContent.jsp) (revision 65a83a957c6c1160566e3e9d11a9c9a4d6e704f6)
+++ lams_tool_lamc/web/learning/mobile/AnswersContent.jsp (.../AnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -64,7 +64,7 @@
function verifyAllQuestionsAnswered() {
// in case oneQuestionPerPage option is ON user has to select 1 answer, and all answers otherwise
- var isOneQuestionPerPage = ${mcGeneralLearnerFlowDTO.questionListingMode == 'questionListingModeSequential'};
+ var isOneQuestionPerPage = ${sessionMap.content.questionsSequenced};
var answersRequiredNumber = (isOneQuestionPerPage) ? 1 : ${fn:length(requestScope.learnerAnswersDTOList)};
//check each question is answered
@@ -126,8 +126,7 @@
-
-
+
<%@ include file="/common/messages.jsp"%>
@@ -140,7 +139,7 @@
-
+
Index: lams_tool_lamc/web/learning/mobile/CombinedAnswersContent.jsp
===================================================================
diff -u -r10c421fd3489e60e5d5612d3bf624aedf0318623 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 10c421fd3489e60e5d5612d3bf624aedf0318623)
+++ lams_tool_lamc/web/learning/mobile/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -6,10 +6,10 @@
-
+
-
+
Index: lams_tool_lamc/web/learning/mobile/IndividualLearnerResults.jsp
===================================================================
diff -u -r816baa75867795676ea15c9dfcc4feef712edc47 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision 816baa75867795676ea15c9dfcc4feef712edc47)
+++ lams_tool_lamc/web/learning/mobile/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -43,7 +43,6 @@
-
@@ -99,8 +98,7 @@
-
+
-
@@ -122,12 +120,14 @@
-
-
images/tick.gif" border="0" class="middle">
-
-
-
images/cross.gif" border="0" class="middle">
-
+
+
+
images/tick.gif" border="0" class="middle">
+
+
+
images/cross.gif" border="0" class="middle">
+
+
Index: lams_tool_lamc/web/learning/mobile/SingleQuestionAnswersContent.jsp
===================================================================
diff -u -r6c5d0c6b8ff17d661580df2c265f2dcabfe7d76c -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/SingleQuestionAnswersContent.jsp (.../SingleQuestionAnswersContent.jsp) (revision 6c5d0c6b8ff17d661580df2c265f2dcabfe7d76c)
+++ lams_tool_lamc/web/learning/mobile/SingleQuestionAnswersContent.jsp (.../SingleQuestionAnswersContent.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -6,10 +6,10 @@
-
+
-
+
Index: lams_tool_lamc/web/learning/mobile/ViewAnswers.jsp
===================================================================
diff -u -r816baa75867795676ea15c9dfcc4feef712edc47 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision 816baa75867795676ea15c9dfcc4feef712edc47)
+++ lams_tool_lamc/web/learning/mobile/ViewAnswers.jsp (.../ViewAnswers.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -48,9 +48,7 @@
-
-
Index: lams_tool_lamc/web/learning/mobile/submissionDeadline.jsp
===================================================================
diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/mobile/submissionDeadline.jsp (.../submissionDeadline.jsp) (revision be07c35c372d904a65581d98660e73f3b13b69db)
+++ lams_tool_lamc/web/learning/mobile/submissionDeadline.jsp (.../submissionDeadline.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -42,7 +42,7 @@
Index: lams_tool_lamc/web/learning/submissionDeadline.jsp
===================================================================
diff -u -r4d139bddc3cdd41d32d9f3033f2100c711d8c0c5 -rc50fe13d18f2af436354f5a9ececd048a9ec752d
--- lams_tool_lamc/web/learning/submissionDeadline.jsp (.../submissionDeadline.jsp) (revision 4d139bddc3cdd41d32d9f3033f2100c711d8c0c5)
+++ lams_tool_lamc/web/learning/submissionDeadline.jsp (.../submissionDeadline.jsp) (revision c50fe13d18f2af436354f5a9ececd048a9ec752d)
@@ -47,7 +47,7 @@
-
+