Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java
===================================================================
diff -u -r394b0f24142992b4a38bd07797d6f439e51f0838 -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 394b0f24142992b4a38bd07797d6f439e51f0838)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -136,9 +136,11 @@
public static final String USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP ="userExceptionDefaultContentNotSetup";
public static final String USER_EXCEPTION_NO_TOOL_SESSIONS ="userExceptionNoToolSessions";
public static final String USER_EXCEPTION_NO_STUDENT_ACTIVITY ="userExceptionNoStudentActivity";
+ public static final String USER_EXCEPTION_CONTENT_IN_USE ="userExceptionContentInUse";
public static final String COUNT_SESSION_COMPLETE ="countSessionComplete";
public static final String CURRENT_MONITORED_TOOL_SESSION ="currentMonitoredToolSession";
+
public static final String COUNT_ALL_USERS ="countAllUsers";
public static final String CURRENT_MONITORING_TAB ="currentMonitoringTab";
public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO ="listMonitoredAnswersContainerDto";
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties
===================================================================
diff -u -r35717bc4f7da978b2c0a0f9a85a77d7b77f5670b -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties (.../QaResources.properties) (revision 35717bc4f7da978b2c0a0f9a85a77d7b77f5670b)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties (.../QaResources.properties) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -144,6 +144,7 @@
error.mode.invalid =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a valid mode: learner or teacher
error.contentrepository =An error has occurred when saving/deleting instruction file {0}. The files may not be saved correctly.
monitoring.feedback.instructionUpdate =The content has been updated successfully.
+label.content.notEditable =The content can not be edited since it is being used by learners.
label.openEditor =Open Richtext Editor
label.user =User
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java
===================================================================
diff -u -r394b0f24142992b4a38bd07797d6f439e51f0838 -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 394b0f24142992b4a38bd07797d6f439e51f0838)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -567,6 +567,7 @@
request.getSession().removeAttribute(IS_MONITORED_CONTENT_IN_USE);
request.getSession().removeAttribute(LOAD_MONITORING_CONTENT_EDITACTIVITY);
request.getSession().removeAttribute(MONITORING_ORIGINATED_DEFINELATER);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE);
}
Fisheye: Tag 664a5459e87fdfde268c9c54e458618c0965f816 refers to a dead (removed) revision in file `lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaExportServlet.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java
===================================================================
diff -u -r35717bc4f7da978b2c0a0f9a85a77d7b77f5670b -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 35717bc4f7da978b2c0a0f9a85a77d7b77f5670b)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -175,19 +175,15 @@
content in use is not modifiable*/
QaContent qaContent=qaService.loadQa(toolContentId.longValue());
logger.debug("qaContent:" + qaContent);
- boolean isContentInUse=QaUtils.isContentInUse(qaContent);
- logger.debug("isContentInUse:" + isContentInUse);
- if (isContentInUse == true)
+ if (qaService.studentActivityOccurred(qaContent))
{
- logger.debug("monitoring url does not allow editActivity since the content is in use.");
- persistError(request,"error.content.inUse");
- QaUtils.cleanUpSessionAbsolute(request);
- request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString());
+ logger.debug("student activity occurred on this content:" + qaContent);
+ request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString());
logger.debug("forwarding to: " + LOAD_MONITORING);
return (mapping.findForward(LOAD_MONITORING));
}
-
+
return qaStarterAction.executeDefineLater(mapping, form, request, response, qaService);
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java
===================================================================
diff -u -r35717bc4f7da978b2c0a0f9a85a77d7b77f5670b -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 35717bc4f7da978b2c0a0f9a85a77d7b77f5670b)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -98,6 +98,13 @@
return false;
}
+ if (qaService.studentActivityOccurred(qaContent))
+ {
+ logger.debug("student activity occurred on this content:" + qaContent);
+ request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString());
+ }
+
+
/* this section is related to summary tab. Starts here. */
Map summaryToolSessions=MonitoringUtil.populateToolSessions(request, qaContent, qaService);
logger.debug("summaryToolSessions: " + summaryToolSessions);
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java
===================================================================
diff -u -r394b0f24142992b4a38bd07797d6f439e51f0838 -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 394b0f24142992b4a38bd07797d6f439e51f0838)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -100,7 +100,6 @@
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.lamsfoundation.lams.tool.exception.ToolException;
-
import org.lamsfoundation.lams.tool.qa.QaAppConstants;
import org.lamsfoundation.lams.tool.qa.QaApplicationException;
import org.lamsfoundation.lams.tool.qa.QaComparator;
@@ -110,7 +109,6 @@
import org.lamsfoundation.lams.tool.qa.service.IQaService;
import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
-import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
@@ -220,10 +218,6 @@
/*
* find out whether the request is coming from monitoring module for EditActivity tab or from authoring environment url
*/
- //String strToolContentId="";
- //Long contentID =new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID));
-
-
logger.debug("no problems getting the default content, will render authoring screen");
String strToolContentId="";
/*the authoring url must be passed a tool content id*/
@@ -295,33 +289,26 @@
* It is always unlocked since it is the default content.
*/
- /*
- QaContent qaContent = qaService.loadQa(contentID.longValue());
- logger.debug("QaContent: " + qaContent);
-
- boolean studentActivity=qaService.studentActivityOccurredGlobal(qaContent);
- logger.debug("studentActivity on content: " + studentActivity);
- if (studentActivity)
- {
- logger.debug("forward to warning screen as the content is not allowed to be modified.");
- ActionMessages errors= new ActionMessages();
- errors.add(Globals.ERROR_KEY, new ActionMessage("error.content.inUse"));
- saveErrors(request,errors);
- QaUtils.cleanUpSessionAbsolute(request);
- logger.debug("forwarding to: " + ERROR_LIST);
- return (mapping.findForward(ERROR_LIST));
- }
-
- */
-
if (!existsContent(new Long(strToolContentId).longValue(), qaService))
{
+ /*fetch default content*/
String defaultContentIdStr=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID_STR);
logger.debug("defaultContentIdStr:" + defaultContentIdStr);
retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, new Long(defaultContentIdStr).longValue());
}
else
{
+ /* it is possible that the content is in use by learners.*/
+ QaContent qaContent=qaService.loadQa(new Long(strToolContentId).longValue());
+ logger.debug("qaContent: " + qaContent);
+ if (qaService.studentActivityOccurred(qaContent))
+ {
+ logger.debug("student activity occurred on this content:" + qaContent);
+ persistError(request, "error.content.inUse");
+ logger.debug("add error.content.inUse to ActionMessages.");
+ QaUtils.cleanUpSessionAbsolute(request);
+ return (mapping.findForward(ERROR_LIST));
+ }
retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, new Long(strToolContentId).longValue());
}
@@ -530,6 +517,9 @@
return true;
}
+
+
+
public ActionForward executeDefineLater(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response, IQaService qaService)
Index: lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp
===================================================================
diff -u -r394b0f24142992b4a38bd07797d6f439e51f0838 -r1158d541cead46e6f0c26f71fdd99e46f031acd1
--- lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision 394b0f24142992b4a38bd07797d6f439e51f0838)
+++ lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1)
@@ -202,7 +202,11 @@
- edit activity screen
+
+
+
+
+