Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rb6260c3467f80821a958f1a494720ba1b048e5c7 -ra41ad55b200a8af4eedbbbd22a9169c12a96133c --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision b6260c3467f80821a958f1a494720ba1b048e5c7) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a41ad55b200a8af4eedbbbd22a9169c12a96133c) @@ -276,7 +276,7 @@ force.complete.remove.content.yes =Delete content force.complete.remove.content.no =Keep content label.schedule.gate.activity.completion.based =This gate is based on each learner's previous activity completion time -audit.force.complete =Attempted to force complete learner {0} to activityId:{1}. LessonId:{2}. +audit.force.complete =Attempted to force complete learner {0} to {1}. LessonId:{2}. audit.force.complete.end.lesson =Attempted to force complete learner {0} to the end of the lesson. LessonId:{2}. lesson.task.content.edited =Content being edited lesson.task.attention =This activity requires attention Index: lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r4c51f9c8b6fab7efa4d5296f1ee60c1c3bd207e5 -ra41ad55b200a8af4eedbbbd22a9169c12a96133c --- lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 4c51f9c8b6fab7efa4d5296f1ee60c1c3bd207e5) +++ lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision a41ad55b200a8af4eedbbbd22a9169c12a96133c) @@ -275,7 +275,7 @@ force.complete.remove.content.yes =Delete content force.complete.remove.content.no =Keep content label.schedule.gate.activity.completion.based =This gate is based on each learner's previous activity completion time -audit.force.complete =Attempted to force complete learner {0} to activityId:{1}. LessonId:{2}. +audit.force.complete =Attempted to force complete learner {0} to {1}. LessonId:{2}. audit.force.complete.end.lesson =Attempted to force complete learner {0} to the end of the lesson. LessonId:{2}. lesson.task.content.edited =Content being edited lesson.task.attention =This activity requires attention Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -reeb8faaea5372ccf5445d7172f726931e9f26098 -ra41ad55b200a8af4eedbbbd22a9169c12a96133c --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision eeb8faaea5372ccf5445d7172f726931e9f26098) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision a41ad55b200a8af4eedbbbd22a9169c12a96133c) @@ -583,32 +583,48 @@ jsonCommand.put("redirectURL", "/lams/learning/learner.do?method=joinLesson&lessonID=" + lessonId); String command = jsonCommand.toString(); + String activityDescription = null; + if (activityId != null) { + Activity activity = getMonitoringService().getActivityById(activityId); + activityDescription = new StringBuffer(activity.getTitle()).append(" (").append(activityId).append(")") + .toString(); + } + + StringBuffer learnerIdNameBuf = new StringBuffer(); String message = null; User learner = null; + boolean oneOrMoreProcessed = false; try { for (String learnerIDString : learnerIDs.split(",")) { + if (oneOrMoreProcessed) { + learnerIdNameBuf.append(", "); + } else { + oneOrMoreProcessed = true; + } Integer learnerID = Integer.valueOf(learnerIDString); message = getMonitoringService().forceCompleteActivitiesByUser(learnerID, requesterId, lessonId, activityId, removeLearnerContent); learner = (User) getUserManagementService().findById(User.class, learnerID); getLearnerService().createCommandForLearner(lessonId, learner.getLogin(), command); + learnerIdNameBuf.append(learner.getLogin()).append(" (").append(learnerID).append(")"); } } catch (SecurityException e) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); return null; } if (LamsDispatchAction.log.isDebugEnabled()) { - LamsDispatchAction.log - .debug("Force complete for learners " + learnerIDs + " lesson " + lessonId + ". " + message); + LamsDispatchAction.log.debug("Force complete for learners " + learnerIdNameBuf.toString() + " lesson " + + lessonId + ". " + message); } // audit log force completion attempt String messageKey = (activityId == null) ? "audit.force.complete.end.lesson" : "audit.force.complete"; - Object[] args = new Object[] { learnerIDs, activityId, lessonId }; + + Object[] args = new Object[] { learnerIdNameBuf.toString(), activityDescription, lessonId }; String auditMessage = getMonitoringService().getMessageService().getMessage(messageKey, args); - getLogEventService().logEvent(LogEvent.TYPE_FORCE_COMPLETE, requesterId, null, lessonId, null, + getLogEventService().logEvent(LogEvent.TYPE_FORCE_COMPLETE, requesterId, null, lessonId, activityId, auditMessage + " " + message); PrintWriter writer = response.getWriter();