Index: lams_tool_lamc/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.40 -r1.41 --- lams_tool_lamc/conf/language/lams/ApplicationResources_en_AU.properties 31 Aug 2013 11:49:57 -0000 1.40 +++ lams_tool_lamc/conf/language/lams/ApplicationResources_en_AU.properties 3 Sep 2013 16:56:42 -0000 1.41 @@ -282,6 +282,11 @@ label.ave =Average label.class.mean =Class Mean label.median =Median +label.monitoring.summary.user.name =Name +label.monitoring.summary.total =Total +label.monitoring.summary.learner.summary =Learner summary +label.monitoring.user.summary.response =Response +label.monitoring.user.summary.grade =Grade #======= End labels: Exported 276 labels for en AU ===== Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java,v diff -u -r1.107 -r1.108 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 12 Aug 2013 16:29:02 -0000 1.107 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 3 Sep 2013 16:56:41 -0000 1.108 @@ -104,6 +104,7 @@ public static final String REFLECTION_SUBJECT = "reflectionSubject"; public static final String REFLECTIONS_CONTAINER_DTO = "reflectionsContainerDTO"; public static final String LEARNER_NOTEBOOK = "learnerNotebook"; + public static final String USER_MASTER_DETAIL = "userMasterDetail"; /* * authoring mode controllers @@ -234,7 +235,6 @@ public static final String MAP_TOOL_SESSIONS = "mapToolSessions"; public static final Integer MAX_TOOL_SESSION_COUNT = new Integer(500); - public static final String IS_TOOL_SESSION_CHANGED = "isToolSessionChanged"; public static final String OPTION_OFF = "false"; public static final String ACTIVITY_TITLE = "activityTitle"; public static final String ACTIVITY_INSTRUCTIONS = "activityInstructions"; @@ -289,6 +289,11 @@ public static final String CURRENT_MONITORING_TAB = "currentMonitoringTab"; public static final String REPORT_TITLE_MONITOR = "reportTitleMonitor"; public static final String MONITOR_USER_ID = "userId"; + public static final String USER_UID = "userUid"; + public static final String USER_ATTEMPTS = "userAttempts"; + public static final String PARAM_NOT_A_NUMBER = "nan"; + public static final String PARAM_GRADE = "grade"; + public static final String PARAM_USER_ATTEMPT_UID = "userAttemptUid"; public static final String MONITORING_REPORT = "monitoringReport"; public static final String MONITORING_ERROR = "monitoringError"; public static final String MAP_MONITORING_QUESTIONS = "mapMonitoringQuestions"; @@ -298,9 +303,6 @@ public static final String MONITORED_CONTENT_ID = "monitoredContentId"; public static final String EDITACTIVITY_EDITMODE = "editActivityEditMode"; public static final String FORM_INDEX = "formIndex"; - public static final String CURRENT_MONITORED_TOOL_SESSION = "currentMonitoredToolSession"; - public static final String CURRENT_MONITORED_TOOL_SESSION_NAME = "currentMonitoredToolSessionName"; - public static final String SELECTION_CASE = "selectionCase"; public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO = "listMonitoredAnswersContainerDto"; public static final String LIST_GROUPING_DATA = "listGroupingData"; public static final String LEARNER_NAME = "learnerName"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java,v diff -u -r1.6 -r1.7 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java 8 May 2013 13:18:25 -0000 1.6 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java 3 Sep 2013 16:56:41 -0000 1.7 @@ -60,10 +60,7 @@ protected Integer countSessionComplete; protected String isPortfolioExport; protected String groupName; - protected String currentMonitoredToolSession; - protected Long selectionCase; protected String existsOpenMcs; - protected String isToolSessionChanged; protected String responseId; protected String currentUid; protected String displayAnswers; @@ -73,7 +70,6 @@ protected Map summaryToolSessions; protected List listMonitoredAnswersContainerDto; protected List listUserEntries; - protected String selectedToolSessionId; protected String richTextOnlineInstructions; protected String richTextOfflineInstructions; @@ -474,36 +470,6 @@ } /** - * @return Returns the selectionCase. - */ - public Long getSelectionCase() { - return selectionCase; - } - - /** - * @param selectionCase - * The selectionCase to set. - */ - public void setSelectionCase(Long selectionCase) { - this.selectionCase = selectionCase; - } - - /** - * @return Returns the currentMonitoredToolSession. - */ - public String getCurrentMonitoredToolSession() { - return currentMonitoredToolSession; - } - - /** - * @param currentMonitoredToolSession - * The currentMonitoredToolSession to set. - */ - public void setCurrentMonitoredToolSession(String currentMonitoredToolSession) { - this.currentMonitoredToolSession = currentMonitoredToolSession; - } - - /** * @return Returns the groupName. */ public String getGroupName() { @@ -564,21 +530,6 @@ } /** - * @return Returns the selectedToolSessionId. - */ - public String getSelectedToolSessionId() { - return selectedToolSessionId; - } - - /** - * @param selectedToolSessionId - * The selectedToolSessionId to set. - */ - public void setSelectedToolSessionId(String selectedToolSessionId) { - this.selectedToolSessionId = selectedToolSessionId; - } - - /** * @return Returns the listMcAllSessionsDTO. */ public List getListMcAllSessionsDTO() { @@ -684,21 +635,6 @@ } /** - * @return Returns the isToolSessionChanged. - */ - public String getIsToolSessionChanged() { - return isToolSessionChanged; - } - - /** - * @param isToolSessionChanged - * The isToolSessionChanged to set. - */ - public void setIsToolSessionChanged(String isToolSessionChanged) { - this.isToolSessionChanged = isToolSessionChanged; - } - - /** * @return Returns the responseId. */ public String getResponseId() { @@ -776,8 +712,7 @@ public String toString() { return new ToStringBuilder(this).append("toolContentID: ", toolContentID) .append("activeModule: ", activeModule).append("monitoredContentInUse: ", monitoredContentInUse) - .append("currentMonitoringTab: ", currentMonitoringTab).append("selectionCase: ", selectionCase) - .append("isToolSessionChanged: ", isToolSessionChanged).append("currentTab: ", currentTab) + .append("currentMonitoringTab: ", currentMonitoringTab).append("currentTab: ", currentTab) .append("sbmtSuccess: ", sbmtSuccess).append("defineLaterInEditMode: ", defineLaterInEditMode) .append("requestLearningReport: ", requestLearningReport) .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) @@ -789,10 +724,9 @@ .append("defaultOptionContent: ", defaultOptionContent).append("countAllUsers: ", countAllUsers) .append("countSessionComplete: ", countSessionComplete) .append("isPortfolioExport: ", isPortfolioExport).append("summaryToolSessions: ", summaryToolSessions) - .append("currentMonitoredToolSession: ", currentMonitoredToolSession).append("groupName: ", groupName) + .append("groupName: ", groupName) .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) .append("listUserEntries: ", listUserEntries).append("existsOpenMcs: ", existsOpenMcs) - .append("selectedToolSessionId: ", selectedToolSessionId) .append("listMcAllSessionsDTO: ", listMcAllSessionsDTO) .append("richTextOnlineInstructions: ", richTextOnlineInstructions) .append("richTextOfflineInstructions: ", richTextOfflineInstructions) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java 26 Aug 2013 11:03:49 -0000 1.8 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java 3 Sep 2013 16:56:41 -0000 1.9 @@ -124,7 +124,7 @@ public void setFullName(String fullName) { this.fullName = fullName; } - + public int compareTo(Object o) { McUserMarkDTO mcUserMarkDTO = (McUserMarkDTO) o; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java,v diff -u -r1.58 -r1.59 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 12 Aug 2013 16:29:02 -0000 1.58 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 3 Sep 2013 16:56:41 -0000 1.59 @@ -311,7 +311,6 @@ request.getSession().removeAttribute(COMPLETED); request.getSession().removeAttribute(MAP_TOOL_SESSIONS); request.getSession().removeAttribute(MAX_TOOL_SESSION_COUNT.toString()); - request.getSession().removeAttribute(IS_TOOL_SESSION_CHANGED); request.getSession().removeAttribute(ADD_NEW_QUESTION); request.getSession().removeAttribute(OPTION_OFF); request.getSession().removeAttribute(REMOVE_QUESTION); @@ -350,7 +349,6 @@ request.getSession().removeAttribute(MONITORED_CONTENT_ID); request.getSession().removeAttribute(EDITACTIVITY_EDITMODE); request.getSession().removeAttribute(FORM_INDEX); - request.getSession().removeAttribute(SELECTION_CASE); request.getSession().removeAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO); request.getSession().removeAttribute(QUESTION_LISTING_MODE); request.getSession().removeAttribute(QUESTION_LISTING_MODE_SEQUENTIAL); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java,v diff -u -r1.22 -r1.23 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java 26 Aug 2013 11:03:49 -0000 1.22 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUsrAttemptDAO.java 3 Sep 2013 16:56:41 -0000 1.23 @@ -89,5 +89,7 @@ * @return */ int getAttemptsCountPerOption(Long optionUid); + + McUsrAttempt getUserAttemptByUid(Long uid); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java,v diff -u -r1.26 -r1.27 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java 26 Aug 2013 11:03:49 -0000 1.26 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java 3 Sep 2013 16:56:42 -0000 1.27 @@ -26,6 +26,7 @@ import org.hibernate.FlushMode; import org.lamsfoundation.lams.tool.mc.dao.IMcUsrAttemptDAO; +import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McUsrAttempt; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -54,8 +55,13 @@ 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"; - + @Override + public McUsrAttempt getUserAttemptByUid(Long uid) { + return (McUsrAttempt) this.getHibernateTemplate().get(McUsrAttempt.class, uid); + } + + @Override public void saveMcUsrAttempt(McUsrAttempt mcUsrAttempt) { this.getHibernateTemplate().save(mcUsrAttempt); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java 12 Aug 2013 16:29:03 -0000 1.8 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java 3 Sep 2013 16:56:41 -0000 1.9 @@ -55,8 +55,10 @@ /** persistent field */ private org.lamsfoundation.lams.tool.mc.pojos.McQueContent mcQueContent; - //DTO field + //DTO fields private boolean selected; + + private String escapedOptionText; public McOptsContent(Integer displayOrder, boolean correctOption, String mcQueOptionText, org.lamsfoundation.lams.tool.mc.pojos.McQueContent mcQueContent) { @@ -175,4 +177,12 @@ public void setSelected(boolean selected) { this.selected = selected; } + + public String getEscapedOptionText() { + return this.escapedOptionText; + } + + public void setEscapedOptionText(String escapedOptionText) { + this.escapedOptionText = escapedOptionText; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java,v diff -u -r1.11 -r1.12 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java 28 May 2013 11:52:51 -0000 1.11 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java 3 Sep 2013 16:56:41 -0000 1.12 @@ -68,6 +68,10 @@ /** persistent field */ private Set mcOptionsContents; + //DTO fields + + private String escapedQuestion; + public McQueContent(String question, Integer displayOrder, Integer mark, String feedback, McContent mcContent, Set mcUsrAttempts, Set mcOptionsContents) { this.question = question; @@ -245,4 +249,12 @@ public void setMark(Integer mark) { this.mark = mark; } + + public String getEscapedQuestion() { + return this.escapedQuestion; + } + + public void setEscapedQuestion(String escapedQuestion) { + this.escapedQuestion = escapedQuestion; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUsrAttempt.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUsrAttempt.java,v diff -u -r1.10 -r1.11 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUsrAttempt.java 12 Aug 2013 16:29:03 -0000 1.10 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUsrAttempt.java 3 Sep 2013 16:56:41 -0000 1.11 @@ -205,11 +205,14 @@ * correct If retries and passmark is on, then we only want the marks if the user has passed! */ public Integer getMarkForShow(boolean allowRetries) { - if (isAttemptCorrect() && (!allowRetries || (allowRetries && isPassed()))) { - return getMark(); - } else { - return new Integer(0); - } + //TODO check if we really allowed to return full mark +// if (isAttemptCorrect() && (!allowRetries || (allowRetries && isPassed()))) { +// return getMark(); +// } else { +// return new Integer(0); +// } + + return getMark(); } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java,v diff -u -r1.70 -r1.71 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 26 Aug 2013 11:03:49 -0000 1.70 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 3 Sep 2013 16:56:41 -0000 1.71 @@ -242,15 +242,12 @@ /** * prepareSessionDataSpreadsheet * - * @param request - * @param response * @param mcContent - * @param mcService - * @param currentMonitoredToolSession * * @return data to write out */ - byte[] prepareSessionDataSpreadsheet(HttpServletRequest request, McContent mcContent, - String currentMonitoredToolSession) throws IOException; + byte[] prepareSessionDataSpreadsheet(McContent mcContent) throws IOException; + + void changeUserAttemptMark(Long userAttemptUid, Integer newMark); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java,v diff -u -r1.112 -r1.113 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 26 Aug 2013 11:03:49 -0000 1.112 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 3 Sep 2013 16:56:41 -0000 1.113 @@ -27,7 +27,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Hashtable; @@ -40,7 +39,6 @@ import java.util.TreeSet; import java.util.Vector; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; @@ -760,8 +758,15 @@ } @Override - public byte[] prepareSessionDataSpreadsheet(HttpServletRequest request, McContent mcContent, - String currentMonitoredToolSession) throws IOException { + public void changeUserAttemptMark(Long userAttemptUid, Integer newMark) { + McUsrAttempt userAttempt = mcUsrAttemptDAO.getUserAttemptByUid(userAttemptUid); + float oldMark = userAttempt.getMark(); + userAttempt.setMark(newMark); + mcUsrAttemptDAO.saveMcUsrAttempt(userAttempt); + } + + @Override + public byte[] prepareSessionDataSpreadsheet(McContent mcContent) throws IOException { Set questions = mcContent.getMcQueContents(); int maxOptionsInQuestion = 0; @@ -1001,58 +1006,54 @@ for (McSessionMarkDTO sessionMarkDTO : sessionMarkDTOs) { Map usersMarksMap = sessionMarkDTO.getUserMarks(); - String currentSessionId = sessionMarkDTO.getSessionId(); String currentSessionName = sessionMarkDTO.getSessionName(); - if (currentMonitoredToolSession.equals("All") || currentMonitoredToolSession.equals(currentSessionId)) { + row = sheet.createRow(rowCount++); - row = sheet.createRow(rowCount++); + cell = row.createCell(0); + cell.setCellValue(messageService.getMessage("group.label")); - cell = row.createCell(0); - cell.setCellValue(messageService.getMessage("group.label")); + cell = row.createCell(1); + cell.setCellValue(currentSessionName); + cell.setCellStyle(greenColor); - cell = row.createCell(1); - cell.setCellValue(currentSessionName); - cell.setCellStyle(greenColor); + rowCount++; + count = 0; - rowCount++; - count = 0; + row = sheet.createRow(rowCount++); + cell = row.createCell(count++); + cell.setCellValue(messageService.getMessage("label.learner")); + + cell = row.createCell(count++); + cell.setCellValue(messageService.getMessage("label.monitoring.downloadMarks.username")); + + cell = row.createCell(questions.size() + 2); + cell.setCellValue(messageService.getMessage("label.total")); + + for (McUserMarkDTO userMark : usersMarksMap.values()) { row = sheet.createRow(rowCount++); + count = 0; cell = row.createCell(count++); - cell.setCellValue(messageService.getMessage("label.learner")); + cell.setCellValue(userMark.getFullName()); cell = row.createCell(count++); - cell.setCellValue(messageService.getMessage("label.monitoring.downloadMarks.username")); + cell.setCellValue(userMark.getUserName()); - cell = row.createCell(questions.size() + 2); - cell.setCellValue(messageService.getMessage("label.total")); - - for (McUserMarkDTO userMark : usersMarksMap.values()) { - row = sheet.createRow(rowCount++); - count = 0; - + Integer[] marks = userMark.getMarks(); + for (int i = 0; i < marks.length; i++) { cell = row.createCell(count++); - cell.setCellValue(userMark.getFullName()); - - cell = row.createCell(count++); - cell.setCellValue(userMark.getUserName()); - - Integer[] marks = userMark.getMarks(); - for (int i = 0; i < marks.length; i++) { - cell = row.createCell(count++); - Integer mark = (marks[i] == null) ? 0 : marks[i]; - cell.setCellValue(mark); - } - - cell = row.createCell(count++); - cell.setCellValue(userMark.getTotalMark()); + Integer mark = (marks[i] == null) ? 0 : marks[i]; + cell.setCellValue(mark); } - rowCount++; + cell = row.createCell(count++); + cell.setCellValue(userMark.getTotalMark()); } + rowCount++; + } ByteArrayOutputStream bos = new ByteArrayOutputStream(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java,v diff -u -r1.22 -r1.23 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 26 Aug 2013 11:03:49 -0000 1.22 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 3 Sep 2013 16:56:41 -0000 1.23 @@ -208,7 +208,7 @@ try { out = new FileOutputStream(directoryName + File.separator + fileName); - byte[] spreadsheet = mcService.prepareSessionDataSpreadsheet(request, mcContent, "All"); + byte[] spreadsheet = mcService.prepareSessionDataSpreadsheet(mcContent); out.write(spreadsheet); request.getSession().setAttribute(PORTFOLIO_EXPORT_DATA_FILENAME, fileName); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java,v diff -u -r1.53 -r1.54 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 26 Aug 2013 11:03:49 -0000 1.53 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java 3 Sep 2013 16:56:41 -0000 1.54 @@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts.Globals; import org.apache.struts.action.ActionForm; @@ -63,6 +64,7 @@ import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile; +import org.lamsfoundation.lams.tool.mc.pojos.McUsrAttempt; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; import org.lamsfoundation.lams.util.DateUtil; @@ -75,28 +77,9 @@ /** * * @author Ozgur Demirtas - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * */ public class McMonitoringAction extends LamsDispatchAction implements McAppConstants { - static Logger logger = Logger.getLogger(McMonitoringAction.class.getName()); + private static Logger logger = Logger.getLogger(McMonitoringAction.class.getName()); /** * main content/question content management and workflow logic @@ -108,49 +91,21 @@ } /** - * @param form - * @param request - * @param mcService - * @param mcGeneralMonitoringDTO - * @throws IOException - * @throws ServletException + * */ protected ActionForward commonSubmitSessionCode(McMonitoringForm mcMonitoringForm, HttpServletRequest request, ActionMapping mapping, IMcService mcService, McGeneralMonitoringDTO mcGeneralMonitoringDTO) throws IOException, ServletException { repopulateRequestParameters(request, mcMonitoringForm, mcGeneralMonitoringDTO); - String currentMonitoredToolSession = request.getParameter("monitoredToolSessionId"); - - if (currentMonitoredToolSession == null) { - // default to All - currentMonitoredToolSession = "All"; - } - String toolContentID = mcMonitoringForm.getToolContentID(); McContent mcContent = mcService.retrieveMc(new Long(toolContentID)); - if (currentMonitoredToolSession.equals("All")) { - // generate DTO for All sessions - MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); + // generate DTO for All sessions + MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); - mcGeneralMonitoringDTO.setSelectionCase(new Long(2)); - request.setAttribute(SELECTION_CASE, new Long(2)); - } else { - McSession mcSession = mcService.getMcSessionById(new Long(currentMonitoredToolSession)); - - MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); - - mcGeneralMonitoringDTO.setGroupName(mcSession.getSession_name()); - mcGeneralMonitoringDTO.setSelectionCase(new Long(1)); - request.setAttribute(SELECTION_CASE, new Long(1)); - } - - request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); - - mcGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); mcGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString()); mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); @@ -264,14 +219,6 @@ /** * * submitSession - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -285,14 +232,6 @@ /** * displayAnswers - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward displayAnswers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -305,18 +244,7 @@ } /** - * editActivityQuestions - * * enables swiching to editable mode in the Edit Activity tab - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - * @throws ToolException */ public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { @@ -356,7 +284,9 @@ mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { // monitoring url does not allow editActivity since the content is in use - persistError(request, "error.content.inUse"); + ActionMessages errors = new ActionMessages(); + errors.add(Globals.ERROR_KEY, new ActionMessage("error.content.inUse")); + saveErrors(request, errors); mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -444,28 +374,8 @@ } /** - * persists error messages to request scope * - * @param request - * @param message - */ - public void persistError(HttpServletRequest request, String message) { - ActionMessages errors = new ActionMessages(); - errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - saveErrors(request, errors); - } - - /** - * submits content into the tool database - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -677,13 +587,6 @@ /** * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -856,16 +759,6 @@ /** * - * @param request - * @param mcGeneralAuthoringDTO - * @param mcAuthoringForm - * @param sessionMap - * @param activeModule - * @param strToolContentID - * @param defaultContentIdStr - * @param mcService - * @param httpSessionID - * @param listQuestionContentDTO */ protected void commonSaveCode(HttpServletRequest request, McGeneralAuthoringDTO mcGeneralAuthoringDTO, McAuthoringForm mcAuthoringForm, SessionMap sessionMap, String activeModule, String strToolContentID, @@ -923,13 +816,6 @@ /** * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1056,19 +942,7 @@ } /** - * newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - * * opens up an new screen within the current page for adding a new question - * - * newQuestionBox - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1168,14 +1042,6 @@ /** * opens up an new screen within the current page for editing a question - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1308,14 +1174,6 @@ /** * removes a question from the questions map - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1428,16 +1286,6 @@ /** * moves a question down in the list - * - * moveQuestionDown - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1524,13 +1372,6 @@ /** * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1615,14 +1456,6 @@ /** * moves a candidate dwn in the list - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1771,14 +1604,6 @@ /** * * moves a candidate up in the list - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward moveCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -1920,14 +1745,6 @@ /** * removes a candidate from the list - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -2067,14 +1884,6 @@ /** * * enables adding a new candidate answer - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -2702,12 +2511,6 @@ /** * prepares reflection data - * - * @param request - * @param mcContent - * @param mcService - * @param userID - * @param exportMode */ public void prepareReflectionData(HttpServletRequest request, McContent mcContent, IMcService mcService, String userID, boolean exportMode) { @@ -2773,15 +2576,6 @@ /** * allows viewing users reflection data - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - * @throws ToolException */ public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { @@ -2894,12 +2688,6 @@ /** * returns reflection data for a specific session - * - * @param mcContent - * @param userID - * @param mcService - * @param currentSessionId - * @return */ public List getReflectionListForSession(McContent mcContent, String userID, IMcService mcService, String currentSessionId) { @@ -2964,10 +2752,6 @@ } /** - * prepareEditActivityScreenData - * - * @param request - * @param mcContent */ public void prepareEditActivityScreenData(HttpServletRequest request, McContent mcContent) { McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); @@ -2978,10 +2762,6 @@ } /** - * - * @param request - * @param mcMonitoringForm - * @param mcGeneralMonitoringDTO */ protected void repopulateRequestParameters(HttpServletRequest request, McMonitoringForm mcMonitoringForm, McGeneralMonitoringDTO mcGeneralMonitoringDTO) { @@ -2998,10 +2778,6 @@ mcMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); mcGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); - String isToolSessionChanged = request.getParameter(IS_TOOL_SESSION_CHANGED); - mcMonitoringForm.setIsToolSessionChanged(isToolSessionChanged); - mcGeneralMonitoringDTO.setIsToolSessionChanged(isToolSessionChanged); - String responseId = request.getParameter(RESPONSE_ID); mcMonitoringForm.setResponseId(responseId); mcGeneralMonitoringDTO.setResponseId(responseId); @@ -3013,9 +2789,6 @@ /** * - * @param mcContent - * @param mcService - * @param request */ protected void setupCommonScreenData(McContent mcContent, IMcService mcService, HttpServletRequest request) { /* setting up USER_EXCEPTION_NO_TOOL_SESSIONS, from here */ @@ -3063,20 +2836,11 @@ /** * downloadMarks - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException */ public ActionForward downloadMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { MessageService messageService = getMessageService(); - String currentMonitoredToolSession = request.getParameter("monitoredToolSessionId"); McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); @@ -3087,7 +2851,7 @@ byte[] spreadsheet = null; try { - spreadsheet = mcService.prepareSessionDataSpreadsheet(request, mcContent, currentMonitoredToolSession); + spreadsheet = mcService.prepareSessionDataSpreadsheet(mcContent); } catch (Exception e) { log.error("Error preparing spreadsheet: ", e); request.setAttribute("errorName", messageService.getMessage("error.monitoring.spreadsheet.download")); @@ -3097,7 +2861,7 @@ // construct download file response header OutputStream out = response.getOutputStream(); - String fileName = "lams_mcq_" + currentMonitoredToolSession + ".xls"; + String fileName = "lams_mcq.xls"; String mineType = "application/vnd.ms-excel"; String header = "attachment; filename=\"" + fileName + "\";"; response.setContentType(mineType); @@ -3120,20 +2884,14 @@ /** * Set Submission Deadline - * - * @param mapping - * @param form - * @param request - * @param response - * @return */ public ActionForward setSubmissionDeadline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + IMcService service = McServiceProxy.getMcService(getServlet().getServletContext()); Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - McContent mcContent = mcService.retrieveMc(contentID); + McContent mcContent = service.retrieveMc(contentID); Long dateParameter = WebUtil.readLongParam(request, McAppConstants.ATTR_SUBMISSION_DEADLINE, true); Date tzSubmissionDeadline = null; @@ -3146,11 +2904,52 @@ tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); } mcContent.setSubmissionDeadline(tzSubmissionDeadline); - mcService.updateMc(mcContent); + service.updateMc(mcContent); return null; } + + /** + * Populate user jqgrid table on summary page. + */ + public ActionForward userMasterDetail(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + + Long userUid = WebUtil.readLongParam(request, McAppConstants.USER_UID); + McQueUsr user = mcService.getMcUserByUID(userUid); + List userAttempts = mcService.getFinalizedUserAttempts(user); + if (userAttempts != null) { + for (McUsrAttempt userAttempt : userAttempts) { + MonitoringUtil.escapeQuotes(userAttempt); + } + } + + request.setAttribute(McAppConstants.USER_ATTEMPTS, userAttempts); + request.setAttribute(McAppConstants.TOOL_SESSION_ID, user.getMcSession().getMcSessionId()); + return (userAttempts == null || userAttempts.isEmpty()) ? null : mapping.findForward(McAppConstants.USER_MASTER_DETAIL); + } + + public ActionForward saveUserMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + if ((request.getParameter(McAppConstants.PARAM_NOT_A_NUMBER) == null) + && !StringUtils.isEmpty(request.getParameter(McAppConstants.PARAM_USER_ATTEMPT_UID))) { + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + + Long userAttemptUid = WebUtil.readLongParam(request, McAppConstants.PARAM_USER_ATTEMPT_UID); + Integer newGrade = Integer.valueOf(request.getParameter(McAppConstants.PARAM_GRADE)); + mcService.changeUserAttemptMark(userAttemptUid, newGrade); + } + + return null; + } + + // ************************************************************************************* + // Private methods + // ************************************************************************************* + /** * Return ResourceService bean. */ Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringForm.java,v diff -u -r1.10 -r1.11 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringForm.java 8 May 2013 13:18:25 -0000 1.10 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringForm.java 3 Sep 2013 16:56:41 -0000 1.11 @@ -32,45 +32,11 @@ public class McMonitoringForm extends McAuthoringForm implements McAppConstants { protected String method; - protected String selectedToolSessionId; - - protected String isToolSessionChanged; - private String currentUid; private String editResponse; /** - * @return Returns the isToolSessionChanged. - */ - public String getIsToolSessionChanged() { - return isToolSessionChanged; - } - - /** - * @param isToolSessionChanged - * The isToolSessionChanged to set. - */ - public void setIsToolSessionChanged(String isToolSessionChanged) { - this.isToolSessionChanged = isToolSessionChanged; - } - - /** - * @return Returns the selectedToolSessionId. - */ - public String getSelectedToolSessionId() { - return selectedToolSessionId; - } - - /** - * @param selectedToolSessionId - * The selectedToolSessionId to set. - */ - public void setSelectedToolSessionId(String selectedToolSessionId) { - this.selectedToolSessionId = selectedToolSessionId; - } - - /** * @return Returns the method. */ public String getMethod() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java,v diff -u -r1.48 -r1.49 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 8 May 2013 13:18:25 -0000 1.48 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 3 Sep 2013 16:56:41 -0000 1.49 @@ -34,13 +34,10 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; -import org.apache.struts.Globals; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; import org.lamsfoundation.lams.tool.mc.McComparator; @@ -57,35 +54,21 @@ import org.lamsfoundation.lams.web.util.SessionMap; /** - * *

