Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -rdc7b67e7677c8cd2289130c67094a62b39177d05 -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision dc7b67e7677c8cd2289130c67094a62b39177d05) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -471,7 +471,7 @@ $.ajax({ async : false, url : LAMS_URL + "monitoring/monitoring.do", - data : "method=removeLessonJson&lessonID=" + lessonID, + data : "method=removeLesson&lessonID=" + lessonID, type : "post", success : function(json) { if (json.removeLesson == "true") { Index: lams_central/web/includes/javascript/progressBar.js =================================================================== diff -u -rc5458ac841d6719102fabe4e04b4061bdb3fbb5d -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_central/web/includes/javascript/progressBar.js (.../progressBar.js) (revision c5458ac841d6719102fabe4e04b4061bdb3fbb5d) +++ lams_central/web/includes/javascript/progressBar.js (.../progressBar.js) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -959,7 +959,7 @@ $.ajax({ url : LAMS_URL + 'monitoring/monitoring.do', data : { - 'method' : 'getLearnerProgressJSON', + 'method' : 'getLearnerProgress', 'lessonID' : lessonId, 'userID' : bar.userId }, Index: lams_monitoring/src/flash/monitor_draft.fla =================================================================== diff -u -r1bd8f5eeeade4209e11ee786c928279cb84065ff -r3b70087062500e57ffd0a57c798716883ca61150 Binary files differ Fisheye: Tag 3b70087062500e57ffd0a57c798716883ca61150 refers to a dead (removed) revision in file `lams_monitoring/src/flash/org/lamsfoundation/lams/monitoring/Application.as'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java =================================================================== diff -u -r2e6d6e416cc36e920e3900118324d5d310213135 -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision 2e6d6e416cc36e920e3900118324d5d310213135) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -305,22 +305,6 @@ */ public Boolean setLiveEditEnabled(long lessonId, Integer userId, Boolean liveEditEnabled); - /** - * Force Complete works on an individual user. The teacher may complete it up to a particular activity, or till the - * end of the sequence which activity id is null indicating complete to end. Note, the give activity will be - * complete as well. - * - * @param learnerId - * @param requesterId - * the user id of the person requesting the force complete. For security check - * @param lessonId - * @param activityId - * force complete to this activity(this activity will be force complete as well). If null value, force - * will complete all activities in this lesson. - * @return success message. - */ - public String forceCompleteLessonByUser(Integer learnerId, Integer requesterId, long lessonId, Long activityId); - public String forceCompleteActivitiesByUser(Integer learnerId, Integer requesterId, long lessonId, Long activityId); /** @@ -467,65 +451,6 @@ public String getLearningDesignDetails(Long lessonID) throws IOException; /** - * This method returns the progress information of all learners in a given Lesson. - * - * @param lessonID - * The lesson_id of the Lesson whose progress information is required - * @param userID - * The user id of the user requesting the progress details - * @param completedOnly - * true if the data we are affect is completed activities data (included completed time values). - * @return String The requested information in wddx format - * @throws IOException - */ - public String getAllLearnersProgress(Long lessonID, Integer userID, Boolean completedOnly) throws IOException; - - /** - * This method returns the progress information of all learners in a given Lesson. - * - * @param lessonID - * The lesson_id of the Lesson whose progress information is required - * @param learnerID - * The learner_id of the class learner whose progress information is required If null, provide all - * learner's progress information. - * @param userID - * The user id of the user requesting the progress details - * @return String The requested information in wddx format - * @throws IOException - */ - public String getAllCompletedActivities(Long lessonID, Long learnerID, Integer userID) throws IOException; - - /** - * This method returns a batch of progress information of learners in a given Lesson. It returns the first batch of - * users, using the learner's name as the sorting order. The batch size is determined by the LEARNER_PROGRESS_BATCH - * size in the database. - * - * @param lessonID - * The lesson_id of the Lesson whose progress information is required - * @param userID - * The user id of the user requesting the progress details - * @return String The requested information in wddx format - * @throws IOException - */ - public String getInitialLearnersProgress(Long lessonID, Integer userID) throws IOException; - - /** - * This method returns the next batch of progress information of learners in a given Lesson. The batch size is - * determined by the LEARNER_PROGRESS_BATCH size in the database, and the next batch starts at after the supplied - * user_id - * - * @param lessonID - * The lesson_id of the Lesson whose progress information is required - * @param lastUserID - * The user id of the last user from the previous batch - * @param userID - * The user id of the user requesting the progress details - * @return String The requested information in wddx format - * @throws IOException - */ - public String getAdditionalLearnersProgress(Long lessonID, Integer lastUserID, Integer userID) throws IOException; - - /** * This method is called when the user clicks the 'Contribute' tab in the monitoring enviornment. It returns a list * of activities "in the order" they have to be performed and with additional information as to what kind of * contribution (Define later content, Moderation, Contribution, Permission for gate activity, Chosen Grouing etc.) Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== diff -u -r39fed4d1daf4f1f7e18809c2f660ef1854c7ad5f -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 39fed4d1daf4f1f7e18809c2f660ef1854c7ad5f) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -1406,38 +1406,6 @@ } /** - * @throws LamsToolServiceException - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#forceCompleteLessonByUser(Integer,long,long) - */ - public String forceCompleteLessonByUser(Integer learnerId, Integer requesterId, long lessonId, Long activityId) { - // TODO: REMOVE THIS METHOD AFTER OLD, FLASH MONITORING IS REMOVED - Lesson lesson = lessonDAO.getLesson(new Long(lessonId)); - checkOwnerOrStaffMember(requesterId, lesson, "force complete"); - - User learner = (User) baseDAO.find(User.class, learnerId); - - LearnerProgress learnerProgress = learnerService.getProgress(learnerId, lessonId); - Activity stopActivity = null; - - if (activityId != null) { - stopActivity = getActivityById(activityId); - if (stopActivity == null) { - throw new MonitoringServiceException("Activity missing. Activity id" + activityId); - } - } - - Activity currentActivity = learnerProgress.getCurrentActivity(); - String stopReason = null; - if (currentActivity != null) { - stopReason = forceCompleteActivity(learner, lessonId, learnerProgress, currentActivity, stopActivity, - new ArrayList()); - } - - return stopReason != null ? stopReason : messageService - .getMessage(MonitoringService.FORCE_COMPLETE_STOP_MESSAGE_STOPPED_UNEXPECTEDLY); - } - - /** * Recursive method to step through a design and do the force complete. * * Special Cases: Gate -- LearnerService.knockGate(GateActivity gate, User knocker, List lessonLearners) Y - @@ -2030,130 +1998,6 @@ } /** - * (non-Javadoc) - * - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLearnersProgress(java.lang.Long, - * java.lang.Integer) - */ - public String getAllLearnersProgress(Long lessonID, Integer userID, Boolean completedDataOnly) throws IOException { - Lesson lesson = lessonDAO.getLesson(lessonID); - FlashMessage flashMessage; - - if (lesson != null) { - checkOwnerOrStaffMember(userID, lesson, "get all learners progress"); - Vector progressData = new Vector(); - Iterator iterator = lesson.getLearnerProgresses().iterator(); - while (iterator.hasNext()) { - LearnerProgress learnerProgress = (LearnerProgress) iterator.next(); - if (!completedDataOnly) { - progressData.add(learnerProgress.getLearnerProgressData()); - } else { - progressData.add(learnerProgress.getLearnerProgressCompletedData()); - } - } - flashMessage = (!completedDataOnly) ? new FlashMessage("getAllLearnersProgress", progressData) - : new FlashMessage("getAllCompletedActivities", progressData); - } else { - flashMessage = new FlashMessage("getAllLearnersProgress", messageService.getMessage("NO.SUCH.LESSON", - new Object[] { lessonID }), FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - - public String getAllCompletedActivities(Long lessonID, Long learnerID, Integer userID) throws IOException { - Lesson lesson = lessonDAO.getLesson(lessonID); - FlashMessage flashMessage; - - if (lesson != null) { - checkOwnerOrStaffMember(userID, lesson, "get all learners progress"); - Vector progressData = new Vector(); - - if (learnerID != null) { - LearnerProgress learnerProgress = learnerService.getProgress(new Integer(learnerID.intValue()), - lessonID); - progressData.add(learnerProgress.getLearnerProgressCompletedData()); - flashMessage = new FlashMessage("getAllCompletedActivities", progressData); - } else { - return getAllLearnersProgress(lessonID, userID, true); - } - - } else { - flashMessage = new FlashMessage("getAllCompletedActivities", messageService.getMessage("NO.SUCH.LESSON", - new Object[] { lessonID }), FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - - /** - * (non-Javadoc) - * - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getInitialLearnersProgress(java.lang.Long, - * java.lang.Integer) - */ - public String getInitialLearnersProgress(Long lessonID, Integer userID) throws IOException { - Lesson lesson = lessonDAO.getLesson(lessonID); - FlashMessage flashMessage; - - if (lesson != null) { - checkOwnerOrStaffMember(userID, lesson, "get first batch of learners progress details"); - Vector progressData = new Vector(); - - int batchSize = Configuration.getAsInt(ConfigurationKeys.LEARNER_PROGRESS_BATCH_SIZE); - if (batchSize < 1) { - batchSize = MonitoringService.DEFAULT_LEARNER_PROGRESS_BATCH_SIZE; - } - - Iterator iterator = learnerProgressDAO.getBatchLearnerProgress(lessonID, null, batchSize).iterator(); - while (iterator.hasNext()) { - LearnerProgress learnerProgress = (LearnerProgress) iterator.next(); - progressData.add(learnerProgress.getLearnerProgressData()); - } - - Integer numAllLearnerProgress = learnerProgressDAO.getNumAllLearnerProgress(lessonID); - LearnerProgressBatchDTO dto = new LearnerProgressBatchDTO(progressData, batchSize, numAllLearnerProgress); - - flashMessage = new FlashMessage("getInitialLearnersProgress", dto); - } else { - flashMessage = new FlashMessage("getInitialLearnersProgress", messageService.getMessage("NO.SUCH.LESSON", - new Object[] { lessonID }), FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - - /** - * (non-Javadoc) - * - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAdditionalLearnersProgress(java.lang.Long, - * java.lang.Integer, java.lang.Integer) - */ - public String getAdditionalLearnersProgress(Long lessonID, Integer lastUserID, Integer userID) throws IOException { - Lesson lesson = lessonDAO.getLesson(lessonID); - FlashMessage flashMessage; - - if (lesson != null) { - checkOwnerOrStaffMember(userID, lesson, "get next batch of learners progress details"); - Vector progressData = new Vector(); - - User lastUser = (User) baseDAO.find(User.class, lastUserID); - int batchSize = Configuration.getAsInt(ConfigurationKeys.LEARNER_PROGRESS_BATCH_SIZE); - if (batchSize < 1) { - batchSize = MonitoringService.DEFAULT_LEARNER_PROGRESS_BATCH_SIZE; - } - - Iterator iterator = learnerProgressDAO.getBatchLearnerProgress(lessonID, lastUser, batchSize).iterator(); - while (iterator.hasNext()) { - LearnerProgress learnerProgress = (LearnerProgress) iterator.next(); - progressData.add(learnerProgress.getLearnerProgressData()); - } - flashMessage = new FlashMessage("getAdditionalLearnersProgress", progressData); - } else { - flashMessage = new FlashMessage("getAdditionalLearnersProgress", messageService.getMessage( - "NO.SUCH.LESSON", new Object[] { lessonID }), FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - - /** * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getActivityById(Long) */ public Activity getActivityById(Long activityId) { Fisheye: Tag 3b70087062500e57ffd0a57c798716883ca61150 refers to a dead (removed) revision in file `lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/CreateLessonServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -r1d8bb6927b7d4341f8f5111179e53e1b1ee40d88 -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 1d8bb6927b7d4341f8f5111179e53e1b1ee40d88) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -128,9 +128,6 @@ private static final String ERROR = "error"; private static final DateFormat LESSON_SCHEDULING_DATETIME_FORMAT = new SimpleDateFormat("MM/dd/yy HH:mm"); - /** See deleteOldPreviewLessons */ - public static final String NUM_DELETED = "numDeleted"; - private static IAuditService auditService; private static ITimezoneService timezoneService; @@ -225,9 +222,8 @@ /** * The Struts dispatch method that starts a lesson that has been created beforehand. Most likely, the request to - * start lesson should be triggered by the flash component. This method will delegate to the Spring service bean to - * complete all the steps for starting a lesson. Finally, a wddx acknowledgement message will be serialized and sent - * back to the flash component. + * start lesson should be triggered by the Monitoring This method will delegate to the Spring service bean to + * complete all the steps for starting a lesson. * * @param mapping * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send @@ -248,20 +244,10 @@ HttpServletResponse response) throws IOException, ServletException { IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - FlashMessage flashMessage = null; - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.startLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("startLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "startLesson", monitoringService); - } + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + monitoringService.startLesson(lessonId, getUserId()); - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); return null; } @@ -363,51 +349,7 @@ return null; } - /** - * The Struts dispatch method that starts a lesson on schedule that has been created beforehand. - * - * @param mapping - * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send - * the end-user. - * - * @param form - * The ActionForm class that will contain any data submitted by the end-user via a form. - * @param request - * A standard Servlet HttpServletRequest class. - * @param response - * A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go - * next. - * @throws IOException - * @throws ServletException - * @throws - */ public ActionForward startOnScheduleLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - FlashMessage flashMessage = null; - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - - String dateStr = WebUtil.readStrParam(request, MonitoringConstants.PARAM_LESSON_START_DATE); - Date startDate = DateUtil.convertFromLAMSFlashFormat(dateStr); - - monitoringService.startLessonOnSchedule(lessonId, startDate, getUserId()); - flashMessage = new FlashMessage("startOnScheduleLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "startOnScheduleLesson", monitoringService); - } - - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); - return null; - } - - public ActionForward startOnScheduleLessonJSON(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ParseException { IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); @@ -419,8 +361,7 @@ } /** - * The Struts dispatch method to archive a lesson. A wddx acknowledgement message will be serialized and sent back - * to the flash component. + * The Struts dispatch method to archive a lesson. * * @param mapping * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send @@ -439,22 +380,11 @@ */ public ActionForward archiveLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; + IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.archiveLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("archiveLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "archiveLesson", monitoringService); - } - - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + monitoringService.archiveLesson(lessonId, getUserId()); return null; } @@ -479,22 +409,10 @@ */ public ActionForward unarchiveLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.unarchiveLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("unarchiveLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "unarchiveLesson", monitoringService); - } - - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + monitoringService.unarchiveLesson(lessonId, getUserId()); return null; } @@ -513,22 +431,10 @@ */ public ActionForward suspendLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.suspendLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("suspendLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "suspendLesson", monitoringService); - } - - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + monitoringService.suspendLesson(lessonId, getUserId()); return null; } @@ -546,68 +452,15 @@ */ public ActionForward unsuspendLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.unsuspendLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("unsuspendLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "unsuspendLesson", monitoringService); - } - - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + monitoringService.unsuspendLesson(lessonId, getUserId()); return null; } /** *

- * The STRUTS action will send back a WDDX message after marking the lesson by the given lesson ID as - * Lesson.REMOVED_STATE status. - *

- *

- * This action need a lession ID as input. - *

- * - * @param form - * The ActionForm class that will contain any data submitted by the end-user via a form. - * @param request - * A standard Servlet HttpServletRequest class. - * @param response - * A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go - * next. - * @throws IOException - * @throws ServletException - */ - public ActionForward removeLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - monitoringService.removeLesson(lessonId, getUserId()); - flashMessage = new FlashMessage("removeLesson", Boolean.TRUE); - } catch (Exception e) { - flashMessage = handleException(e, "removeLesson", monitoringService); - } - String message = flashMessage.serializeMessage(); - - PrintWriter writer = response.getWriter(); - writer.println(message); - return null; - - } - - /** - *

* The STRUTS action will send back a JSON message after marking the lesson by the given lesson ID as * Lesson.REMOVED_STATE status. *

@@ -650,8 +503,6 @@ /** *

- *

- *

* This action need a lession ID, Learner ID and Activity ID as input. Activity ID is optional, if it is null, all * activities for this learner will complete to as end as possible. *

@@ -667,7 +518,6 @@ */ public ActionForward forceComplete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - FlashMessage flashMessage = null; IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); // get parameters @@ -681,35 +531,20 @@ } } - // force complete - try { - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - Integer learnerId = new Integer(WebUtil.readIntParam(request, MonitoringConstants.PARAM_LEARNER_ID)); - Integer requesterId = getUserId(); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + Integer learnerId = new Integer(WebUtil.readIntParam(request, MonitoringConstants.PARAM_LEARNER_ID)); + Integer requesterId = getUserId(); - // true if old, Flash Monitoring is used; to be removed after new Monitoring is adopted - boolean isPreviousActivity = WebUtil.readBooleanParam(request, "isPreviousActivity", true); - String message = null; - if (isPreviousActivity) { - message = monitoringService.forceCompleteLessonByUser(learnerId, requesterId, lessonId, activityId); - } else { - message = monitoringService.forceCompleteActivitiesByUser(learnerId, requesterId, lessonId, activityId); - } + String message = monitoringService.forceCompleteActivitiesByUser(learnerId, requesterId, lessonId, activityId); - if (LamsDispatchAction.log.isDebugEnabled()) { - LamsDispatchAction.log.debug("Force complete for learner " + learnerId + " lesson " + lessonId + ". " - + message); - } - flashMessage = new FlashMessage("forceComplete", message); - } catch (Exception e) { - flashMessage = handleException(e, "forceComplete", monitoringService); + if (LamsDispatchAction.log.isDebugEnabled()) { + LamsDispatchAction.log.debug("Force complete for learner " + learnerId + " lesson " + lessonId + ". " + + message); } - String message = flashMessage.serializeMessage(); PrintWriter writer = response.getWriter(); writer.println(message); return null; - } public ActionForward getLessonDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -850,24 +685,6 @@ return null; } - /** Get the learner progress data for all learners in a lesson. This is called by the sequence tab in monitoring */ - public ActionForward getAllLearnersProgress(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { - String wddxPacket; - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - try { - Long lessonID = WebUtil.readLongParam(request, "lessonID", false); - wddxPacket = monitoringService.getAllLearnersProgress(lessonID, getUserId(), false); - } catch (Exception e) { - wddxPacket = handleException(e, "getAllLearnersProgress", monitoringService).serializeMessage(); - } - - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - } - @SuppressWarnings("unchecked") public ActionForward getDictionaryXML(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -879,69 +696,8 @@ String module = WebUtil.readStrParam(request, "module", false); ArrayList languageCollection = new ArrayList(); - if (module.equals("wizard")) { - // pre-existing flash app (AS 2.0) labels - languageCollection.add(new String("sys.error.msg.start")); - languageCollection.add(new String("sys.error")); - languageCollection.add(new String("wizardTitle.x.lbl")); - languageCollection.add(new String("finish.btn")); - languageCollection.add(new String("title.lbl")); - languageCollection.add(new String("desc.lbl")); - languageCollection.add(new String("learner.lbl")); - languageCollection.add(new String("staff.lbl")); - languageCollection.add(new String("al.alert")); - languageCollection.add(new String("al.ok")); - languageCollection.add(new String("al.validation.msg1")); - languageCollection.add(new String("al.validation.msg2")); - languageCollection.add(new String("al.validation.msg3.2")); - languageCollection.add(new String("al.validation.schtime")); - languageCollection.add(new String("learners.group.name")); - languageCollection.add(new String("staff.group.name")); - languageCollection.add(new String("wizard.splitLearners.splitSum")); - languageCollection.add(new String("wizard.splitLearners.LearnersPerLesson.lbl")); - languageCollection.add(new String("wizard.splitLearners.cb.lbl")); - languageCollection.add(new String("wizard.learner.expp.cb.lbl")); - languageCollection.add(new String("wizard.learner.enLiveEdit.cb.lbl")); - languageCollection.add(new String("wizard.learner.enpres.cb.lbl")); - languageCollection.add(new String("wizard.wkspc.date.modified.lbl")); - languageCollection.add(new String("summery.desc.lbl")); + if (module.equals("timechart")) { - // monitoring webapp existing labels - languageCollection.add(new String("error.system.error")); - languageCollection.add(new String("button.ok")); - - // new flex (CloudWizard) labels - languageCollection.add(new String("add.lesson.panel.title")); - languageCollection.add(new String("lesson.tab.label")); - languageCollection.add(new String("class.tab.label")); - languageCollection.add(new String("advanced.tab.label")); - languageCollection.add(new String("lesson.tab.heading.label")); - languageCollection.add(new String("add.now.button.label")); - languageCollection.add(new String("advanced.tab.form.advanced.options.label")); - languageCollection.add(new String("advanced.tab.enable.lesson.notifications")); - languageCollection.add(new String("advanced.tab.form.enable.im.label")); - languageCollection.add(new String("advanced.tab.form.time.limits.label")); - languageCollection.add(new String("advanced.tab.form.enter.number.days.label")); - languageCollection.add(new String("advanced.tab.form.individual.not.entire.group.label")); - languageCollection.add(new String("advanced.tab.form.scheduling.label")); - languageCollection.add(new String("advanced.tab.form.enable.label")); - languageCollection.add(new String("advanced.tab.form.validation.no.learners.error")); - languageCollection.add(new String("advanced.tab.form.item.split.lessons.label")); - languageCollection.add(new String("advanced.tab.form.details.label")); - languageCollection.add(new String("class.tab.available.label")); - languageCollection.add(new String("class.tab.selected.label")); - languageCollection.add(new String("class.tab.print.name.label")); - languageCollection.add(new String("class.tab.heading.label")); - languageCollection.add(new String("advanced.tab.form.validation.schedule.date.error")); - languageCollection.add(new String("conditions.tab.label")); - languageCollection.add(new String("conditions.tab.form.preceding.label")); - languageCollection.add(new String("conditions.tab.form.preceding.info.label")); - languageCollection.add(new String("advanced.tab.form.time.limits.info.label")); - languageCollection.add(new String("advanced.tab.enable.lesson.intro")); - languageCollection.add(new String("advanced.tab.display.design.image")); - - } else if (module.equals("timechart")) { - languageCollection.add(new String("sys.error")); languageCollection.add(new String("chart.btn.activity.split")); languageCollection.add(new String("chart.btn_completion.rate")); @@ -1007,70 +763,6 @@ return null; } - public ActionForward getAllCompletedActivities(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { - - String wddxPacket; - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - try { - Long lessonID = WebUtil.readLongParam(request, "lessonID", false); - Long learnerID = WebUtil.readLongParam(request, "learnerID", true); - wddxPacket = monitoringService.getAllCompletedActivities(lessonID, learnerID, getUserId()); - - } catch (Exception e) { - wddxPacket = handleException(e, "getAllLearnersProgress", monitoringService).serializeMessage(); - } - - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - - } - - /** - * Get the first batch of learner progress data learners in a lesson. This is called by the learner progress tab in - * monitoring - */ - public ActionForward getInitialLearnersProgress(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { - String wddxPacket; - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - try { - Long lessonID = WebUtil.readLongParam(request, "lessonID", false); - wddxPacket = monitoringService.getInitialLearnersProgress(lessonID, getUserId()); - } catch (Exception e) { - wddxPacket = handleException(e, "getInitialLearnersProgress", monitoringService).serializeMessage(); - } - - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - } - - /** - * Get a followup batch of learner progress data learners in a lesson. This is called by the learner progress tab in - * monitoring - */ - public ActionForward getAdditionalLearnersProgress(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws IOException { - String wddxPacket; - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - try { - Long lessonID = WebUtil.readLongParam(request, "lessonID", false); - Integer lastUserID = WebUtil.readIntParam(request, "lastUserID", false); - wddxPacket = monitoringService.getAdditionalLearnersProgress(lessonID, lastUserID, getUserId()); - } catch (Exception e) { - wddxPacket = handleException(e, "getAdditionalLearnersProgress", monitoringService).serializeMessage(); - } - - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - } - public ActionForward getAllContributeActivities(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -1220,7 +912,7 @@ * Gets users whose progress bars will be displayed in Learner tab in Monitor. */ @SuppressWarnings("unchecked") - public ActionForward getLearnerProgressPageJSON(ActionMapping mapping, ActionForm form, HttpServletRequest request, + public ActionForward getLearnerProgressPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); String searchPhrase = request.getParameter("searchPhrase"); @@ -1282,7 +974,7 @@ * Produces necessary data for learner progress bar. */ @SuppressWarnings("unchecked") - public ActionForward getLearnerProgressJSON(ActionMapping mapping, ActionForm form, HttpServletRequest request, + public ActionForward getLearnerProgress(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException { Integer learnerId = WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID, true); Integer monitorId = null; @@ -1357,7 +1049,7 @@ * Produces data for Sequence tab in Monitor. */ @SuppressWarnings("unchecked") - public ActionForward getLessonProgressJSON(ActionMapping mapping, ActionForm form, HttpServletRequest request, + public ActionForward getLessonProgress(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws JSONException, IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); Long branchingActivityId = WebUtil.readLongParam(request, "branchingActivityID", true); @@ -1430,25 +1122,6 @@ return null; } - public ActionForward renameLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - String wddxPacket = null; - try { - Long lessonID = new Long(WebUtil.readLongParam(request, "lessonID")); - Integer userID = getUserId(); - String name = WebUtil.readStrParam(request, "name"); - wddxPacket = monitoringService.renameLesson(lessonID, name, userID); - } catch (Exception e) { - FlashMessage flashMessage = handleException(e, "renameLesson", monitoringService); - wddxPacket = flashMessage.serializeMessage(); - } - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - } - public ActionForward checkGateStatus(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -1540,20 +1213,6 @@ } /** - * Delete all old preview lessons and their related data, across all organisations. Should go to a monitoring - * webservice maybe ? - */ - public ActionForward deleteOldPreviewLessons(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - int numDeleted = monitoringService.deleteAllOldPreviewLessons(); - request.setAttribute(MonitoringAction.NUM_DELETED, Integer.toString(numDeleted)); - return mapping.findForward(MonitoringAction.PREVIEW_DELETED_REPORT_SCREEN); - } - - /** * Get AuditService bean. * * @return @@ -1654,52 +1313,15 @@ */ public ActionForward presenceImAvailable(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() .getServletContext()); - FlashMessage flashMessage = null; - try { - Long lessonID = new Long(WebUtil.readLongParam(request, "lessonID")); - Integer userID = getUserId(); - Boolean presenceImAvailable = WebUtil.readBooleanParam(request, "presenceImAvailable", false); - monitoringService.setPresenceImAvailable(lessonID, userID, presenceImAvailable); - - flashMessage = new FlashMessage("presenceImAvailable", "presenceImAvailable"); - } catch (Exception e) { - flashMessage = handleException(e, "presenceImAvailable", monitoringService); - } - String wddxPacket = flashMessage.serializeMessage(); - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); + Long lessonID = new Long(WebUtil.readLongParam(request, "lessonID")); + Integer userID = getUserId(); + Boolean presenceImAvailable = WebUtil.readBooleanParam(request, "presenceImAvailable", false); + monitoringService.setPresenceImAvailable(lessonID, userID, presenceImAvailable); return null; } - /** - * Set whether or not the presence available button is available in learner. Expects parameters lessonID and - * presenceAvailable. - */ - public ActionForward liveEditAvailable(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - - IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - FlashMessage flashMessage = null; - try { - Long lessonID = new Long(WebUtil.readLongParam(request, "lessonID")); - Integer userID = getUserId(); - Boolean liveEditAvailable = WebUtil.readBooleanParam(request, "liveEditAvailable", false); - monitoringService.setLiveEditEnabled(lessonID, userID, liveEditAvailable); - - flashMessage = new FlashMessage("liveEditAvailable", "liveEditAvailable"); - } catch (Exception e) { - flashMessage = handleException(e, "liveEditAvailable", monitoringService); - } - String wddxPacket = flashMessage.serializeMessage(); - PrintWriter writer = response.getWriter(); - writer.println(wddxPacket); - return null; - } - /** Open Time Chart display */ public ActionForward viewTimeChart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r1d8bb6927b7d4341f8f5111179e53e1b1ee40d88 -r3b70087062500e57ffd0a57c798716883ca61150 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 1d8bb6927b7d4341f8f5111179e53e1b1ee40d88) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 3b70087062500e57ffd0a57c798716883ca61150) @@ -661,7 +661,7 @@ url : LAMS_URL + 'monitoring/monitoring.do', cache : false, data : { - 'method' : 'getLessonProgressJSON', + 'method' : 'getLessonProgress', 'lessonID' : lessonId, 'branchingActivityID' : sequenceBranchingId }, @@ -774,11 +774,8 @@ }, success : function(response) { // inform user of result - var messageElem = $(response).find('var[name="messageValue"]'); - if (messageElem.length > 0){ - alert(messageElem.text()); - } - + alert(response); + // progress changed, show it to monitor refreshMonitor('sequence'); } @@ -1280,7 +1277,7 @@ url : LAMS_URL + 'monitoring/monitoring.do', cache : false, data : { - 'method' : 'getLearnerProgressPageJSON', + 'method' : 'getLearnerProgressPage', 'lessonID' : lessonId, 'searchPhrase' : learnersSearchPhrase, 'pageNumber' : pageNumber, Index: lams_monitoring/web/lams_monitoring.swf =================================================================== diff -u -r5d461587cd9a2df07207823df4c2e0a8d00c83b2 -r3b70087062500e57ffd0a57c798716883ca61150 Binary files differ Index: lams_monitoring/web/lams_monitoring_library.swf =================================================================== diff -u -r5d461587cd9a2df07207823df4c2e0a8d00c83b2 -r3b70087062500e57ffd0a57c798716883ca61150 Binary files differ Index: lams_monitoring/web/lams_wizard.swf =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r3b70087062500e57ffd0a57c798716883ca61150 Binary files differ Index: lams_monitoring/web/lams_wizard_library.swf =================================================================== diff -u -rec61f5d738bce3513b4e5204e011a68476a9c165 -r3b70087062500e57ffd0a57c798716883ca61150 Binary files differ Fisheye: Tag 3b70087062500e57ffd0a57c798716883ca61150 refers to a dead (removed) revision in file `lams_monitoring/web/monitorLesson.jsp'. Fisheye: No comparison available. Pass `N' to diff?