Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/MonitoringAction.java =================================================================== diff -u -rc20b8bc20f56ae4d510bc5c4f2bf101a6ce7261b -r1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision c20b8bc20f56ae4d510bc5c4f2bf101a6ce7261b) +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf) @@ -56,8 +56,7 @@ * @author * @version * - * @struts.action path="/monitoring" parameter="dispatch" scope="request" - * name="monitoringForm" validate="false" + * @struts.action path="/monitoring" parameter="dispatch" scope="request" name="monitoringForm" validate="false" * * @struts.action-forward name="success" path="tiles:/monitoring/main" * @@ -66,152 +65,147 @@ */ public class MonitoringAction extends LamsDispatchAction { - private static Logger log = Logger.getLogger(MonitoringAction.class); + private static Logger log = Logger.getLogger(MonitoringAction.class); - public IScribeService scribeService; + public IScribeService scribeService; - public ActionForward unspecified(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) { - log.info("excuting monitoring action"); + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + log.info("excuting monitoring action"); - Long toolContentID = new Long(WebUtil.readLongParam(request, - AttributeNames.PARAM_TOOL_CONTENT_ID)); + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); - String contentFolderID = WebUtil.readStrParam(request, - AttributeNames.PARAM_CONTENT_FOLDER_ID); - MonitoringForm monForm = (MonitoringForm)form; - monForm.setContentFolderID(contentFolderID); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + MonitoringForm monForm = (MonitoringForm) form; + monForm.setContentFolderID(contentFolderID); - monForm.setCurrentTab(WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB,true)); - - // set up scribeService - if (scribeService == null) { - scribeService = ScribeServiceProxy.getScribeService(this.getServlet() - .getServletContext()); - } - Scribe scribe = scribeService.getScribeByContentId(toolContentID); - - ScribeDTO scribeDTO = setupScribeDTO(scribe); - boolean isGroupedActivity = scribeService.isGroupedActivity(toolContentID); - request.setAttribute("isGroupedActivity", isGroupedActivity); - request.setAttribute("monitoringDTO", scribeDTO); - request.setAttribute("contentFolderID", contentFolderID); - - return mapping.findForward("success"); - } - - public ActionForward openNotebook(ActionMapping mapping, - ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - - Long uid = WebUtil.readLongParam(request, "uid", false); - - ScribeUser scribeUser = scribeService.getUserByUID(uid); - NotebookEntry notebookEntry = scribeService.getEntry(scribeUser.getScribeSession().getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, ScribeConstants.TOOL_SIGNATURE, scribeUser.getUserId().intValue()); - - ScribeUserDTO scribeUserDTO = new ScribeUserDTO(scribeUser); - scribeUserDTO.setNotebookEntry(notebookEntry.getEntry()); - - request.setAttribute("scribeUserDTO", scribeUserDTO); - - return mapping.findForward("notebook"); - } + monForm.setCurrentTab(WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); - public ActionForward appointScribe(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - - MonitoringForm monForm = (MonitoringForm)form; - - ScribeSession session = scribeService.getSessionBySessionId(monForm.getToolSessionID()); - ScribeUser user = scribeService.getUserByUID(monForm.getAppointedScribeUID()); - - session.setAppointedScribe(user); - scribeService.saveOrUpdateScribeSession(session); - - ScribeDTO scribeDTO = setupScribeDTO(session.getScribe()); - - request.setAttribute("monitoringDTO", scribeDTO); - request.setAttribute("contentFolderID", monForm.getContentFolderID()); - - return mapping.findForward("success"); + // set up scribeService + if (scribeService == null) { + scribeService = ScribeServiceProxy.getScribeService(this.getServlet().getServletContext()); } - - - public ActionForward forceCompleteActivity(ActionMapping mapping, - ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + Scribe scribe = scribeService.getScribeByContentId(toolContentID); - MonitoringForm monForm = (MonitoringForm)form; + ScribeDTO scribeDTO = setupScribeDTO(scribe); + boolean isGroupedActivity = scribeService.isGroupedActivity(toolContentID); + request.setAttribute("isGroupedActivity", isGroupedActivity); + request.setAttribute("monitoringDTO", scribeDTO); + request.setAttribute("contentFolderID", contentFolderID); - ScribeSession session = scribeService.getSessionBySessionId(monForm.getToolSessionID()); - session.setForceComplete(true); - scribeService.saveOrUpdateScribeSession(session); + return mapping.findForward("success"); + } - ScribeDTO scribeDTO = setupScribeDTO(session.getScribe()); - request.setAttribute("monitoringDTO", scribeDTO); - request.setAttribute("contentFolderID", monForm.getContentFolderID()); - - return mapping.findForward("success"); - } - /* Private Methods */ + public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - private ScribeDTO setupScribeDTO(Scribe scribe) { - ScribeDTO scribeDTO = new ScribeDTO(scribe); + Long uid = WebUtil.readLongParam(request, "uid", false); - for (Iterator sessIter = scribe.getScribeSessions().iterator(); sessIter - .hasNext();) { - ScribeSession session = (ScribeSession) sessIter.next(); + ScribeUser scribeUser = scribeService.getUserByUID(uid); + NotebookEntry notebookEntry = scribeService.getEntry(scribeUser.getScribeSession().getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, ScribeConstants.TOOL_SIGNATURE, scribeUser.getUserId().intValue()); - ScribeSessionDTO sessionDTO = new ScribeSessionDTO(session); - int numberOfVotes = 0; - - for (Iterator userIter = session.getScribeUsers().iterator(); userIter - .hasNext();) { - ScribeUser user = (ScribeUser) userIter.next(); - ScribeUserDTO userDTO = new ScribeUserDTO(user); - - // get the notebook entry. - NotebookEntry notebookEntry = scribeService.getEntry(session.getSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, - ScribeConstants.TOOL_SIGNATURE, user.getUserId() - .intValue()); - if (notebookEntry != null) { - userDTO.finishedReflection = true; - } else { - userDTO.finishedReflection = false; - } - - if (user.isReportApproved()) { - numberOfVotes++; - } - - sessionDTO.getUserDTOs().add(userDTO); - } - int numberOfLearners = session.getScribeUsers().size(); - - sessionDTO.setNumberOfVotes(numberOfVotes); - sessionDTO.setNumberOfLearners(numberOfLearners); - sessionDTO.setVotePercentage(ScribeUtils.calculateVotePercentage(numberOfVotes, numberOfLearners)); - scribeDTO.getSessionDTOs().add(sessionDTO); + ScribeUserDTO scribeUserDTO = new ScribeUserDTO(scribeUser); + scribeUserDTO.setNotebookEntry(notebookEntry.getEntry()); + + request.setAttribute("scribeUserDTO", scribeUserDTO); + + return mapping.findForward("notebook"); + } + + public ActionForward appointScribe(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + MonitoringForm monForm = (MonitoringForm) form; + + ScribeSession session = scribeService.getSessionBySessionId(monForm.getToolSessionID()); + ScribeUser user = scribeService.getUserByUID(monForm.getAppointedScribeUID()); + + session.setAppointedScribe(user); + scribeService.saveOrUpdateScribeSession(session); + + ScribeDTO scribeDTO = setupScribeDTO(session.getScribe()); + boolean isGroupedActivity = scribeService.isGroupedActivity(session.getScribe().getToolContentId()); + request.setAttribute("isGroupedActivity", isGroupedActivity); + request.setAttribute("monitoringDTO", scribeDTO); + request.setAttribute("contentFolderID", monForm.getContentFolderID()); + + monForm.setCurrentTab(WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); + + return mapping.findForward("success"); + } + + public ActionForward forceCompleteActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + MonitoringForm monForm = (MonitoringForm) form; + + ScribeSession session = scribeService.getSessionBySessionId(monForm.getToolSessionID()); + session.setForceComplete(true); + scribeService.saveOrUpdateScribeSession(session); + + ScribeDTO scribeDTO = setupScribeDTO(session.getScribe()); + request.setAttribute("monitoringDTO", scribeDTO); + request.setAttribute("contentFolderID", monForm.getContentFolderID()); + + return mapping.findForward("success"); + } + + /* Private Methods */ + + private ScribeDTO setupScribeDTO(Scribe scribe) { + ScribeDTO scribeDTO = new ScribeDTO(scribe); + + for (Iterator sessIter = scribe.getScribeSessions().iterator(); sessIter.hasNext();) { + ScribeSession session = (ScribeSession) sessIter.next(); + + ScribeSessionDTO sessionDTO = new ScribeSessionDTO(session); + int numberOfVotes = 0; + + for (Iterator userIter = session.getScribeUsers().iterator(); userIter.hasNext();) { + ScribeUser user = (ScribeUser) userIter.next(); + ScribeUserDTO userDTO = new ScribeUserDTO(user); + + // get the notebook entry. + NotebookEntry notebookEntry = scribeService.getEntry(session.getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, ScribeConstants.TOOL_SIGNATURE, user.getUserId() + .intValue()); + if (notebookEntry != null) { + userDTO.finishedReflection = true; + } else { + userDTO.finishedReflection = false; } - - return scribeDTO; - + + if (user.isReportApproved()) { + numberOfVotes++; + } + + sessionDTO.getUserDTOs().add(userDTO); + } + int numberOfLearners = session.getScribeUsers().size(); + + sessionDTO.setNumberOfVotes(numberOfVotes); + sessionDTO.setNumberOfLearners(numberOfLearners); + sessionDTO.setVotePercentage(ScribeUtils.calculateVotePercentage(numberOfVotes, numberOfLearners)); + scribeDTO.getSessionDTOs().add(sessionDTO); } - - private ScribeUser getCurrentUser(Long toolSessionID) { - UserDTO user = (UserDTO) SessionManager.getSession().getAttribute( - AttributeNames.USER); - // attempt to retrieve user using userId and toolSessionID - ScribeUser scribeUser = scribeService.getUserByUserIdAndSessionId(new Long( - user.getUserID().intValue()), toolSessionID); + return scribeDTO; - if (scribeUser == null) { - ScribeSession scribeSession = scribeService - .getSessionBySessionId(toolSessionID); - scribeUser = scribeService.createScribeUser(user, scribeSession); - } + } - return scribeUser; + private ScribeUser getCurrentUser(Long toolSessionID) { + UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + + // attempt to retrieve user using userId and toolSessionID + ScribeUser scribeUser = scribeService.getUserByUserIdAndSessionId(new Long(user.getUserID().intValue()), + toolSessionID); + + if (scribeUser == null) { + ScribeSession scribeSession = scribeService.getSessionBySessionId(toolSessionID); + scribeUser = scribeService.createScribeUser(user, scribeSession); } + + return scribeUser; + } } Index: lams_tool_scribe/web/pages/monitoring/statistics.jsp =================================================================== diff -u -rabc6f25b4f548215dc7d18bf316adbe21fe296a6 -r1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf --- lams_tool_scribe/web/pages/monitoring/statistics.jsp (.../statistics.jsp) (revision abc6f25b4f548215dc7d18bf316adbe21fe296a6) +++ lams_tool_scribe/web/pages/monitoring/statistics.jsp (.../statistics.jsp) (revision 1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf) @@ -1,8 +1,6 @@ <%@ include file="/common/taglibs.jsp"%> - -
Index: lams_tool_scribe/web/pages/monitoring/summary.jsp =================================================================== diff -u -r2353a5dcfd4b3ad6d21b3f0cda3d7833fc97c6b9 -r1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf --- lams_tool_scribe/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 2353a5dcfd4b3ad6d21b3f0cda3d7833fc97c6b9) +++ lams_tool_scribe/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 1da8dadde28e6b4b1f248175bb9f3c22ffeeb9cf) @@ -1,25 +1,24 @@ <%@ include file="/common/taglibs.jsp"%> + - +

+ +

- -

- +

@@ -32,81 +31,74 @@ - - - - - - - - - - - - - - - - - ${user.firstName} ${user.lastName} - - - - - - - - - - - - -

- -

-
-
+ + + + + + + + + + + + + + ${user.firstName} ${user.lastName} + + + + + + + + + +
- + - - : - +

+ +

+
+
- - + + + : + -
- -
+ + +
+ +
+
+ +

+ +

+

+ +


- -

- -

-

- -

-
-
+
- <%@include file="/pages/parts/voteDisplay.jsp"%> + <%@include file="/pages/parts/voteDisplay.jsp"%> - - - - - - - - - - + + + + + + + + + + - - +
@@ -167,8 +159,6 @@

- -