Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaUtils.java,v
diff -u -r1.56 -r1.57
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 13 Nov 2006 19:38:45 -0000 1.56
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 26 Nov 2006 22:25:37 -0000 1.57
@@ -76,8 +76,12 @@
public static String replaceNewLines(String text)
{
logger.debug("using text: " + text);
- String newText = text.replaceAll("\n","
");
- logger.debug("newText: " + newText);
+ String newText = "";
+ if (text != null)
+ {
+ newText = text.replaceAll("\n","
");
+ logger.debug("newText: " + newText);
+ }
return newText;
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java,v
diff -u -r1.44 -r1.45
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 11 Nov 2006 14:58:36 -0000 1.44
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 26 Nov 2006 22:25:37 -0000 1.45
@@ -274,5 +274,8 @@
/** Get the LAMS audit service. Needed as the web layer controls the staff updating of an answer,
* so the log entry must be made by the web layer. */
public IAuditService getAuditService();
+
+ public void updateEntry(NotebookEntry notebookEntry);
+
}
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.74 -r1.75
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 13 Nov 2006 20:03:56 -0000 1.74
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 26 Nov 2006 22:25:37 -0000 1.75
@@ -2184,4 +2184,9 @@
public void setCoreNotebookService(ICoreNotebookService coreNotebookService) {
this.coreNotebookService = coreNotebookService;
}
+
+ public void updateEntry(NotebookEntry notebookEntry) {
+ coreNotebookService.updateEntry(notebookEntry);
+ }
+
}
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.31 -r1.32
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 15 Nov 2006 00:38:13 -0000 1.31
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java 26 Nov 2006 22:25:37 -0000 1.32
@@ -114,6 +114,7 @@
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.qa.GeneralLearnerFlowDTO;
@@ -127,6 +128,7 @@
import org.lamsfoundation.lams.tool.qa.QaUtils;
import org.lamsfoundation.lams.tool.qa.service.IQaService;
import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
+import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.web.action.LamsDispatchAction;
import org.lamsfoundation.lams.web.session.SessionManager;
@@ -680,6 +682,23 @@
boolean usernameVisible=qaContent.isUsernameVisible();
generalLearnerFlowDTO.setUserNameVisible(new Boolean(usernameVisible).toString());
+
+
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
+ String notebookEntryPresentable=notebookEntry.getEntry();
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ qaLearningForm.setEntryText(notebookEntryPresentable);
+ }
+
+
request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
@@ -1069,7 +1088,36 @@
logger.debug("userID: " + userID);
qaLearningForm.setUserID(userID);
+ //QaUtils.replaceNewLines(entryText)
+ String entryText=request.getParameter("entryText");
+ logger.debug("entryText: " + entryText);
+
+ /*
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntry: " + notebookEntry);
+ if (notebookEntry != null) {
+ notebookEntry.setEntry(entryText);
+ qaService.updateEntry(notebookEntry);
+ }
+
+
+ NotebookEntry notebookEntryLocal = new NotebookEntry();
+ notebookEntryLocal.setEntry(entryText);
+
+ User userLocal = new User();
+ userLocal.setUserId(new Integer(userID));
+ notebookEntryLocal.setUser(userLocal);
+
+ qaService.updateEntry(notebookEntryLocal);
+ logger.debug("entry updated: " + entryText);
+ */
+
+
+
QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue());
logger.debug("retrieving qaSession: " + qaSession);
@@ -1151,7 +1199,114 @@
return null;
}
+
+
+ public ActionForward updateReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, ToolException
+ {
+ logger.debug("dispatching updateReflection...");
+ QaLearningForm qaLearningForm = (QaLearningForm) form;
+
+ LearningUtil.saveFormRequestData(request, qaLearningForm);
+
+ IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ logger.debug("qaService: " + qaService);
+ String httpSessionID=qaLearningForm.getHttpSessionID();
+ logger.debug("httpSessionID: " + httpSessionID);
+
+ qaLearningForm.setHttpSessionID(httpSessionID);
+
+ String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+ logger.debug("toolSessionID: " + toolSessionID);
+ qaLearningForm.setToolSessionID(toolSessionID);
+
+ String userID=request.getParameter("userID");
+ logger.debug("userID: " + userID);
+ qaLearningForm.setUserID(userID);
+
+ QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(toolSessionID).longValue());
+ logger.debug("retrieving qaSession: " + qaSession);
+
+ QaContent qaContent=qaSession.getQaContent();
+ logger.debug("using qaContent: " + qaContent);
+
+
+ QaQueUsr qaQueUsr=qaService.getQaUserBySession(new Long(userID), qaSession.getUid());
+ logger.debug("QaQueUsr:" + qaQueUsr);
+
+
+ String entryText=request.getParameter("entryText");
+ logger.debug("entryText: " + entryText);
+ qaLearningForm.setEntryText(entryText);
+
+ NotebookEntry notebookEntryLocal = new NotebookEntry();
+ notebookEntryLocal.setEntry(entryText);
+ //notebookEntry.setUser(qaQueUsr);
+ User user = new User();
+ user.setUserId(new Integer(userID));
+ notebookEntryLocal.setUser(user);
+
+ qaService.updateEntry(notebookEntryLocal);
+ logger.debug("entry updated: " + entryText);
+
+ GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO();
+
+ generalLearnerFlowDTO.setNotebookEntry(entryText);
+ generalLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString());
+ Boolean isUserNamesVisibleBoolean=new Boolean(qaContent.isUsernameVisible());
+ boolean isUserNamesVisible=isUserNamesVisibleBoolean.booleanValue();
+
+
+ QaMonitoringAction qaMonitoringAction = new QaMonitoringAction();
+ logger.debug("using generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+ qaMonitoringAction.refreshSummaryData(request, qaContent, qaService, isUserNamesVisible, true,
+ toolSessionID, null, generalLearnerFlowDTO, false, toolSessionID);
+ logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
+
+
+ int sessionUserCount=0;
+ if (qaSession.getQaQueUsers() != null)
+ {
+ sessionUserCount=qaSession.getQaQueUsers().size();
+ }
+
+ if (sessionUserCount > 1)
+ {
+ logger.debug("there are multiple user responses");
+ generalLearnerFlowDTO.setExistMultipleUserResponses(new Boolean(true).toString());
+ }
+
+ boolean isLearnerFinished=qaQueUsr.isLearnerFinished();
+ logger.debug("isLearnerFinished: " + isLearnerFinished);
+ generalLearnerFlowDTO.setRequestLearningReportViewOnly(new Boolean(isLearnerFinished).toString());
+
+ boolean lockWhenFinished=qaContent.isLockWhenFinished();
+ generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString());
+
+
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ qaLearningForm.setEntryText(notebookEntryPresentable);
+ }
+
+ request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
+ logger.debug("before fwd, GENERAL_LEARNER_FLOW_DTO: " + request.getAttribute(GENERAL_LEARNER_FLOW_DTO));
+
+
+ logger.debug("fwd'ing to." + REVISITED_LEARNER_REP);
+ return (mapping.findForward(REVISITED_LEARNER_REP));
+ }
+
+
/**
* ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException, ToolException
@@ -1281,13 +1436,34 @@
QaContent qaContent=qaSession.getQaContent();
logger.debug("using qaContent: " + qaContent);
-
+
+ String userID=request.getParameter("userID");
+ logger.debug("userID: " + userID);
+ qaLearningForm.setUserID(userID);
+
+
GeneralLearnerFlowDTO generalLearnerFlowDTO= new GeneralLearnerFlowDTO();
generalLearnerFlowDTO.setActivityTitle(qaContent.getTitle());
String reflectionSubject=qaContent.getReflectionSubject();
reflectionSubject=QaUtils.replaceNewLines(reflectionSubject);
generalLearnerFlowDTO.setReflectionSubject(reflectionSubject);
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntry: " + notebookEntry);
+
+ if (notebookEntry != null) {
+ //String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
+ String notebookEntryPresentable=notebookEntry.getEntry();
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
+ qaLearningForm.setEntryText(notebookEntryPresentable);
+ }
+
+
request.setAttribute(GENERAL_LEARNER_FLOW_DTO, generalLearnerFlowDTO);
logger.debug("final generalLearnerFlowDTO: " + generalLearnerFlowDTO);
qaLearningForm.resetUserActions(); /*resets all except submitAnswersContent */
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaLearningForm.java,v
diff -u -r1.21 -r1.22
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java 19 Oct 2006 23:38:54 -0000 1.21
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java 26 Nov 2006 22:25:37 -0000 1.22
@@ -44,6 +44,7 @@
protected String endLearning;
protected String refreshAnswers;
protected String submitReflection;
+ protected String updateReflection;
protected String forwardtoReflection;
protected String totalQuestionCount;
@@ -454,4 +455,17 @@
public void setViewAll(String viewAll) {
this.viewAll = viewAll;
}
+ /**
+ * @return Returns the updateReflection.
+ */
+ public String getUpdateReflection() {
+ return updateReflection;
+ }
+ /**
+ * @param updateReflection The updateReflection to set.
+ */
+ public void setUpdateReflection(String updateReflection) {
+ this.updateReflection = updateReflection;
+ }
+
}
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.66 -r1.67
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 15 Nov 2006 00:38:12 -0000 1.66
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 26 Nov 2006 22:25:37 -0000 1.67
@@ -302,6 +302,8 @@
if (notebookEntry != null) {
String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntry.getEntry());
+ //String notebookEntryPresentable=notebookEntry.getEntry();
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
}
@@ -573,7 +575,26 @@
logger.debug("qaQueUsrLocal uid : " + qaQueUsrLocal.getUid());
generalLearnerFlowDTO.setUserUid(qaQueUsrLocal.getUid().toString());
+ String noteBookEntry=generalLearnerFlowDTO.getNotebookEntry();
+ logger.debug("noteBookEntry : " + noteBookEntry);
+ qaLearningForm.setEntryText(noteBookEntry);
+
+ logger.debug("attempt getting notebookEntry: ");
+ NotebookEntry notebookEntryLocal = qaService.getEntry(new Long(toolSessionID),
+ CoreNotebookConstants.NOTEBOOK_TOOL,
+ MY_SIGNATURE, new Integer(userID));
+
+ logger.debug("notebookEntryLocal: " + notebookEntryLocal);
+
+ if (notebookEntryLocal != null) {
+ String notebookEntryPresentable=QaUtils.replaceNewLines(notebookEntryLocal.getEntry());
+ logger.debug("notebookEntryPresentable: " + notebookEntryPresentable);
+ generalLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
+ qaLearningForm.setEntryText(notebookEntryPresentable);
+ }
+
+
if (isLearnerFinished)
{
Index: lams_tool_laqa/web/authoring/AdvancedContent.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/AdvancedContent.jsp,v
diff -u -r1.25 -r1.26
--- lams_tool_laqa/web/authoring/AdvancedContent.jsp 13 Nov 2006 19:38:46 -0000 1.25
+++ lams_tool_laqa/web/authoring/AdvancedContent.jsp 26 Nov 2006 22:25:37 -0000 1.26
@@ -25,7 +25,7 @@
styleClass="noBorder">
Index: lams_tool_laqa/web/learning/LearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/LearnerRep.jsp,v
diff -u -r1.27 -r1.28
--- lams_tool_laqa/web/learning/LearnerRep.jsp 23 Nov 2006 07:07:36 -0000 1.27
+++ lams_tool_laqa/web/learning/LearnerRep.jsp 26 Nov 2006 22:25:36 -0000 1.28
@@ -152,14 +152,7 @@
-
-
-
-
-
-
+
@@ -299,16 +292,7 @@
-
-
-
-
-
-
-
-
+
Index: lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp,v
diff -u -r1.4 -r1.5
--- lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp 23 Nov 2006 07:07:36 -0000 1.4
+++ lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp 26 Nov 2006 22:25:36 -0000 1.5
@@ -157,20 +157,28 @@
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -207,7 +215,6 @@
-
@@ -304,23 +311,27 @@
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -342,6 +353,7 @@
+