* Starts up the monitoring module *

* * @author Ozgur Demirtas - * - * - * - * - * - * - * - * - * - * - * */ - public class McMonitoringStarterAction extends Action implements McAppConstants { - static Logger logger = Logger.getLogger(McMonitoringStarterAction.class.getName()); + private static Logger logger = Logger.getLogger(McMonitoringStarterAction.class.getName()); + private static IMcService service; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { + initializeMcService(); McUtils.cleanUpSessionAbsolute(request); - IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO(); McGeneralMonitoringDTO mcGeneralMonitoringDTO = new McGeneralMonitoringDTO(); @@ -102,49 +85,7 @@ throw (e); } - initialiseMonitoringData(mapping, form, request, response, mcService, mcGeneralMonitoringDTO); - - mcMonitoringForm.setCurrentTab("1"); - mcGeneralMonitoringDTO.setCurrentTab("1"); - - mcMonitoringForm.setActiveModule(MONITORING); - mcGeneralMonitoringDTO.setActiveModule(MONITORING); - - mcMonitoringForm.setSelectedToolSessionId("All"); - mcGeneralMonitoringDTO.setSelectedToolSessionId("All"); - - 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_MONITORING_DTO, mcGeneralMonitoringDTO); - request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); - - return new McMonitoringAction().commonSubmitSessionCode(mcMonitoringForm, request, mapping, mcService, - mcGeneralMonitoringDTO); - } - - /** - * initialises monitoring data - * - * @param mapping - * @param form - * @param request - * @param response - * @param mcService - * @param mcGeneralMonitoringDTO - * @return - */ - public void initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, IMcService mcService, McGeneralMonitoringDTO mcGeneralMonitoringDTO) { - McMonitoringForm mcMonitoringForm = (McMonitoringForm) form; - String toolContentID = mcMonitoringForm.getToolContentID(); - - McContent mcContent = mcService.retrieveMc(new Long(toolContentID)); + McContent mcContent = service.retrieveMc(new Long(toolContentID)); mcGeneralMonitoringDTO.setToolContentID(toolContentID.toString()); mcGeneralMonitoringDTO.setActivityTitle(mcContent.getTitle()); mcGeneralMonitoringDTO.setActivityInstructions(mcContent.getInstructions()); @@ -185,36 +126,43 @@ mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString()); - /* SELECTION_CASE == 2 indicates start up */ - request.setAttribute(SELECTION_CASE, new Long(2)); - - /* - * Default to All for tool Sessions so that all tool sessions' summary information gets displayed when the - * module starts up - */ - request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All"); - MonitoringUtil.setupAllSessionsData(request, mcContent, mcService); + MonitoringUtil.setupAllSessionsData(request, mcContent, service); mcGeneralMonitoringDTO.setGroupName("All Groups"); - mcGeneralMonitoringDTO.setSelectionCase(new Long(2)); - mcGeneralMonitoringDTO.setCurrentMonitoredToolSession("All"); mcGeneralMonitoringDTO.setListMonitoredAnswersContainerDto(new LinkedList()); mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString()); // The edit activity code needs a session map SessionMap sessionMap = new SessionMap(); mcMonitoringForm.setHttpSessionID(sessionMap.getSessionID()); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - } - /** - * persists error messages to request scope - * - * @param request - * @param message - */ - public void persistInRequestError(HttpServletRequest request, String message) { - ActionMessages errors = new ActionMessages(); - errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - saveErrors(request, errors); + mcMonitoringForm.setCurrentTab("1"); + mcGeneralMonitoringDTO.setCurrentTab("1"); + + 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_MONITORING_DTO, mcGeneralMonitoringDTO); + request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO); + + return new McMonitoringAction().commonSubmitSessionCode(mcMonitoringForm, request, mapping, service, + mcGeneralMonitoringDTO); } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private void initializeMcService() { + if (service == null) { + service = McServiceProxy.getMcService(getServlet().getServletContext()); + } + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java,v diff -u -r1.39 -r1.40 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java 26 Aug 2013 11:03:49 -0000 1.39 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java 3 Sep 2013 16:56:41 -0000 1.40 @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.apache.commons.lang.StringEscapeUtils; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.mc.McAllGroupsDTO; @@ -65,7 +66,29 @@ * */ public class MonitoringUtil implements McAppConstants { + + /** + * Escapes all characters that may brake JS code on assigning Java value to JS String variable (particularly + * escapes all quotes in the following way \"). + */ + public static void escapeQuotes(McUsrAttempt userAttempt) { + McQueContent question = userAttempt.getMcQueContent(); + McOptsContent option = userAttempt.getMcOptionsContent(); + + String questionText = question.getQuestion(); + if (questionText != null) { + String escapedQuestion = StringEscapeUtils.escapeJavaScript(questionText); + question.setEscapedQuestion(escapedQuestion); + } + + String optionText = option.getMcQueOptionText(); + if (optionText != null) { + String escapedOptionText = StringEscapeUtils.escapeJavaScript(optionText); + option.setEscapedOptionText(escapedOptionText); + } + } + /** * * ends up populating the attempt history for all the users of all the tool sessions for a content Index: lams_tool_lamc/web/WEB-INF/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/WEB-INF/struts-config.xml,v diff -u -r1.64 -r1.65 --- lams_tool_lamc/web/WEB-INF/struts-config.xml 24 Jul 2013 18:29:14 -0000 1.64 +++ lams_tool_lamc/web/WEB-INF/struts-config.xml 3 Sep 2013 16:56:41 -0000 1.65 @@ -406,6 +406,12 @@ path="/monitoring/editQuestionBox.jsp" redirect="false" /> + + - <%@ include file="/common/taglibs.jsp"%> Fisheye: Tag 1.7 refers to a dead (removed) revision in file `lams_tool_lamc/web/monitoring/IndividualSessionSummary.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/monitoring/Instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/Instructions.jsp,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/web/monitoring/Instructions.jsp 6 May 2008 04:18:55 -0000 1.21 +++ lams_tool_lamc/web/monitoring/Instructions.jsp 3 Sep 2013 16:56:41 -0000 1.22 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_lamc/web/monitoring/LearnerNotebook.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/LearnerNotebook.jsp,v diff -u -r1.9 -r1.10 --- lams_tool_lamc/web/monitoring/LearnerNotebook.jsp 8 Jun 2007 01:38:23 -0000 1.9 +++ lams_tool_lamc/web/monitoring/LearnerNotebook.jsp 3 Sep 2013 16:56:40 -0000 1.10 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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 ---%> - Index: lams_tool_lamc/web/monitoring/LearnerRep.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/LearnerRep.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_lamc/web/monitoring/LearnerRep.jsp 17 Oct 2006 20:35:24 -0000 1.2 +++ lams_tool_lamc/web/monitoring/LearnerRep.jsp 3 Sep 2013 16:56:41 -0000 1.3 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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 ---%> - Index: lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.44 -r1.45 --- lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 16 May 2011 05:11:30 -0000 1.44 +++ lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 3 Sep 2013 16:56:40 -0000 1.45 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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 ---%> - @@ -113,26 +92,17 @@ submitMethod(actionMethod); } - function submitSession(selectedToolSessionId, actionMethod) { - document.McMonitoringForm.selectedToolSessionId.value=selectedToolSessionId; - submitMonitoringMethod(actionMethod); - } - - - function submitModifyOption(optionIndexValue, actionMethod) - { + function submitModifyOption(optionIndexValue, actionMethod) { document.McMonitoringForm.optIndex.value=optionIndexValue; submitMethod(actionMethod); } - function submitModifyQuestion(optionIndexValue, actionMethod) - { + function submitModifyQuestion(optionIndexValue, actionMethod) { document.McMonitoringForm.optIndex.value=optionIndexValue; submitMethod(actionMethod); } - function submitOpenMc(currentUid, actionMethod) - { + function submitOpenMc(currentUid, actionMethod) { document.McMonitoringForm.currentUid.value=currentUid; submitMethod(actionMethod); } @@ -142,39 +112,36 @@ -
-

