Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -ra61b6ad192148c0ae514f37a9b488c3a15535ee9 -r903a4f947345a9960d5af2f3a7e7ab2f366884e0 --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a61b6ad192148c0ae514f37a9b488c3a15535ee9) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 903a4f947345a9960d5af2f3a7e7ab2f366884e0) @@ -217,6 +217,11 @@ lesson.task.branching =Instructor chosen branching button.task.go =Go button.task.go.tooltip =Complete this task now +button.task.gate.open.now =Open now +button.task.gate.open.now.tooltip =Opens the gate immediately +button.task.gate.open =Open... +button.task.gate.open.tooltip =Choose which learners can go through the gate +label.task.gate.opened =Opened lesson.monitors =Monitors lesson.remove.alert =You have selected to remove this lesson. Removed lessons can not be retrieved again. Continue? lesson.remove.doublecheck.alert =WARNING: This lesson is about to be removed! Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java =================================================================== diff -u -r40de3afab4e8d589660daffb6efd6e568e87f8fa -r903a4f947345a9960d5af2f3a7e7ab2f366884e0 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision 40de3afab4e8d589660daffb6efd6e568e87f8fa) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision 903a4f947345a9960d5af2f3a7e7ab2f366884e0) @@ -285,13 +285,12 @@ } @RequestMapping(path = "/addLesson", method = RequestMethod.POST) - public String addLesson(HttpServletRequest request, HttpServletResponse response, - @RequestParam String lessonName, @RequestParam long learningDesignID) - throws IOException, ServletException, ParseException { + public String addLesson(HttpServletRequest request, HttpServletResponse response, @RequestParam String lessonName, + @RequestParam long learningDesignID) throws IOException, ServletException, ParseException { if (!ValidationUtil.isOrgNameValid(lessonName)) { throw new IOException("Lesson name contains invalid characters"); } - + String[] organisationIdsStr = request.getParameterValues(AttributeNames.PARAM_ORGANISATION_ID); boolean introEnable = WebUtil.readBooleanParam(request, "introEnable", false); String introDescription = introEnable ? request.getParameter("introDescription") : null; @@ -461,8 +460,7 @@ * The Struts dispatch method to archive a lesson. */ @RequestMapping(path = "/archiveLesson", method = RequestMethod.POST) - public void archiveLesson(HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void archiveLesson(HttpServletRequest request, HttpServletResponse response) throws IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { monitoringService.archiveLesson(lessonId, getUserId()); @@ -475,8 +473,7 @@ * The Struts dispatch method to "unarchive" a lesson. Returns it back to its previous state. */ @RequestMapping(path = "/unarchiveLesson", method = RequestMethod.POST) - public void unarchiveLesson(HttpServletRequest request, HttpServletResponse response) - throws IOException { + public void unarchiveLesson(HttpServletRequest request, HttpServletResponse response) throws IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { monitoringService.unarchiveLesson(lessonId, getUserId()); @@ -628,8 +625,8 @@ } if (log.isDebugEnabled()) { - log.debug("Force complete for learners " + learnerIdNameBuf.toString() + " lesson " - + lessonId + ". " + message); + log.debug("Force complete for learners " + learnerIdNameBuf.toString() + " lesson " + lessonId + ". " + + message); } // audit log force completion attempt @@ -1135,7 +1132,7 @@ indfm.format(tzFinishDate) + " " + user.getTimeZone().getDisplayName(userLocale)); } - List contributeActivities = getContributeActivities(lessonId, false); + List contributeActivities = getContributeActivities(lessonId, false, false); if (contributeActivities != null) { responseJSON.set("contributeActivities", JsonUtil.readArray(contributeActivities)); } @@ -1205,7 +1202,7 @@ } ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); - List contributeActivities = getContributeActivities(lessonId, true); + List contributeActivities = getContributeActivities(lessonId, true, true); if (contributeActivities != null) { responseJSON.set("contributeActivities", JsonUtil.readArray(contributeActivities)); } @@ -1632,7 +1629,8 @@ } @SuppressWarnings("unchecked") - private List getContributeActivities(Long lessonId, boolean skipCompletedBranching) { + private List getContributeActivities(Long lessonId, boolean skipCompletedBranching, + boolean skipOpenedGates) { List contributeActivities = monitoringService.getAllContributeActivityDTO(lessonId); Lesson lesson = lessonService.getLesson(lessonId); @@ -1660,7 +1658,7 @@ contributeEntry.setIsComplete(learners.isEmpty()); } - if (!contributeEntry.getIsRequired() || contributeEntry.getIsComplete()) { + if (!contributeEntry.getIsRequired() || (skipOpenedGates && contributeEntry.getIsComplete())) { entryIterator.remove(); } } Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -ra61b6ad192148c0ae514f37a9b488c3a15535ee9 -r903a4f947345a9960d5af2f3a7e7ab2f366884e0 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision a61b6ad192148c0ae514f37a9b488c3a15535ee9) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 903a4f947345a9960d5af2f3a7e7ab2f366884e0) @@ -639,30 +639,45 @@ cell = $('
').addClass('contributeEntryCell').html(entryContent); row = row.append(cell); } - - if (contributeActivities ) { + if (contributeActivities) { $.each(contributeActivities, function(){ var cell = $('
').addClass('contributeActivityCell').text(this.title); - row = $('
').addClass('contributeRow').insertAfter(row).append(cell); + row = $('
').addClass('contributeRow').insertAfter(row).append(cell); $.each(this.contributeEntries, function(){ var entryContent = ''; - switch(this.contributionType) { + switch (this.contributionType) { case 3 : entryContent = LABELS.CONTRIBUTE_GATE; break; case 6 : entryContent = LABELS.CONTRIBUTE_GROUPING; break; case 7 : entryContent = LABELS.CONTRIBUTE_TOOL; break; case 9 : entryContent = LABELS.CONTRIBUTE_BRANCHING; break; case 11 : entryContent = LABELS.CONTRIBUTE_CONTENT_EDITED; break; case 12 : entryContent = LABELS.CONTRIBUTE_GATE_PASSWORD; break; } - entryContent += '' + LABELS.CONTRIBUTE_BUTTON + ''; + switch (this.contributionType) { + case 3 : + case 12 : if (this.isComplete) { + entryContent += '' + LABELS.CONTRIBUTE_OPENED_GATE + ''; + } else { + entryContent += '' + LABELS.CONTRIBUTE_OPEN_GATE_BUTTON + ''; + entryContent += '' + LABELS.CONTRIBUTE_OPEN_GATE_NOW_BUTTON + ''; + } + break; + default : entryContent += '' + LABELS.CONTRIBUTE_BUTTON + ''; + } + cell = $('
').addClass('contributeEntryCell').html(entryContent); row = row.append(cell); }); }); } + if ($('.contributeRow').length == 0) { $('#requiredTasks').hide(); } else { @@ -858,6 +873,21 @@ colorDialogList(table); } +function openGateNow(activityId) { + var data = { + 'activityId' : activityId + }; + data[csrfTokenName] = csrfTokenValue; + $.ajax({ + 'type' : 'post', + 'url' : LAMS_URL + 'monitoring/gate/openGate.do', + 'data' : data, + 'success' : function(){ + updateLessonTab(); + } + }); +} + //********** SEQUENCE TAB FUNCTIONS ********** /** Index: lams_monitoring/web/monitor.jsp =================================================================== diff -u -r5f6f06409fcbd7b3d32ad24c26b4905b54ec7c6f -r903a4f947345a9960d5af2f3a7e7ab2f366884e0 --- lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 5f6f06409fcbd7b3d32ad24c26b4905b54ec7c6f) +++ lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 903a4f947345a9960d5af2f3a7e7ab2f366884e0) @@ -158,6 +158,16 @@ CONTRIBUTE_TOOLTIP : '', CONTRIBUTE_BUTTON : '', + + CONTRIBUTE_OPEN_GATE_NOW_BUTTON : '', + + CONTRIBUTE_OPEN_GATE_NOW_TOOLTIP : '', + + CONTRIBUTE_OPEN_GATE_BUTTON : '', + + CONTRIBUTE_OPEN_GATE_TOOLTIP : '', + + CONTRIBUTE_OPENED_GATE : '', CONTRIBUTE_ATTENTION : '', @@ -517,6 +527,7 @@
+ - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - - - - - -
Index: lams_monitoring/web/tblmonitor/gates.jsp =================================================================== diff -u -r89279cb44b252167269043889b3c3c0a4164e0bb -r903a4f947345a9960d5af2f3a7e7ab2f366884e0 --- lams_monitoring/web/tblmonitor/gates.jsp (.../gates.jsp) (revision 89279cb44b252167269043889b3c3c0a4164e0bb) +++ lams_monitoring/web/tblmonitor/gates.jsp (.../gates.jsp) (revision 903a4f947345a9960d5af2f3a7e7ab2f366884e0) @@ -6,6 +6,22 @@ @@ -58,10 +74,16 @@ - +