Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/groupDisplay.js,v diff -u -r1.37 -r1.38 --- lams_central/web/includes/javascript/groupDisplay.js 13 Jan 2014 10:58:17 -0000 1.37 +++ lams_central/web/includes/javascript/groupDisplay.js 18 Feb 2015 01:18:35 -0000 1.38 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java,v diff -u -r1.132 -r1.133 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 13 Jan 2015 22:11:31 -0000 1.132 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 18 Feb 2015 01:19:30 -0000 1.133 @@ -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