Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -286,6 +286,7 @@ /* * Monitoring Mode constants */ + public static final String ATTR_CONTENT = "content"; public static final String CURRENT_MONITORING_TAB = "currentMonitoringTab"; public static final String REPORT_TITLE_MONITOR = "reportTitleMonitor"; public static final String MONITOR_USER_ID = "userId"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java =================================================================== diff -u -r050e8bf3043b7af4904debfe4b75ed40e1340dcb -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java (.../IMcUsrAttemptDAO.java) (revision 050e8bf3043b7af4904debfe4b75ed40e1340dcb) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java (.../IMcUsrAttemptDAO.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -75,7 +75,7 @@ * @param queUserUid * @return */ - List getUserAttempts(Long queUserUid); + List getFinalizedUserAttempts(Long queUserUid); /** * Get the highest attempt order for a user for a particular question Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java =================================================================== diff -u -r050e8bf3043b7af4904debfe4b75ed40e1340dcb -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java (.../McUsrAttemptDAO.java) (revision 050e8bf3043b7af4904debfe4b75ed40e1340dcb) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java (.../McUsrAttemptDAO.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -44,18 +44,18 @@ */ public class McUsrAttemptDAO extends HibernateDaoSupport implements IMcUsrAttemptDAO { - private static final String LOAD_PARTICULAR_QUESTION_ATTEMPT = "from mcUsrAttempt in class McUsrAttempt where mcUsrAttempt.mcQueUsr.uid=:queUsrUid" - + " and mcUsrAttempt.mcQueContentId=:mcQueContentId" - + " order by mcUsrAttempt.mcOptionsContent.uid"; + private static final String LOAD_PARTICULAR_QUESTION_ATTEMPT = "from attempt in class McUsrAttempt where attempt.mcQueUsr.uid=:queUsrUid" + + " and attempt.mcQueContentId=:mcQueContentId" + + " order by attempt.mcOptionsContent.uid"; - private static final String LOAD_ALL_QUESTION_ATTEMPTS = "from mcUsrAttempt in class McUsrAttempt where mcUsrAttempt.mcQueUsr.uid=:queUsrUid" - + " order by mcUsrAttempt.mcQueContentId, mcUsrAttempt.mcOptionsContent.uid"; + private static final String LOAD_ALL_QUESTION_ATTEMPTS = "from attempt in class McUsrAttempt where attempt.mcQueUsr.uid=:queUsrUid" + + " AND attempt.mcQueUsr.responseFinalised = true order by attempt.mcQueContentId, attempt.mcOptionsContent.uid"; private static final String FIND_ATTEMPTS_COUNT_BY_OPTION = "select count(*) from " + McUsrAttempt.class.getName() + " as attempt where attempt.mcOptionsContent.uid=? AND attempt.mcQueUsr.responseFinalised = true"; - private static final String FIND_USER_TOTAL_MARK = "select SUM(attempt.mark) from " + private static final String FIND_USER_TOTAL_MARK = "select COALESCE(SUM(attempt.mark),0) from " + McUsrAttempt.class.getName() + " as attempt where attempt.mcQueUsr.uid=:userUid AND attempt.mcQueUsr.responseFinalised = true"; @@ -70,7 +70,7 @@ } @Override - public List getUserAttempts(final Long userUid) { + public List getFinalizedUserAttempts(final Long userUid) { return (List) getSession().createQuery(LOAD_ALL_QUESTION_ATTEMPTS) .setLong("queUsrUid", userUid.longValue()).list(); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -41,6 +41,8 @@ import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McCandidateAnswersDTO; import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO; +import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO; +import org.lamsfoundation.lams.tool.mc.ReflectionDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; @@ -240,6 +242,17 @@ List buildLearnerAnswersDTOList(McContent mcContent, McQueUsr user); /** + * Returns userMarksDtos grouped by sessions. + * + * @param mcContent + * @param isFullAttemptDetailsRequired + * if true populates complete user attempt history including option select history, used only for export + * and spreadsheet. If not only total mark calculated + * @return + */ + List buildGroupsMarkData(McContent mcContent, boolean isFullAttemptDetailsRequired); + + /** * prepareSessionDataSpreadsheet * * @param mcContent @@ -249,5 +262,16 @@ byte[] prepareSessionDataSpreadsheet(McContent mcContent) throws IOException; void changeUserAttemptMark(Long userAttemptUid, Integer newMark); + + /** + * + * returns reflection data for all sessions + * + * @param mcContent + * @param userID + * @param mcService + * @return + */ + List getReflectionList(McContent mcContent, Long userID); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== diff -u -r050e8bf3043b7af4904debfe4b75ed40e1340dcb -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision 050e8bf3043b7af4904debfe4b75ed40e1340dcb) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -36,6 +36,7 @@ import java.util.Map; import java.util.Set; import java.util.SortedMap; +import java.util.TreeMap; import java.util.TreeSet; import java.util.Vector; @@ -70,6 +71,7 @@ import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException; import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; import org.lamsfoundation.lams.tool.IToolVO; import org.lamsfoundation.lams.tool.ToolContentImport102Manager; @@ -86,8 +88,10 @@ import org.lamsfoundation.lams.tool.mc.McCandidateAnswersDTO; import org.lamsfoundation.lams.tool.mc.McLearnerAnswersDTO; import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO; +import org.lamsfoundation.lams.tool.mc.McStringComparator; import org.lamsfoundation.lams.tool.mc.McUserMarkDTO; import org.lamsfoundation.lams.tool.mc.McUtils; +import org.lamsfoundation.lams.tool.mc.ReflectionDTO; import org.lamsfoundation.lams.tool.mc.dao.IMcContentDAO; import org.lamsfoundation.lams.tool.mc.dao.IMcOptionsContentDAO; import org.lamsfoundation.lams.tool.mc.dao.IMcQueContentDAO; @@ -466,12 +470,109 @@ return learnerAnswersDTOList; } + + @Override + public List buildGroupsMarkData(McContent mcContent, boolean isFullAttemptDetailsRequired) { + List listMonitoredMarksContainerDTO = new LinkedList(); + Set sessions = mcContent.getMcSessions(); + Iterator sessionsIterator = sessions.iterator(); + int numQuestions = mcContent.getMcQueContents().size(); + while (sessionsIterator.hasNext()) { + McSession mcSession = sessionsIterator.next(); + + McSessionMarkDTO mcSessionMarkDTO = new McSessionMarkDTO(); + mcSessionMarkDTO.setSessionId(mcSession.getMcSessionId().toString()); + mcSessionMarkDTO.setSessionName(mcSession.getSession_name().toString()); + + Set sessionUsers = mcSession.getMcQueUsers(); + Iterator usersIterator = sessionUsers.iterator(); + + Map mapSessionUsersData = new TreeMap(new McStringComparator()); + Long mapIndex = new Long(1); + + while (usersIterator.hasNext()) { + McQueUsr user = usersIterator.next(); + + McUserMarkDTO mcUserMarkDTO = new McUserMarkDTO(); + mcUserMarkDTO.setSessionId(mcSession.getMcSessionId().toString()); + mcUserMarkDTO.setSessionName(mcSession.getSession_name().toString()); + mcUserMarkDTO.setFullName(user.getFullname()); + mcUserMarkDTO.setUserName(user.getUsername()); + mcUserMarkDTO.setQueUsrId(user.getUid().toString()); + + if (isFullAttemptDetailsRequired) { + + // The marks for the user must be listed in the display order of the question. + // Other parts of the code assume that the questions will be in consecutive display + // order starting 1 (e.g. 1, 2, 3, not 1, 3, 4) so we set up an array and use + // the ( display order - 1) as the index (arrays start at 0, rather than 1 hence -1) + // The user must answer all questions, so we can assume that they will have marks + // for all questions or no questions. + // At present there can only be one answer for each question but there may be more + // than one in the future and if so, we don't want to count the mark twice hence + // we need to check if we've already processed this question in the total. + Integer[] userMarks = new Integer[numQuestions]; + String[] answeredOptions = new String[numQuestions]; + Date attemptTime = null; + List finalizedUserAttempts = this.getFinalizedUserAttempts(user); + long totalMark = 0; + for (McUsrAttempt attempt : finalizedUserAttempts) { + Integer displayOrder = attempt.getMcQueContent().getDisplayOrder(); + int arrayIndex = displayOrder != null && displayOrder.intValue() > 0 ? displayOrder.intValue() - 1 + : 1; + if (userMarks[arrayIndex] == null) { + + // We get the mark for the attempt if the answer is correct and we don't allow + // retries, or if the answer is correct and the learner has met the passmark if + // we do allow retries. + boolean isRetries = mcSession.getMcContent().isRetries(); + Integer mark = attempt.getMarkForShow(isRetries); + userMarks[arrayIndex] = mark; + totalMark += mark.intValue(); + + // find out the answered option's sequential letter - A,B,C... + String answeredOptionLetter = ""; + int optionCount = 1; + for (McOptsContent option : (Set) attempt.getMcQueContent() + .getMcOptionsContents()) { + if (attempt.getMcOptionsContent().getUid().equals(option.getUid())) { + answeredOptionLetter = String.valueOf((char) (optionCount + 'A' - 1)); + break; + } + optionCount++; + } + answeredOptions[arrayIndex] = answeredOptionLetter; + } + // get the attempt time, (NB all questions will have the same attempt time) + // Not efficient, since we assign this value for each attempt + attemptTime = attempt.getAttemptTime(); + } + + mcUserMarkDTO.setMarks(userMarks); + mcUserMarkDTO.setAnsweredOptions(answeredOptions); + mcUserMarkDTO.setAttemptTime(attemptTime); + mcUserMarkDTO.setTotalMark(new Long(totalMark)); + + } else { + int totalMark = mcUsrAttemptDAO.getUserTotalMark(user.getUid()); + mcUserMarkDTO.setTotalMark(new Long(totalMark)); + } + + mapSessionUsersData.put(mapIndex.toString(), mcUserMarkDTO); + mapIndex = new Long(mapIndex.longValue() + 1); + } + + mcSessionMarkDTO.setUserMarks(mapSessionUsersData); + listMonitoredMarksContainerDTO.add(mcSessionMarkDTO); + } + + return listMonitoredMarksContainerDTO; + } + public List getFinalizedUserAttempts(final McQueUsr user) throws McApplicationException { try { - List finalizedUserAttempts = (user.isResponseFinalised()) ? mcUsrAttemptDAO - .getUserAttempts(user.getUid()) : new LinkedList(); - return finalizedUserAttempts; + return mcUsrAttemptDAO.getFinalizedUserAttempts(user.getUid()); } catch (DataAccessException e) { throw new McApplicationException( "Exception occured when lams is getting the learner's attempts by user id and que content id and attempt order: " @@ -797,7 +898,7 @@ totalNumberOfUsers += session.getMcQueUsers().size(); } - List sessionMarkDTOs = MonitoringUtil.buildGroupsMarkData(mcContent, this); + List sessionMarkDTOs = this.buildGroupsMarkData(mcContent, true); // create an empty excel file HSSFWorkbook wb = new HSSFWorkbook(); @@ -938,7 +1039,7 @@ } cell = row.createCell(count++); - cell.setCellValue(userMark.getTotalMark()); + cell.setCellValue(new Long(userMark.getTotalMark())); int totalPercents = numberOfCorrectlyAnsweredByUser * 100 / questions.size(); totalPercentList.add(totalPercents); @@ -2039,7 +2140,61 @@ question.setMcContent(toolContentObj); question.setMcContentId(toolContentObj.getUid()); } + + @Override + public List getReflectionList(McContent mcContent, Long userID) { + List reflectionsContainerDTO = new LinkedList(); + if (userID == null) { + // all users mode + for (McSession mcSession : (Set)mcContent.getMcSessions()) { + for (McQueUsr user : (Set)mcSession.getMcQueUsers()) { + + NotebookEntry notebookEntry = this.getEntry(mcSession.getMcSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() + .toString())); + + if (notebookEntry != null) { + ReflectionDTO reflectionDTO = new ReflectionDTO(); + reflectionDTO.setUserId(user.getQueUsrId().toString()); + reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); + reflectionDTO.setUserName(user.getFullname()); + reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); + String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); + reflectionDTO.setEntry(notebookEntryPresentable); + reflectionsContainerDTO.add(reflectionDTO); + } + } + } + } else { + // single user mode + for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { + McSession mcSession = (McSession) sessionIter.next(); + for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { + McQueUsr user = (McQueUsr) userIter.next(); + if (user.getQueUsrId().equals(userID)) { + NotebookEntry notebookEntry = this.getEntry(mcSession.getMcSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() + .toString())); + + if (notebookEntry != null) { + ReflectionDTO reflectionDTO = new ReflectionDTO(); + reflectionDTO.setUserId(user.getQueUsrId().toString()); + reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); + reflectionDTO.setUserName(user.getFullname()); + reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); + String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); + reflectionDTO.setEntry(notebookEntryPresentable); + reflectionsContainerDTO.add(reflectionDTO); + } + } + } + } + } + + return reflectionsContainerDTO; + } + /** Set the description, throws away the title value as this is not supported in 2.0 */ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException, DataMissingException { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -39,6 +39,9 @@ import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; +import org.lamsfoundation.lams.tool.mc.McMonitoredAnswersDTO; +import org.lamsfoundation.lams.tool.mc.McSessionMarkDTO; +import org.lamsfoundation.lams.tool.mc.ReflectionDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; @@ -135,16 +138,16 @@ request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); if (learner != null) { - McMonitoringAction mcMonitoringAction = new McMonitoringAction(); List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionDataForExportLearner(content, mcService, mcSession, learner); request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); request.getSession().setAttribute(LEARNER_MARK, learner.getLastAttemptTotalMark()); request.getSession().setAttribute(LEARNER_NAME, learner.getFullname()); - request.getSession().setAttribute(PASSMARK, content.getPassMark().toString()); - mcMonitoringAction.prepareReflectionData(request, content, mcService, userID.toString(), true); + + List reflectionsContainerDTO = mcService.getReflectionList(content, userID); + request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); } } @@ -177,18 +180,17 @@ throw new McApplicationException(error); } - McMonitoringAction mcMonitoringAction = new McMonitoringAction(); - - List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(content, mcService); + List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(content, mcService); request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); - List listMonitoredMarksContainerDTO = MonitoringUtil.buildGroupsMarkData(content, mcService); + List listMonitoredMarksContainerDTO = mcService.buildGroupsMarkData(content, true); request.getSession().setAttribute(LIST_MONITORED_MARKS_CONTAINER_DTO, listMonitoredMarksContainerDTO); request.getSession().setAttribute(PASSMARK, content.getPassMark().toString()); request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); - mcMonitoringAction.prepareReflectionData(request, content, mcService, null, true); + List reflectionsContainerDTO = mcService.getReflectionList(content, userID); + request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); writeOutSessionData(request, response, content, mcService, directoryName); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -112,9 +112,6 @@ mcGeneralMonitoringDTO.setSummaryToolSessions(populateToolSessions(mcContent)); mcGeneralMonitoringDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString()); - boolean isGroupedActivity = mcService.isGroupedActivity(new Long(toolContentID)); - request.setAttribute("isGroupedActivity", isGroupedActivity); - /* setting editable screen properties */ McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle()); @@ -141,7 +138,8 @@ request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - prepareReflectionData(request, mcContent, mcService, null, false, "All"); + List reflectionsContainerDTO = mcService.getReflectionList(mcContent, null); + request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); if (mcService.studentActivityOccurredGlobal(mcContent)) { // USER_EXCEPTION_NO_TOOL_SESSIONS is set to false @@ -168,10 +166,7 @@ } request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO); - /* find out if there are any reflection entries, from here */ - boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(mcService, mcContent); - - if (notebookEntriesExist) { + if (!reflectionsContainerDTO.isEmpty()) { request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = (String) mcGeneralMonitoringDTO.getUserExceptionNoToolSessions(); @@ -187,8 +182,6 @@ MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO); - MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); - return (mapping.findForward(LOAD_MONITORING_CONTENT)); } @@ -2510,71 +2503,6 @@ } /** - * prepares reflection data - */ - public void prepareReflectionData(HttpServletRequest request, McContent mcContent, IMcService mcService, - String userID, boolean exportMode) { - List reflectionsContainerDTO = new LinkedList(); - - if (userID == null) { - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getUsername()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - - } - } - } else { - // single user mode - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - if (user.getQueUsrId().toString().equals(userID)) { - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getUsername()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - - } - } - } - - } - - request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - - if (exportMode) { - request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - } - } - - /** * allows viewing users reflection data */ public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -2600,159 +2528,7 @@ } /** - * - * @param request - * @param mcContent - * @param mcService - * @param userID - * @param exportMode - * @param currentSessionId */ - public void prepareReflectionData(HttpServletRequest request, McContent mcContent, IMcService mcService, - String userID, boolean exportMode, String currentSessionId) { - - List reflectionsContainerDTO = new LinkedList(); - - reflectionsContainerDTO = getReflectionList(mcContent, userID, mcService); - - request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - - if (exportMode) { - request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); - } - } - - /** - * - * returns reflection data for all sessions - * - * @param mcContent - * @param userID - * @param mcService - * @return - */ - public List getReflectionList(McContent mcContent, String userID, IMcService mcService) { - List reflectionsContainerDTO = new LinkedList(); - if (userID == null) { - // all users mode - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - } else { - // single user mode - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - if (user.getQueUsrId().toString().equals(userID)) { - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - } - } - - return reflectionsContainerDTO; - } - - /** - * returns reflection data for a specific session - */ - public List getReflectionListForSession(McContent mcContent, String userID, IMcService mcService, - String currentSessionId) { - List reflectionsContainerDTO = new LinkedList(); - if (userID == null) { - // all users mode - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - - if (currentSessionId.equals(mcSession.getMcSessionId())) { - - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - } - } else { - // single user mode - for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();) { - McSession mcSession = (McSession) sessionIter.next(); - - if (currentSessionId.equals(mcSession.getMcSessionId())) { - for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();) { - McQueUsr user = (McQueUsr) userIter.next(); - if (user.getQueUsrId().toString().equals(userID)) { - NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(), - CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(user.getQueUsrId() - .toString())); - if (notebookEntry != null) { - ReflectionDTO reflectionDTO = new ReflectionDTO(); - reflectionDTO.setUserId(user.getQueUsrId().toString()); - reflectionDTO.setSessionId(mcSession.getMcSessionId().toString()); - reflectionDTO.setUserName(user.getFullname()); - reflectionDTO.setReflectionUid(notebookEntry.getUid().toString()); - String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry()); - reflectionDTO.setEntry(notebookEntryPresentable); - reflectionsContainerDTO.add(reflectionDTO); - } - } - } - - } - } - } - - return reflectionsContainerDTO; - } - - /** - */ public void prepareEditActivityScreenData(HttpServletRequest request, McContent mcContent) { McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -23,10 +23,12 @@ package org.lamsfoundation.lams.tool.mc.web; import java.io.IOException; +import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import javax.servlet.ServletException; @@ -38,15 +40,18 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.tool.mc.EditActivityDTO; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McComparator; import org.lamsfoundation.lams.tool.mc.McGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.mc.McGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.mc.McQuestionContentDTO; import org.lamsfoundation.lams.tool.mc.McUtils; +import org.lamsfoundation.lams.tool.mc.ReflectionDTO; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; +import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; import org.lamsfoundation.lams.util.WebUtil; @@ -96,30 +101,25 @@ mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); /* - * get the questions section is needed for the Edit tab's View Only mode, starts here + * get the questions section is needed for the Edit tab's View Only mode */ - List listQuestionContentDTO = new LinkedList(); - - Map mapOptionsContent = new TreeMap(new McComparator()); - mapOptionsContent.clear(); - Iterator queIterator = mcContent.getMcQueContents().iterator(); + List listQuestionContentDTO = new LinkedList(); + Map mapOptionsContent = new TreeMap(new McComparator()); Long mapIndex = new Long(1); - while (queIterator.hasNext()) { + for (McQueContent question : (Set)mcContent.getMcQueContents()) { McQuestionContentDTO mcContentDTO = new McQuestionContentDTO(); - McQueContent mcQueContent = (McQueContent) queIterator.next(); - if (mcQueContent != null) { - mapOptionsContent.put(mapIndex.toString(), mcQueContent.getQuestion()); + if (question != null) { + mapOptionsContent.put(mapIndex.toString(), question.getQuestion()); - mcContentDTO.setQuestion(mcQueContent.getQuestion()); - mcContentDTO.setDisplayOrder(mcQueContent.getDisplayOrder().toString()); + mcContentDTO.setQuestion(question.getQuestion()); + mcContentDTO.setDisplayOrder(question.getDisplayOrder().toString()); listQuestionContentDTO.add(mcContentDTO); mapIndex = new Long(mapIndex.longValue() + 1); } } mcGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent); - /* ends here */ request.setAttribute(LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); @@ -132,7 +132,7 @@ mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString()); // The edit activity code needs a session map - SessionMap sessionMap = new SessionMap(); + SessionMap sessionMap = new SessionMap(); mcMonitoringForm.setHttpSessionID(sessionMap.getSessionID()); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); @@ -141,20 +141,74 @@ mcMonitoringForm.setActiveModule(MONITORING); mcGeneralMonitoringDTO.setActiveModule(MONITORING); - - mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); mcGeneralMonitoringDTO.setIsPortfolioExport(new Boolean(false).toString()); /* this section is needed for Edit Activity screen, from here... */ mcGeneralAuthoringDTO.setActivityTitle(mcGeneralMonitoringDTO.getActivityTitle()); mcGeneralAuthoringDTO.setActivityInstructions(mcGeneralMonitoringDTO.getActivityInstructions()); mcGeneralAuthoringDTO.setActiveModule(MONITORING); + request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); + + + McMonitoringAction monitoringAction = new McMonitoringAction(); + monitoringAction.repopulateRequestParameters(request, mcMonitoringForm, mcGeneralMonitoringDTO); + + mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); + + mcGeneralMonitoringDTO.setSummaryToolSessions(monitoringAction.populateToolSessions(mcContent)); + mcGeneralMonitoringDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString()); + + boolean isContentInUse = McUtils.isContentInUse(mcContent); + mcGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); + if (isContentInUse == true) { + // monitoring url does not allow editActivity since the content is in use + mcGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); + } + + List reflectionsContainerDTO = service.getReflectionList(mcContent, null); + request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); + + if (service.studentActivityOccurredGlobal(mcContent)) { + // USER_EXCEPTION_NO_TOOL_SESSIONS is set to false + mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + } else { + // USER_EXCEPTION_NO_TOOL_SESSIONS is set to true + mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); + } + + // getting instructions screen content + mcGeneralMonitoringDTO.setOnlineInstructions(mcContent.getOnlineInstructions()); + mcGeneralMonitoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions()); + List attachmentList = service.retrieveMcUploadedFiles(mcContent); + mcGeneralMonitoringDTO.setAttachmentList(attachmentList); + mcGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); + request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO); - request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - return new McMonitoringAction().commonSubmitSessionCode(mcMonitoringForm, request, mapping, service, - mcGeneralMonitoringDTO); + EditActivityDTO editActivityDTO = new EditActivityDTO(); + if (isContentInUse == true) { + editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); + } + request.setAttribute(EDIT_ACTIVITY_DTO, editActivityDTO); + + // find out if there are any reflection entries + if (!reflectionsContainerDTO.isEmpty()) { + request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + + String userExceptionNoToolSessions = (String) mcGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + + if (userExceptionNoToolSessions.equals("true")) { + // there are no online student activity but there are reflections + request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); + } + } else { + request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(false).toString()); + } + + MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO); + + return (mapping.findForward(LOAD_MONITORING_CONTENT)); } // ************************************************************************************* Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -186,104 +186,7 @@ /** * - * @param request - * @param mcContent - * @param mcService - * @return */ - public static List buildGroupsMarkData(McContent mcContent, IMcService mcService) { - List listMonitoredMarksContainerDTO = new LinkedList(); - Set sessions = mcContent.getMcSessions(); - Iterator sessionsIterator = sessions.iterator(); - int numQuestions = mcContent.getMcQueContents().size(); - - while (sessionsIterator.hasNext()) { - McSession mcSession = sessionsIterator.next(); - - McSessionMarkDTO mcSessionMarkDTO = new McSessionMarkDTO(); - mcSessionMarkDTO.setSessionId(mcSession.getMcSessionId().toString()); - mcSessionMarkDTO.setSessionName(mcSession.getSession_name().toString()); - - Set sessionUsers = mcSession.getMcQueUsers(); - Iterator usersIterator = sessionUsers.iterator(); - - Map mapSessionUsersData = new TreeMap(new McStringComparator()); - Long mapIndex = new Long(1); - - while (usersIterator.hasNext()) { - McQueUsr user = usersIterator.next(); - - McUserMarkDTO mcUserMarkDTO = new McUserMarkDTO(); - mcUserMarkDTO.setSessionId(mcSession.getMcSessionId().toString()); - mcUserMarkDTO.setSessionName(mcSession.getSession_name().toString()); - mcUserMarkDTO.setFullName(user.getFullname()); - mcUserMarkDTO.setUserName(user.getUsername()); - mcUserMarkDTO.setQueUsrId(user.getUid().toString()); - - // The marks for the user must be listed in the display order of the question. - // Other parts of the code assume that the questions will be in consecutive display - // order starting 1 (e.g. 1, 2, 3, not 1, 3, 4) so we set up an array and use - // the ( display order - 1) as the index (arrays start at 0, rather than 1 hence -1) - // The user must answer all questions, so we can assume that they will have marks - // for all questions or no questions. - // At present there can only be one answer for each question but there may be more - // than one in the future and if so, we don't want to count the mark twice hence - // we need to check if we've already processed this question in the total. - Integer[] userMarks = new Integer[numQuestions]; - String[] answeredOptions = new String[numQuestions]; - Date attemptTime = null; - List finalizedUserAttempts = mcService.getFinalizedUserAttempts(user); - long totalMark = 0; - for (McUsrAttempt attempt : finalizedUserAttempts) { - Integer displayOrder = attempt.getMcQueContent().getDisplayOrder(); - int arrayIndex = displayOrder != null && displayOrder.intValue() > 0 ? displayOrder.intValue() - 1 - : 1; - if (userMarks[arrayIndex] == null) { - - // We get the mark for the attempt if the answer is correct and we don't allow - // retries, or if the answer is correct and the learner has met the passmark if - // we do allow retries. - boolean isRetries = mcSession.getMcContent().isRetries(); - Integer mark = attempt.getMarkForShow(isRetries); - userMarks[arrayIndex] = mark; - totalMark += mark.intValue(); - - // find out the answered option's sequential letter - A,B,C... - String answeredOptionLetter = ""; - int optionCount = 1; - for (McOptsContent option : (Set) attempt.getMcQueContent().getMcOptionsContents()) { - if (attempt.getMcOptionsContent().getUid().equals(option.getUid())) { - answeredOptionLetter = String.valueOf((char) (optionCount + 'A' - 1)); - break; - } - optionCount++; - } - answeredOptions[arrayIndex] = answeredOptionLetter; - } - // get the attempt time, (NB all questions will have the same attempt time) - // Not efficient, since we assign this value for each attempt - attemptTime = attempt.getAttemptTime(); - } - - mcUserMarkDTO.setMarks(userMarks); - mcUserMarkDTO.setAnsweredOptions(answeredOptions); - mcUserMarkDTO.setAttemptTime(attemptTime); - mcUserMarkDTO.setTotalMark(new Long(totalMark)); - - mapSessionUsersData.put(mapIndex.toString(), mcUserMarkDTO); - mapIndex = new Long(mapIndex.longValue() + 1); - } - - mcSessionMarkDTO.setUserMarks(mapSessionUsersData); - listMonitoredMarksContainerDTO.add(mcSessionMarkDTO); - } - - return listMonitoredMarksContainerDTO; - } - - /** - * - */ public static McMonitoredUserDTO getUserAttempt(IMcService mcService, McQueUsr mcQueUsr, McSession mcSession, Long questionUid) { @@ -437,20 +340,17 @@ * Sets up auxiliary parameters. Used by all monitoring action methods. * * @param request - * @param mcContent + * @param content * @param mcService */ - protected static void setupAllSessionsData(HttpServletRequest request, McContent mcContent, IMcService mcService) { - List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(mcContent, mcService); - request.setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); - - List listMonitoredMarksContainerDTO = MonitoringUtil.buildGroupsMarkData(mcContent, mcService); + protected static void setupAllSessionsData(HttpServletRequest request, McContent content, IMcService mcService) { + List listMonitoredMarksContainerDTO = mcService.buildGroupsMarkData(content, false); request.setAttribute(LIST_MONITORED_MARKS_CONTAINER_DTO, listMonitoredMarksContainerDTO); - request.setAttribute(HR_COLUMN_COUNT, new Integer(mcContent.getMcQueContents().size() + 2).toString()); + request.setAttribute(HR_COLUMN_COUNT, new Integer(content.getMcQueContents().size() + 2).toString()); String strPassMark = ""; - Integer passMark = mcContent.getPassMark(); + Integer passMark = content.getPassMark(); if (passMark == null) strPassMark = " "; else if ((passMark != null) && (passMark.equals("0"))) @@ -461,28 +361,30 @@ strPassMark = " "; request.setAttribute(PASSMARK, strPassMark); - // setting up the advanced summary for LDEV-1662 - request.setAttribute("questionsSequenced", mcContent.isQuestionsSequenced()); - request.setAttribute("showMarks", mcContent.isShowMarks()); - request.setAttribute("randomize", mcContent.isRandomize()); - request.setAttribute("displayAnswers", mcContent.isDisplayAnswers()); - request.setAttribute("retries", mcContent.isRetries()); - request.setAttribute("reflect", mcContent.isReflect()); - request.setAttribute("reflectionSubject", mcContent.getReflectionSubject()); - request.setAttribute("passMark", mcContent.getPassMark()); - request.setAttribute("toolContentID", mcContent.getMcContentId()); + // setting up the advanced summary + + request.setAttribute(ATTR_CONTENT, content); + request.setAttribute("questionsSequenced", content.isQuestionsSequenced()); + request.setAttribute("showMarks", content.isShowMarks()); + request.setAttribute("randomize", content.isRandomize()); + request.setAttribute("displayAnswers", content.isDisplayAnswers()); + request.setAttribute("retries", content.isRetries()); + request.setAttribute("reflect", content.isReflect()); + request.setAttribute("reflectionSubject", content.getReflectionSubject()); + request.setAttribute("passMark", content.getPassMark()); + request.setAttribute("toolContentID", content.getMcContentId()); // setting up Date and time restriction in activities HttpSession ss = SessionManager.getSession(); - Date submissionDeadline = mcContent.getSubmissionDeadline(); + Date submissionDeadline = content.getSubmissionDeadline(); if (submissionDeadline != null) { UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER); TimeZone learnerTimeZone = learnerDto.getTimeZone(); Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); request.setAttribute("submissionDeadline", tzSubmissionDeadline.getTime()); } - boolean isGroupedActivity = mcService.isGroupedActivity(new Long(mcContent.getMcContentId())); + boolean isGroupedActivity = mcService.isGroupedActivity(new Long(content.getMcContentId())); request.setAttribute("isGroupedActivity", isGroupedActivity); } } Index: lams_tool_lamc/web/monitoring/SummaryContent.jsp =================================================================== diff -u -rab8fc22488ee451542732a76b27e6b85f55702cd -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision ab8fc22488ee451542732a76b27e6b85f55702cd) +++ lams_tool_lamc/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -142,6 +142,7 @@ <%@ include file="parts/advanceOptions.jsp"%> <%@ include file="parts/dateRestriction.jsp"%> +<%@ include file="parts/advanceQuestions.jsp"%> @@ -153,25 +154,8 @@ - - - - -

- -

-
- -

-
- - - - -

-
-
- + +

Index: lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r45dc9d53a03937ef25d6a8fa6c383c046f5df9f3 --- lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp (.../advanceOptions.jsp) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp (.../advanceOptions.jsp) (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -131,46 +131,21 @@ - - - - - - - - + + +

+ +

+
+ +

+
+ + + + +

+
+
-
- - - - - - - - - - - -
: -   ( ) -
- - - - - - -
-         - - - -   () - -
-
- : -
-
Index: lams_tool_lamc/web/monitoring/parts/advanceQuestions.jsp =================================================================== diff -u --- lams_tool_lamc/web/monitoring/parts/advanceQuestions.jsp (revision 0) +++ lams_tool_lamc/web/monitoring/parts/advanceQuestions.jsp (revision 45dc9d53a03937ef25d6a8fa6c383c046f5df9f3) @@ -0,0 +1,53 @@ +

+ + + + + +

+
+ + + \ No newline at end of file