Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rc76c8011ca9563b168a57f9bb4a2d81af7a13799 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision c76c8011ca9563b168a57f9bb4a2d81af7a13799) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -560,6 +560,7 @@ authoring.fla.page.menu.import.part =Import part authoring.fla.page.menu.save =Save authoring.fla.page.menu.saveas =Save as +authoring.fla.page.menu.apply.changes =Apply Changes authoring.fla.page.menu.export.lams =Export authoring.fla.page.menu.copy =Copy authoring.fla.page.menu.paste =Paste Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java =================================================================== diff -u -rf2ad75cef0c507a64877942631fee13efbc6ed50 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java (.../HomeController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java (.../HomeController.java) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -329,6 +329,7 @@ File imageFile = new File(imagePath); if (!imageFile.canRead()) { res.sendError(HttpServletResponse.SC_NOT_FOUND); + return; } boolean download = WebUtil.readBooleanParam(req, "download", false); Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -r37c404bc2d0032716112057bebc1314cbc30d102 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 37c404bc2d0032716112057bebc1314cbc30d102) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -142,9 +142,9 @@ WEIGHTS_NONE_FOUND_ERROR : decoderDiv.html('').text(), TEMPLATES : decoderDiv.html('').text(), + + LIVE_EDIT_SAVE : decoderDiv.html('').text(), - - // HandlerLib TRANSITION_FROM_EXISTS_ERROR : decoderDiv.html('').text(), Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -r0882342443acca1c706083159fbebdf4a7503da5 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 0882342443acca1c706083159fbebdf4a7503da5) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -2262,6 +2262,8 @@ $('#newButton, #openButton').parent().remove(); $('#importSequenceButton, #previewButton').remove(); $('#saveButton').parent().children('.dropdown-toggle, .dropdown-menu').remove(); + debugger; + $('#saveButton').text(LABELS.LIVE_EDIT_SAVE); $('#cancelLiveEditButton').show(); } @@ -2932,6 +2934,7 @@ return false; } + debugger; // check if we are in SVG recreation mode (Monitoring, Add Lesson) // and we need to update activities' coordinates on the back end if (isReadOnlyMode && layout.wasArranged) { Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java (.../LessonDetailsDTO.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java (.../LessonDetailsDTO.java) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -54,7 +54,9 @@ private Long learningDesignID; private Integer numberPossibleLearners; private Integer numberStartedLearners; - private Boolean locked_for_edit; + private Boolean lockedForEdit; + private Integer lockedForEditUserId; + private String lockedForEditUsername; private Boolean learnerPresenceAvailable; private Boolean learnerImAvailable; private Boolean liveEditEnabled; @@ -118,7 +120,11 @@ this.liveEditEnabled = lesson.getLiveEditEnabled(); - this.locked_for_edit = lesson.getLockedForEdit(); + this.lockedForEdit = lesson.getLockedForEdit(); + if ( this.lockedForEdit && lesson.getLearningDesign().getEditOverrideUser() != null ) { + this.lockedForEditUserId = lesson.getLearningDesign().getEditOverrideUser().getUserId(); + this.lockedForEditUsername = lesson.getLearningDesign().getEditOverrideUser().getFullName(); + } this.isPreview = lesson.isPreviewLesson(); this.enabledLessonNotifications = lesson.getEnableLessonNotifications(); @@ -279,21 +285,13 @@ } public Boolean getLockedForEdit() { - return locked_for_edit; + return lockedForEdit; } public Boolean getLiveEditEnabled() { return liveEditEnabled; } - public Boolean getLocked_for_edit() { - return locked_for_edit; - } - - public void setLocked_for_edit(Boolean locked_for_edit) { - this.locked_for_edit = locked_for_edit; - } - public Boolean getIsPreview() { return isPreview; } @@ -391,6 +389,10 @@ this.learnerImAvailable = learnerImAvailable; } + public void setLockedForEdit(Boolean lockedForEdit) { + this.lockedForEdit = lockedForEdit; + } + public void setLiveEditEnabled(Boolean liveEditEnabled) { this.liveEditEnabled = liveEditEnabled; } @@ -418,4 +420,20 @@ public void setGradebookOnComplete(Boolean gradebookOnComplete) { this.gradebookOnComplete = gradebookOnComplete; } + + public Integer getLockedForEditUserId() { + return lockedForEditUserId; + } + + public void setLockedForEditUserId(Integer lockedForEditUserId) { + this.lockedForEditUserId = lockedForEditUserId; + } + + public String getLockedForEditUsername() { + return lockedForEditUsername; + } + + public void setLockedForEditUsername(String lockedForEditUsername) { + this.lockedForEditUsername = lockedForEditUsername; + } } Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -ra8a83ef915717f418399b46f4c1df68be0ba8d18 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a8a83ef915717f418399b46f4c1df68be0ba8d18) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -241,7 +241,7 @@ learners.search.phrase.clear.tooltip =Clear search results button.live.edit =Live Edit button.live.edit.tooltip =Edit the current design for this lesson -button.live.edit.confirm =Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Save" the changes to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? +button.live.edit.confirm =Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Apply Changes" to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? button.journal.entries =Journal entries button.journal.entries.tooltip =View all Journal Entries saved by Learners tab.lesson =Lesson @@ -475,5 +475,5 @@ outcome.authoring.input =Search and select by outcome name or code outcome.authoring.existing =Added outcomes outcome.authoring.existing.none =none - +label.person.editing.lesson={0} is currently editing this lesson. #======= End labels: Exported 465 labels for en AU ===== Index: lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -ra8a83ef915717f418399b46f4c1df68be0ba8d18 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision a8a83ef915717f418399b46f4c1df68be0ba8d18) +++ lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -241,7 +241,7 @@ learners.search.phrase.clear.tooltip =Clear search results button.live.edit =Live Edit button.live.edit.tooltip =Edit the current design for this lesson -button.live.edit.confirm =Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Save" the changes to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? +button.live.edit.confirm =Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Apply Changes" to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? button.journal.entries =Journal entries button.journal.entries.tooltip =View all Journal Entries saved by Learners tab.lesson =Lesson Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java =================================================================== diff -u -rf2ad75cef0c507a64877942631fee13efbc6ed50 -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -97,7 +97,6 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.context.WebApplicationContext; import org.springframework.web.util.HtmlUtils; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -1396,6 +1395,20 @@ responseJSON.set("transitions", transitions); } + // check for live edit status + if ( lesson.getLiveEditEnabled() ) { + if ( lesson.getLockedForEdit()) { + responseJSON.put("lockedForEdit", true); + User currentEditor = lesson.getLearningDesign().getEditOverrideUser(); + if ( currentEditor != null ) { + responseJSON.put("lockedForEditUserId", currentEditor.getUserId()); + responseJSON.put("lockedForEditUsername", currentEditor.getFullName()); + } + } else { + responseJSON.put("lockedForEdit", false); + } + } + response.setContentType("application/json;charset=utf-8"); return responseJSON.toString(); Index: lams_monitoring/web/grouping/chosenGrouping.jsp =================================================================== diff -u -r087362663a394cc3ccf54d6a6a8c1f7e2d06fe4c -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/web/grouping/chosenGrouping.jsp (.../chosenGrouping.jsp) (revision 087362663a394cc3ccf54d6a6a8c1f7e2d06fe4c) +++ lams_monitoring/web/grouping/chosenGrouping.jsp (.../chosenGrouping.jsp) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -60,7 +60,7 @@

- + Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -609,12 +609,25 @@ } } - function updateContributeActivities(contributeActivities) { $('.contributeRow').remove(); var header = $('#contributeHeader'); - if (contributeActivities) { - var row = header; + var row = header; + + // special case - add a Live Edit option. This does not directly map to an activity + if ( lockedForEdit && lockedForEditUserId == userId) { + // show Live Edit task only if currently editing myself, not if someone else is editing. + // put it at the top of the contribution list + var cell = $('
').addClass('contributeActivityCell').text(LABELS.LIVE_EDIT_BUTTON); + var row = $('
').addClass('contributeRow').insertAfter(row).append(cell); + var entryContent = LABELS.LIVE_EDIT_TOOLTIP + + '' + LABELS.CONTRIBUTE_BUTTON + ''; + cell = $('
').addClass('contributeEntryCell').html(entryContent); + row = row.append(cell); + } + + if (contributeActivities ) { $.each(contributeActivities, function(){ var cell = $('
').addClass('contributeActivityCell').text(this.title); row = $('
').addClass('contributeRow').insertAfter(row).append(cell); @@ -1162,12 +1175,47 @@ } }); initializePortraitPopover(LAMS_URL, 'large', 'top'); + + // update the cache global values so that the contributions & the Live Edit buttons will update + lockedForEdit = response.lockedForEdit; + lockedForEditUserId = response.lockedForEditUserId; + lockedForEditUsername = response.lockedForEditUsername; + updateLiveEdit(); sequenceRefreshInProgress = false; } }); } +function updateLiveEdit() { + if ( liveEditEnabled ) { + if ( lockedForEdit ) { + if ( userId == lockedForEditUserId ) { + $("#liveEditButton").removeClass('btn-default'); + $("#liveEditButton").addClass('btn-primary'); + $("#liveEditButton").show(); + $("#liveEditWarning").hide(); + $("#liveEditWarning").text(""); + } else { + $("#liveEditButton").removeClass('btn-primary'); + $("#liveEditButton").addClass('btn-default'); + $("#liveEditButton").hide(); + $("#liveEditWarning").text(LABELS.LIVE_EDIT_WARNING.replace("%0",lockedForEditUsername)); + $("#liveEditWarning").show(); + } + } else { + $("#liveEditButton").removeClass('btn-primary'); + $("#liveEditButton").addClass('btn-default'); + $("#liveEditButton").show(); + $("#liveEditWarning").hide(); + $("#liveEditWarning").text(""); + } + } else { + $("#liveEditButton").hide(); + $("#liveEditWarning").hide(); + } +} + function loadLearningDesignSVG() { var exit = false; // fetch SVG just once, since it is immutable Index: lams_monitoring/web/monitor.jsp =================================================================== diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -r44f25ff763552baf103b1bb4ed7d1d2466a937dc --- lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd) +++ lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 44f25ff763552baf103b1bb4ed7d1d2466a937dc) @@ -53,6 +53,10 @@ createDateTimeStr = '${lesson.createDateTimeStr}', lessonStartDate = '${lesson.scheduleStartDate}', lessonEndDate = '${lesson.scheduleEndDate}', + liveEditEnabled = ${enableLiveEdit && lesson.liveEditEnabled}, + lockedForEdit = '${lesson.lockedForEdit}', + lockedForEditUserId = '${lesson.lockedForEditUserId}', + lockedForEditUsername = '${lesson.lockedForEditUsername}', // settings for progress bar isHorizontalBar = true, hasContentFrame = false, @@ -212,7 +216,13 @@ RESCHEDULE : decoderDiv.html('').text(), - LESSON_ERROR_START_END_DATE : decoderDiv.html('').text() + LESSON_ERROR_START_END_DATE : decoderDiv.html('').text(), + + LIVE_EDIT_BUTTON: '', + + LIVE_EDIT_TOOLTIP: '', + + LIVE_EDIT_WARNING: '' } $(document).ready(function(){ @@ -558,6 +568,8 @@ + +
@@ -566,13 +578,10 @@ href="#" onClick="javascript:refreshMonitor('sequence')"> - - - - - + + +