+

- + + +
+ + + + + + + + + + + + + + + + + + +
+ + -
- - - - - - - - - - - - - - - - - - - - -
- - -
Index: lams_tool_lamc/web/monitoring/Reflections.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Reflections.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/web/monitoring/Reflections.jsp 22 Nov 2006 06:30:08 -0000 1.4 +++ lams_tool_lamc/web/monitoring/Reflections.jsp 3 Sep 2013 16:56:41 -0000 1.5 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_lamc/web/monitoring/Stats.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Stats.jsp,v diff -u -r1.22 -r1.23 --- lams_tool_lamc/web/monitoring/Stats.jsp 17 Aug 2007 03:54:30 -0000 1.22 +++ lams_tool_lamc/web/monitoring/Stats.jsp 3 Sep 2013 16:56:41 -0000 1.23 @@ -1,24 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_lamc/web/monitoring/SummaryContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/SummaryContent.jsp,v diff -u -r1.32 -r1.33 --- lams_tool_lamc/web/monitoring/SummaryContent.jsp 29 Sep 2012 13:58:06 -0000 1.32 +++ lams_tool_lamc/web/monitoring/SummaryContent.jsp 3 Sep 2013 16:56:41 -0000 1.33 @@ -1,30 +1,18 @@ -<%-- -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 version 2 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 ---%> <%@ include file="/common/taglibs.jsp"%> - - - + + + + - - -

