Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -r29fb207b11874fd4518e72f59a48a43f7fbe6fe3 -r513666f54db679d1b57897effb105f38acd2e003 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 29fb207b11874fd4518e72f59a48a43f7fbe6fe3) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 513666f54db679d1b57897effb105f38acd2e003) @@ -142,10 +142,9 @@ private static ITimezoneService timezoneService; private static ILessonService lessonService; - + private static ISecurityService securityService; - private Integer getUserId() { HttpSession ss = SessionManager.getSession(); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); @@ -393,7 +392,8 @@ monitoringService.createLessonClassForLesson(lesson.getLessonId(), organisation, learnerGroupInstanceName, lessonInstanceLearners, staffGroupInstanceName, staff, userId); } catch (SecurityException e) { - response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the organisation or lesson"); + response.sendError(HttpServletResponse.SC_FORBIDDEN, + "User is not a monitor in the organisation or lesson"); return null; } @@ -901,7 +901,7 @@ DateFormat sfm = new SimpleDateFormat("yyyyMMdd_HHmmss"); lessonDTO.setCreateDateTimeStr(sfm.format(lessonDTO.getCreateDateTime())); } - //prepare encoded lessonId for shortened learner URL + // prepare encoded lessonId for shortened learner URL lessonDTO.setEncodedLessonID(WebUtil.encodeLessonId(lessonId)); if (!getSecurityService().isLessonMonitor(lessonId, user.getUserID(), "monitor lesson", false)) { @@ -1006,13 +1006,12 @@ response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); return null; } - + JSONObject responseJSON = new JSONObject(); Lesson lesson = getLessonService().getLesson(lessonId); LessonDetailsDTO lessonDetails = lesson.getLessonDetails(); String contentFolderId = lessonDetails.getContentFolderID(); - Locale userLocale = new Locale(user.getLocaleLanguage(), user.getLocaleCountry()); responseJSON.put(AttributeNames.PARAM_LEARNINGDESIGN_ID, lessonDetails.getLearningDesignID()); @@ -1085,7 +1084,8 @@ activityJSON.put("x", ((OptionsWithSequencesActivity) activity).getStartXcoord()); activityJSON.put("y", ((OptionsWithSequencesActivity) activity).getStartYcoord()); } else if ((parentActivity != null) - && ((Activity.OPTIONS_ACTIVITY_TYPE == parentActivity.getActivityTypeId()) || (Activity.PARALLEL_ACTIVITY_TYPE == parentActivity + && ((Activity.OPTIONS_ACTIVITY_TYPE == parentActivity.getActivityTypeId()) + || (Activity.PARALLEL_ACTIVITY_TYPE == parentActivity.getActivityTypeId()) || (Activity.FLOATING_ACTIVITY_TYPE == parentActivity .getActivityTypeId()))) { // Optional Activity children had coordinates relative to parent activityJSON.put("x", parentActivity.getXcoord() + activity.getXcoord()); @@ -1211,7 +1211,7 @@ response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a monitor in the lesson"); return null; } - + flashMessage = new FlashMessage("startPreviewSession", new Long(lessonID)); } catch (Exception e) { flashMessage = handleException(e, "startPreviewSession", monitoringService); @@ -1275,7 +1275,7 @@ } return MonitoringAction.lessonService; } - + private ISecurityService getSecurityService() { if (MonitoringAction.securityService == null) { WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()