Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -r94d0394d34137a78c2f75a8cf090245f2598969e -r0b3e2d202a59e6a760a54abdeca1b33f0f5986c7 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 94d0394d34137a78c2f75a8cf090245f2598969e) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 0b3e2d202a59e6a760a54abdeca1b33f0f5986c7) @@ -531,7 +531,7 @@ data : "method=removeLesson&lessonID=" + lessonID, type : "post", success : function(json) { - if (json.removeLesson == "true") { + if (json.removeLesson == true) { loadOrgTab(null, true); } else { alert(json.removeLesson); Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -r7911b538e3fd0e8ae2bb56acac7eed836d4b2320 -r0b3e2d202a59e6a760a54abdeca1b33f0f5986c7 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 7911b538e3fd0e8ae2bb56acac7eed836d4b2320) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 0b3e2d202a59e6a760a54abdeca1b33f0f5986c7) @@ -574,18 +574,27 @@ public ActionForward removeLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, JSONException, ServletException { IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet() - .getServletContext()); - long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - // if this method throws an Exception, there will be no removeLesson=true in the JSON reply - monitoringService.removeLesson(lessonId, getUserId()); + .getServletContext()); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); JSONObject jsonObject = new JSONObject(); - jsonObject.put("removeLesson", true); + + try { + // if this method throws an Exception, there will be no removeLesson=true in the JSON reply + monitoringService.removeLesson(lessonId, getUserId()); + jsonObject.put("removeLesson", true); + + } catch (Exception e) { + String[] msg = new String[1]; + msg[0] = e.getMessage(); + jsonObject.put("removeLesson", monitoringService.getMessageService().getMessage("error.system.error",msg)); + } + response.setContentType("application/json;charset=utf-8"); response.getWriter().print(jsonObject); return null; } - + /** *
* This action need a lession ID, Learner ID and Activity ID as input. Activity ID is optional, if it is null, all