- - - - - -

-
- - +<%@ include file="parts/advanceOptions.jsp"%> +<%@ include file="parts/dateRestriction.jsp"%> -<%@include file="daterestriction.jsp"%> + + + + + + +
+ +
+
+
- - - - - - -
- -
-
-
-

@@ -209,103 +172,41 @@ - + + +

+ +

+ +
+ <%@ include file="masterDetailLoadUp.jsp"%> +
- - - + + +
+ +
+ ${sessionMarkDto.sessionName} +
+
+ +
+
+
+
+ - - - <%-- When grouping is not enabled, we have only 2 items in summaryToolSessions. The main toolSession and 'All' --%> - - - + - - - - - - - - - - - - - - - - : -   ( ) - - - - - - - - - - -
-         - - - -   () - -
- - - -
- - - - : - - - - -

- - - - - - - - - + - - - + + +
- - - - - - - - + + + Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_lamc/web/monitoring/UserResponses.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/monitoring/candidateAnswersAddList.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/candidateAnswersAddList.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/web/monitoring/candidateAnswersAddList.jsp 27 Jul 2013 07:52:41 -0000 1.8 +++ lams_tool_lamc/web/monitoring/candidateAnswersAddList.jsp 3 Sep 2013 16:56:41 -0000 1.9 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp" %> Index: lams_tool_lamc/web/monitoring/candidateAnswersList.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/candidateAnswersList.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/web/monitoring/candidateAnswersList.jsp 27 Jul 2013 07:52:42 -0000 1.8 +++ lams_tool_lamc/web/monitoring/candidateAnswersList.jsp 3 Sep 2013 16:56:41 -0000 1.9 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp" %> Fisheye: Tag 1.4 refers to a dead (removed) revision in file `lams_tool_lamc/web/monitoring/daterestriction.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/monitoring/editQuestionBox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/editQuestionBox.jsp,v diff -u -r1.14 -r1.15 --- lams_tool_lamc/web/monitoring/editQuestionBox.jsp 6 Oct 2010 10:16:07 -0000 1.14 +++ lams_tool_lamc/web/monitoring/editQuestionBox.jsp 3 Sep 2013 16:56:41 -0000 1.15 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - Index: lams_tool_lamc/web/monitoring/itemlist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/itemlist.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/web/monitoring/itemlist.jsp 15 Aug 2013 20:20:36 -0000 1.8 +++ lams_tool_lamc/web/monitoring/itemlist.jsp 3 Sep 2013 16:56:40 -0000 1.9 @@ -1,23 +1,3 @@ -<%-- -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 version 2 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 ---%> - <%@ include file="/common/taglibs.jsp" %>
Index: lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp 3 Sep 2013 16:56:41 -0000 1.1 @@ -0,0 +1,22 @@ +<%@ include file="/common/taglibs.jsp"%> + + Index: lams_tool_lamc/web/monitoring/newQuestionBox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/newQuestionBox.jsp,v diff -u -r1.14 -r1.15 --- lams_tool_lamc/web/monitoring/newQuestionBox.jsp 6 Oct 2010 10:16:07 -0000 1.14 +++ lams_tool_lamc/web/monitoring/newQuestionBox.jsp 3 Sep 2013 16:56:41 -0000 1.15 @@ -1,23 +1,3 @@ - <%-- -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 version 2 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 ---%> - Index: lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/monitoring/parts/advanceOptions.jsp 3 Sep 2013 16:56:42 -0000 1.1 @@ -0,0 +1,176 @@ +

+ + + + + +

+
+ + Index: lams_tool_lamc/web/monitoring/parts/dateRestriction.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/parts/dateRestriction.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/monitoring/parts/dateRestriction.jsp 3 Sep 2013 16:56:41 -0000 1.1 @@ -0,0 +1,43 @@ +<%@include file="/common/taglibs.jsp"%> + +

+ + + + + +

+
+ + \ No newline at end of file