Index: lams_admin/web/WEB-INF/tags/Page.tag =================================================================== diff -u -rf7cb84defcd7ff6e4f3232f2ef1856f1311215d9 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_admin/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision f7cb84defcd7ff6e4f3232f2ef1856f1311215d9) +++ lams_admin/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,49 +1,291 @@ <%@ tag body-content="scriptless"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> <%@ attribute name="headingContent" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + + - -
-
+ + <%-- Combined tab and navigation bar used in authoring and monitoring --%> +
+
+ +
+
+
+
+ + + <%-- Learner --%> + + <%-- Try to get authoring preview/learning/monitoring from the tool activity so we don't show the progress bar in monitoring --%> + + + + + + + + + + + <%-- only have sidebar and presence in learner --%> + + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + - - - - - -
- -
-
- - - ${titleHelpURL} - -
- - + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ + + ${titleHelpURL} + +
+ + + +
+
+
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== diff -u -r509cebe97fca335b7d517abc7e8d9af03d6eab2e -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 509cebe97fca335b7d517abc7e8d9af03d6eab2e) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -186,24 +186,13 @@ req.setAttribute(AttributeNames.PARAM_MODE, mode); } - req.setAttribute(AttributeNames.PARAM_LESSON_ID, String.valueOf(lessonId)); - req.setAttribute("allowRestart", lesson.getAllowLearnerRestart()); - req.setAttribute(AttributeNames.PARAM_PRESENCE_ENABLED, - String.valueOf(lesson.getLearnerPresenceAvailable())); - req.setAttribute(AttributeNames.PARAM_PRESENCE_IM_ENABLED, String.valueOf(lesson.getLearnerImAvailable())); - req.setAttribute(AttributeNames.PARAM_TITLE, lesson.getLessonName()); - - /* Date Format for Chat room append */ - DateFormat sfm = new SimpleDateFormat("yyyyMMdd_HHmmss"); - req.setAttribute(AttributeNames.PARAM_CREATE_DATE_TIME, sfm.format(lesson.getCreateDateTime())); - - // forward to /lams/learning/main.jsp + // forward to the next (possibly first) activity. String serverURLContextPath = Configuration.get(ConfigurationKeys.SERVER_URL_CONTEXT_PATH); serverURLContextPath = serverURLContextPath.startsWith("/") ? serverURLContextPath : "/" + serverURLContextPath; serverURLContextPath += serverURLContextPath.endsWith("/") ? "" : "/"; getServlet().getServletContext().getContext(serverURLContextPath + "learning") - .getRequestDispatcher("/main.jsp").forward(req, res); + .getRequestDispatcher("/content.do?lessonID="+lessonId).forward(req, res); return null; } catch (Exception e) { Index: lams_central/web/WEB-INF/tags/Page.tag =================================================================== diff -u -radd7948dbdf9451fb5bb7839e22d2f22ca8b54f1 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision add7948dbdf9451fb5bb7839e22d2f22ca8b54f1) +++ lams_central/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,49 +1,291 @@ <%@ tag body-content="scriptless"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> <%@ attribute name="headingContent" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + + - -
-
+ + <%-- Combined tab and navigation bar used in authoring and monitoring --%> +
+
+ +
+
+
+
+ + + <%-- Learner --%> + + <%-- Try to get authoring preview/learning/monitoring from the tool activity so we don't show the progress bar in monitoring --%> + + + + + + + + + + + <%-- only have sidebar and presence in learner --%> + + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + - - - - - -
- -
-
- - - ${titleHelpURL} - -
- - + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ + + ${titleHelpURL} + +
+ + + +
+
+
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file Index: lams_central/web/comments/allview.jsp =================================================================== diff -u -r11360fc3bf2b7ed6ea197873e1b67dbf87d64d33 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/comments/allview.jsp (.../allview.jsp) (revision 11360fc3bf2b7ed6ea197873e1b67dbf87d64d33) +++ lams_central/web/comments/allview.jsp (.../allview.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -23,5 +23,5 @@
\ No newline at end of file Index: lams_central/web/comments/topicview.jsp =================================================================== diff -u -r11360fc3bf2b7ed6ea197873e1b67dbf87d64d33 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/comments/topicview.jsp (.../topicview.jsp) (revision 11360fc3bf2b7ed6ea197873e1b67dbf87d64d33) +++ lams_central/web/comments/topicview.jsp (.../topicview.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -162,7 +162,7 @@
-
+
Index: lams_central/web/css/defaultHTML_learner.css =================================================================== diff -u -rb75c055c6e1fbc3f8522de9376363afb19539679 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/css/defaultHTML_learner.css (.../defaultHTML_learner.css) (revision b75c055c6e1fbc3f8522de9376363afb19539679) +++ lams_central/web/css/defaultHTML_learner.css (.../defaultHTML_learner.css) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -328,4 +328,138 @@ } #criterias-table td { vertical-align:middle; +} + +/* .....NavBar: Icon only with coloring/layout.....*/ + +/*small/medium side display*/ +@media (min-width: 768px) { + + /*Allow content to be next to Nav*/ + .navcontent{ + position: absolute; + width: calc(100% - 40px); /*keeps 100% minus nav size*/ + margin-left: 40px; + float: right; + min-height:100%; + } + + /* darker outline than usual */ + nav.sidebar{ + border-radius: 0px; + box-shadow: 0 1px 1px rgba(8, 8, 8, 0.88); + } + + /*Center Brand*/ + nav.sidebar.navbar.sidebar>.container .navbar-brand, .navbar>.container-fluid .navbar-brand { + margin-left: 0px; + } + /*Center Brand*/ + nav.sidebar .navbar-brand, nav.sidebar .navbar-header{ + text-align: center; + width: 100%; + margin-left: 0px; + } + + /*Format Icons*/ + nav.sidebar a{ + padding:10px 10px 10px 12px; + } + + nav.sidebar.slidesidemenu{ + padding:10px 10px 10px 12px; + } + /*Hide text when compressed*/ + nav.sidebar p{ + padding-right: 35px; + text-align: center; + } + + /* colour in top box to match panel heading */ + nav.sidebar .navbar-nav > li:first-child{ + background-color:#f5f5f5 !important; + } + + /*adds border to bottom nav boxes except for the last box */ + nav.sidebar .navbar-nav > li{ + border-bottom: 1px #e5e5e5 solid; + background-color:#fff; + } + + nav.sidebar .navbar-nav > li:last-child{ + border-bottom: 0px; + } + + /*allows nav box to use 100% width, style to be like panel */ + nav.sidebar .navbar-collapse, nav.sidebar .container-fluid{ + padding: 0 0px 0 0px; + border:2px solid transparent; + box-shadow:0 1px 1px rgba(0,0,0,0.05) + } + + /*gives sidebar width/height*/ + nav.sidebar{ + width: 180px; + height: 100%; + margin-left: -135px; + float: left; + z-index: 8000; + margin-top: 0px; + margin-bottom: 0px; + } + + /*give sidebar 100% width;*/ + nav.sidebar li { + width: 100%; + } + + /* Move nav to full on mouse over*/ + nav.sidebar.expandmenu { + margin-left: 0; + } + +/* nav.sidebar:hover{ + margin-left: 0px; + } + */ + /*for hiden things when navbar hidden*/ + .forAnimate{ + opacity: 0; + } + +} + +/* .....NavBar: Fully showing nav bar..... */ + +@media (min-width: 1330px) { + + /*Allow content to be next to Nav*/ + .navcontent{ + position: absolute; + width: calc(100% - 180px); /*keeps 100% minus nav size*/ + margin-left: 170px; + float: right; + } + + /*Show all nav*/ + nav.sidebar{ + margin-left: 0px; + float: left; + } + /*Show hidden items on nav*/ + nav.sidebar .forAnimate{ + opacity: 1; + } +} + +nav.sidebar .navbar-nav .open .dropdown-menu>li>a:hover, nav.sidebar .navbar-nav .open .dropdown-menu>li>a:focus { + color: #CCC; + background-color: transparent; +} + +nav:hover .forAnimate{ + opacity: 1; +} +section{ + padding-left: 15px; } \ No newline at end of file Index: lams_central/web/includes/javascript/openUrls.js =================================================================== diff -u -r3dbf966d900adefc34cdad501d3c392118451cd9 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision 3dbf966d900adefc34cdad501d3c392118451cd9) +++ lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -103,13 +103,13 @@ function openLearner( lessonId ) { if (isMac) { - learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,status=yes'); + learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,scrollbars=yes,status=yes'); } else { if (learnWin && !learnWin.closed ) { learnWin.location = 'home.do?method=learner&lessonID='+lessonId; learnWin.focus(); } else { - learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,status=yes'); + learnWin = window.open('home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,scrollbars=yes,status=yes'); } } } @@ -121,15 +121,15 @@ */ function openLearnerShortenedUrl( lessonId ) { if (isMac) { - learnWin = window.open('../home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,status=yes'); + learnWin = window.open('../home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,scrollbars=yes,status=yes'); } else { if (learnWin && !learnWin.closed ) { learnWin.location = '../home.do?method=learner&lessonID='+lessonId; learnWin.focus(); } else { - learnWin = window.open('../home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,status=yes'); + learnWin = window.open('../home.do?method=learner&lessonID='+lessonId,'lWindow','width=' + learner_width + ',height=' + learner_height + ',resizable,scrollbars=yes,status=yes'); } - } + } } function openSysadmin() { Index: lams_central/web/includes/javascript/progressBar.js =================================================================== diff -u -r8cb13884a046af1fee45dc7ab6e6f5a7f21c07c9 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_central/web/includes/javascript/progressBar.js (.../progressBar.js) (revision 8cb13884a046af1fee45dc7ab6e6f5a7f21c07c9) +++ lams_central/web/includes/javascript/progressBar.js (.../progressBar.js) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,8 +1,10 @@  //------- GLOBAL VARIABLES ---------- //IMPORTANT: set following variables on the page which imports this JS file -var isHorizontalBar = isHorizontalBar || false, +var lessonId = lessonId || null, + toolSessionId = toolSessionId || null, + progressPanelEnabled = progressPanelEnabled || false, + isHorizontalBar = isHorizontalBar || false, hasContentFrame = hasContentFrame || true, - isTouchInterface = isTouchInterface || false, hasDialog = hasDialog || false, presenceEnabled = presenceEnabled || false, REVIEW_ACTIVITY_TITLE = REVIEW_ACTIVITY_TITLE || 'Review activity', @@ -109,50 +111,7 @@ } } -// adjusts elements after window resize -function resizeElements() { - var width = $('#controlFrame').is(":visible")? $(window).width() - 160 : $(window).width(); - var height = $(window).height(); - if (hasContentFrame) { - // resize main content frame, if it is present - var position = (isTouchInterface) ? 'static' : 'fixed'; - $('#contentFrame').css({ - 'width' : width + "px", - 'height' : height + "px", - 'position' : position - }); - } - - // do the real resizing; applicable only for Learner page - if (!isHorizontalBar && progressPanelEnabled) { - if (hasContentFrame && !controlFramePadding) { - // calculate only once in the beginning - // there will be miscalculations when trying to repeat this - // in the middle of resizing - controlFramePadding = $('#controlFrame').outerHeight(true) - - $('#controlFrame').height(); - } - - // calculate immutable chunks and what is left goes for progress bar - var progressBarHeight = height - controlFramePadding; - $('.progressStaticHeight').each(function() { - var elem = $(this); - // are notebook and/or support activities hidden? - if (elem.is(':visible')) { - progressBarHeight -= elem.outerHeight(true); - } - }); - - $('#progressBarDiv').height(progressBarHeight); - } - - if (presenceEnabled) { - // resize chat frame only if it exists - resizeChat(); - } -} - // double click triggers also single click event, this method helps function handleClicks(elem, click, dblClick) { var handler = function(event) { @@ -1045,6 +1004,7 @@ data : { 'method' : 'getLearnerProgress', 'lessonID' : lessonId, + 'toolSessionID' : toolSessionId, 'userID' : bar.userId }, cache : false, @@ -1068,6 +1028,20 @@ return; } + if (typeof LABELS == "undefined" && result.messages) { + LABELS = { + CURRENT_ACTIVITY : result.messages["label.learner.progress.activity.current.tooltip"], + COMPLETED_ACTIVITY : result.messages["label.learner.progress.activity.completed.tooltip"], + ATTEMPTED_ACTIVITY : result.messages["label.learner.progress.activity.attempted.tooltip"], + TOSTART_ACTIVITY : result.messages["label.learner.progress.activity.tostart.tooltip"], + SUPPORT_ACTIVITY : result.messages["label.learner.progress.activity.support.tooltip"], + CONFIRM_RESTART : result.messages["message.learner.progress.restart.confirm"], + RESTART: result.messages["message.lesson.restart.button"], + NOTEBOOK: result.messages["label.learner.progress.notebook"], + EXIT : result.messages["button.exit"] + }; + } + bar.currentActivityId = result.currentActivityId; isPreview = result.isPreview; @@ -1194,13 +1168,18 @@ }); } - resizeElements(); // scroll to the current activity if (!isHorizontalBar) { $('#' + bar.containerId).scrollTop( Math.max((currentActivityIndex - 1) * 60,0) ); } + + //callback function + if (typeof onProgressBarLoaded === "function") { + // safe to use the function + onProgressBarLoaded(); + } } }); Index: lams_learning/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r509cebe97fca335b7d517abc7e8d9af03d6eab2e -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 509cebe97fca335b7d517abc7e8d9af03d6eab2e) +++ lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -43,6 +43,7 @@ mynotes.title =My Notes mynotes.view.all.button =View All mynotes.add.new.button =Add New +mynotes.add.new.current.lesson.button =Add New In Current Lesson mynotes.notebook.save.button =Save to Notebook mynotes.journal.save.button =Save to Journal mynotes.signature.JOURNAL.heading =Journal Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml =================================================================== diff -u -r3dbf966d900adefc34cdad501d3c392118451cd9 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 3dbf966d900adefc34cdad501d3c392118451cd9) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -11,12 +11,26 @@ --> - + org.lamsfoundation.lams.monitoring.ApplicationResources + + + + + + + org.lamsfoundation.lams.learning.ApplicationResources + + + + + + + Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerServiceProxy.java =================================================================== diff -u -r509cebe97fca335b7d517abc7e8d9af03d6eab2e -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerServiceProxy.java (.../LearnerServiceProxy.java) (revision 509cebe97fca335b7d517abc7e8d9af03d6eab2e) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerServiceProxy.java (.../LearnerServiceProxy.java) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -21,7 +21,6 @@ * **************************************************************** */ - package org.lamsfoundation.lams.learning.service; import javax.servlet.ServletContext; @@ -30,6 +29,7 @@ import org.lamsfoundation.lams.lesson.service.ILessonService; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.MessageService; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -48,7 +48,7 @@ /** * Return the learner domain service object. It will delegate to the Spring * helper method to retrieve the proper bean from Spring bean factory. - * + * * @param servletContext * the servletContext for current application * @return learner service object. @@ -61,7 +61,7 @@ * Return the user management domain service object. It will delegate to * the Spring helper method to retrieve the proper bean from Spring bean * factory - * + * * @param servletContext * the servletContext for current application * @return user management service object @@ -73,7 +73,7 @@ /** * Return the lams tool domain service object. It will delegate to the * Spring helper method to retrieve the proper bean from Spring bean factory. - * + * * @param serlvetContext * the servletContext for current application * @return tool service object @@ -86,9 +86,17 @@ return (ILessonService) LearnerServiceProxy.getDomainService(servletContext, "lessonService"); } + public static final MessageService getMessageService(ServletContext servletContext) { + return (MessageService) LearnerServiceProxy.getDomainService(servletContext, "learningMessageService"); + } + + public static final MessageService getMonitoringMessageService(ServletContext servletContext) { + return (MessageService) LearnerServiceProxy.getDomainService(servletContext, "monitoringMessageService"); + } + /** * Return the activity mapping service object. - * + * * @param serlvetContext * the servletContext for current application * @return the activity mapping service object. @@ -99,7 +107,7 @@ /** * Retrieve the proper Spring bean from bean factory. - * + * * @param servletContext * the servletContext for current application * @return the Spring service bean. Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java =================================================================== diff -u -r509cebe97fca335b7d517abc7e8d9af03d6eab2e -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (.../LearnerAction.java) (revision 509cebe97fca335b7d517abc7e8d9af03d6eab2e) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (.../LearnerAction.java) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -54,11 +54,13 @@ import org.lamsfoundation.lams.lesson.LearnerProgressArchive; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.lesson.service.ILessonService; +import org.lamsfoundation.lams.tool.ToolSession; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; @@ -89,6 +91,18 @@ // --------------------------------------------------------------------- private static Logger log = Logger.getLogger(LearnerAction.class); + private static JSONObject progressBarMessages = null; + + private static final String[] MONITOR_MESSAGE_KEYS = new String[] { + "label.learner.progress.activity.current.tooltip", "label.learner.progress.activity.completed.tooltip", + "label.learner.progress.activity.attempted.tooltip", "label.learner.progress.activity.tostart.tooltip", + "label.learner.progress.activity.support.tooltip"}; + + private static final String[] LEARNER_MESSAGE_KEYS = new String[] { + "message.learner.progress.restart.confirm", "message.lesson.restart.button", + "label.learner.progress.notebook", "button.exit"}; + + // --------------------------------------------------------------------- // Class level constants - Struts forward // --------------------------------------------------------------------- @@ -244,15 +258,25 @@ monitorId = userId; } - Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + JSONObject responseJSON = new JSONObject(); + Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true); + if (lessonId == null) { + // depending on when this is called, there may only be a toolSessionId known, not the lessonId. + Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + ToolSession toolSession = LearnerServiceProxy.getLamsToolService(getServlet().getServletContext()) + .getToolSession(toolSessionId); + lessonId = toolSession.getLesson().getLessonId(); + } + + responseJSON.put("messages", getProgressBarMessages()); + ICoreLearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()); Object[] ret = learnerService.getStructuredActivityURLs(learnerId, lessonId); if (ret == null) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); return null; } - JSONObject responseJSON = new JSONObject(); responseJSON.put("currentActivityId", ret[1]); responseJSON.put("isPreview", ret[2]); for (ActivityURL activity : (List) ret[0]) { @@ -374,4 +398,53 @@ return activityJSON; } + + private JSONObject getProgressBarMessages() throws JSONException { + if (progressBarMessages == null) { + progressBarMessages = new JSONObject(); + MessageService messageService = LearnerServiceProxy.getMonitoringMessageService(getServlet().getServletContext()); + for (String key : MONITOR_MESSAGE_KEYS) { + String value = messageService.getMessage(key); + progressBarMessages.put(key, value); + } + messageService = LearnerServiceProxy.getMessageService(getServlet().getServletContext()); + for (String key : LEARNER_MESSAGE_KEYS) { + String value = messageService.getMessage(key); + progressBarMessages.put(key, value); + } + } + return progressBarMessages; + } + + /** + * Gets the lesson details based on lesson id or the current tool session + */ + public ActionForward getLessonDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws JSONException, IOException { + + JSONObject responseJSON = new JSONObject(); + Lesson lesson = null; + + Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true); + if ( lessonID != null ) { + lesson = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()).getLesson(lessonID); + + } else { + Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + ToolSession toolSession = LearnerServiceProxy.getLamsToolService(getServlet().getServletContext()) + .getToolSession(toolSessionId); + lesson = toolSession.getLesson(); + } + + responseJSON.put(AttributeNames.PARAM_LESSON_ID, lesson.getLessonId()); + responseJSON.put(AttributeNames.PARAM_TITLE, lesson.getLessonName()); + responseJSON.put("allowRestart", lesson.getAllowLearnerRestart()); + responseJSON.put(AttributeNames.PARAM_PRESENCE_ENABLED, lesson.getLearnerPresenceAvailable()); + responseJSON.put(AttributeNames.PARAM_PRESENCE_IM_ENABLED, lesson.getLearnerImAvailable()); + + response.setContentType("application/json;charset=utf-8"); + response.getWriter().print(responseJSON.toString()); + + return null; + } } \ No newline at end of file Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java =================================================================== diff -u -r509cebe97fca335b7d517abc7e8d9af03d6eab2e -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java (.../LessonCompleteActivityAction.java) (revision 509cebe97fca335b7d517abc7e8d9af03d6eab2e) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java (.../LessonCompleteActivityAction.java) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -74,9 +74,7 @@ if (lessonFinishCallbackUrl != null) { request.setAttribute("lessonFinishUrl", lessonFinishCallbackUrl); } - if (learnerProgress.getLesson().getAllowLearnerRestart()) { request.setAttribute("lessonID", learnerProgress.getLesson().getLessonId()); - } return mapping.findForward("lessonComplete"); } Index: lams_learning/web/WEB-INF/tags/Page.tag =================================================================== diff -u -r5d896b9c108705c770d5294510f60ae9aa027f6d -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 5d896b9c108705c770d5294510f60ae9aa027f6d) +++ lams_learning/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,36 +1,291 @@ <%@ tag body-content="scriptless"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> <%@ attribute name="headingContent" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + + - -
-
+ + <%-- Combined tab and navigation bar used in authoring and monitoring --%> +
+
-
- -
-
- - - - + +
+
+
+ + + + <%-- Learner --%> + + <%-- Try to get authoring preview/learning/monitoring from the tool activity so we don't show the progress bar in monitoring --%> + + + + + + + + + + + <%-- only have sidebar and presence in learner --%> + + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + + + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_learning/web/WEB-INF/web.xml =================================================================== diff -u -rb4460e9343e9676b6fc81f5f3c27b2800d865b20 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/WEB-INF/web.xml (.../web.xml) (revision b4460e9343e9676b6fc81f5f3c27b2800d865b20) +++ lams_learning/web/WEB-INF/web.xml (.../web.xml) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -10,7 +10,7 @@ messageSource - learningMessageSource + monitoringMessageSource Index: lams_learning/web/css/presence.css =================================================================== diff -u -r9c603f82a3332d5e2e5b290bcc550f263c09a8f8 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/css/presence.css (.../presence.css) (revision 9c603f82a3332d5e2e5b290bcc550f263c09a8f8) +++ lams_learning/web/css/presence.css (.../presence.css) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -4,7 +4,7 @@ #presenceChat { position: absolute; - width: 600px; + width: 640px; height: 300px; right: 18px; z-index: 10; @@ -88,10 +88,8 @@ } .messageInput { - float: left; - width: 85%; + width: 80%; } .sendButton { - float: left; } \ No newline at end of file Fisheye: Tag 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f refers to a dead (removed) revision in file `lams_learning/web/includes/javascript/main.js'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_learning/web/includes/javascript/presence.js =================================================================== diff -u -r9c603f82a3332d5e2e5b290bcc550f263c09a8f8 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/includes/javascript/presence.js (.../presence.js) (revision 9c603f82a3332d5e2e5b290bcc550f263c09a8f8) +++ lams_learning/web/includes/javascript/presence.js (.../presence.js) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,6 +1,9 @@ $(document).ready(function (){ presenceChat = $("#presenceChat"); rosterDiv = $("#presenceUserListings"); + $( window ).resize(function() { + resizeChat(); + }); // if presence IM is enabled if (presenceEnabled) { @@ -174,21 +177,24 @@ } function resizeChat() { + // refresh the window height windowHeight = $(window).height() - 30; // if presence is shown if (presenceShown) { // set presence chat to maximized height presenceChat.css({ - 'top' : windowHeight - 270 + "px" + 'top' : windowHeight - 300 + "px", + 'position' : 'absolute' }); } // otherwise else { // set presence chat to minimized height presenceChat.css({ - 'top' : windowHeight + "px" + 'top' : windowHeight + "px", + 'position' : 'fixed' }); } } @@ -266,7 +272,6 @@ messageInput.val(''); messageInput.focus(); - var data = { 'type' : 'message', 'lessonID' : lessonId, @@ -293,7 +298,7 @@ presenceShown = false; } else { presenceChat.animate({ - top : windowHeight - 270 + "px" + top : windowHeight - 300 + "px" }, 1000); presenceShown = true; } Index: lams_learning/web/lessonComplete.jsp =================================================================== diff -u -rd672a99e40d479d9679a4f2e8a33ff981242cb7d -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/lessonComplete.jsp (.../lessonComplete.jsp) (revision d672a99e40d479d9679a4f2e8a33ff981242cb7d) +++ lams_learning/web/lessonComplete.jsp (.../lessonComplete.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -27,6 +27,8 @@ <%@ taglib uri="tags-fmt" prefix="fmt"%> <%@ taglib uri="tags-lams" prefix="lams"%> + + - + @@ -64,8 +66,7 @@
- <%-- lessonID is set in CompleteActivityAction and LessonCompleteActivityAction only if lesson.allowLearnerRestart is on --%> - +
Index: lams_learning/web/loadToolActivity.jsp =================================================================== diff -u -r5d896b9c108705c770d5294510f60ae9aa027f6d -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/loadToolActivity.jsp (.../loadToolActivity.jsp) (revision 5d896b9c108705c770d5294510f60ae9aa027f6d) +++ lams_learning/web/loadToolActivity.jsp (.../loadToolActivity.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -30,6 +30,7 @@ + @@ -65,7 +66,9 @@ Fisheye: Tag 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f refers to a dead (removed) revision in file `lams_learning/web/main.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_learning/web/notebook/addnew.jsp =================================================================== diff -u -r89df586d9d0d7b3267139a0604c423f67df70007 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/notebook/addnew.jsp (.../addnew.jsp) (revision 89df586d9d0d7b3267139a0604c423f67df70007) +++ lams_learning/web/notebook/addnew.jsp (.../addnew.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -44,7 +44,7 @@ - + Index: lams_learning/web/notebook/view.jsp =================================================================== diff -u -r89df586d9d0d7b3267139a0604c423f67df70007 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/notebook/view.jsp (.../view.jsp) (revision 89df586d9d0d7b3267139a0604c423f67df70007) +++ lams_learning/web/notebook/view.jsp (.../view.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -52,7 +52,7 @@ - + Index: lams_learning/web/notebook/viewall.jsp =================================================================== diff -u -r84cf5e740ee5770646e6fbf86bcbd63afff21e08 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/notebook/viewall.jsp (.../viewall.jsp) (revision 84cf5e740ee5770646e6fbf86bcbd63afff21e08) +++ lams_learning/web/notebook/viewall.jsp (.../viewall.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -38,7 +38,16 @@ - + + + + + +
+ +
+
Index: lams_learning/web/notebook/viewalljournals.jsp =================================================================== diff -u -r89df586d9d0d7b3267139a0604c423f67df70007 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/notebook/viewalljournals.jsp (.../viewalljournals.jsp) (revision 89df586d9d0d7b3267139a0604c423f67df70007) +++ lams_learning/web/notebook/viewalljournals.jsp (.../viewalljournals.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -28,7 +28,7 @@ - +

Index: lams_learning/web/presenceChat.jsp =================================================================== diff -u -r9c603f82a3332d5e2e5b290bcc550f263c09a8f8 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/presenceChat.jsp (.../presenceChat.jsp) (revision 9c603f82a3332d5e2e5b290bcc550f263c09a8f8) +++ lams_learning/web/presenceChat.jsp (.../presenceChat.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,52 +1,73 @@ -<%-- css --%> - - + -<%-- javascript --%> - - - +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> -<%-- initial html / presence.js adds on html into here --%> -
- <%-- only pop the message box if im is enabled --%> - -
-
    -
  • - -
  • -
-
-
-
- - " class="sendButton" - onclick="javascript:sendMessage(groupChatInfo.nick)" /> -
-
-
-
+ + - <%-- always pop the roster --%> -
-
-
+ <%-- css --%> + + + + <%-- javascript --%> + + + + + + + + + <%-- initial html / presence.js adds on html into here --%> +
+ <%-- only pop the message box if im is enabled --%> + +
+
    +
  • + +
  • +
+
+
+
+ + " class="sendButton" + onclick="javascript:sendMessage(groupChatInfo.nick)" /> +
+
+
+
+ + <%-- always pop the roster --%> +
+
+
+
-
\ No newline at end of file + + +
\ No newline at end of file Index: lams_learning/web/requestURL.jsp =================================================================== diff -u -r2ef18e4c87e2e7929950dbeb990c6715ef16c0c2 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/requestURL.jsp (.../requestURL.jsp) (revision 2ef18e4c87e2e7929950dbeb990c6715ef16c0c2) +++ lams_learning/web/requestURL.jsp (.../requestURL.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -32,13 +32,12 @@ Index: lams_learning/web/welcome.jsp =================================================================== diff -u -ra74096f6ac07dcd2fa40df061466c0b8176f5f73 -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_learning/web/welcome.jsp (.../welcome.jsp) (revision a74096f6ac07dcd2fa40df061466c0b8176f5f73) +++ lams_learning/web/welcome.jsp (.../welcome.jsp) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -22,14 +22,16 @@ <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> <%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams" %> - + Index: lams_monitoring/web/WEB-INF/tags/Page.tag =================================================================== diff -u -r5848d955870689ca056a8f7ea7c147947d07dd0f -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f --- lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 5848d955870689ca056a8f7ea7c147947d07dd0f) +++ lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) @@ -1,49 +1,291 @@ <%@ tag body-content="scriptless"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> <%@ attribute name="headingContent" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + + - -
-
+ + <%-- Combined tab and navigation bar used in authoring and monitoring --%> +
+
+ +
+
+
+
+ + + <%-- Learner --%> + + <%-- Try to get authoring preview/learning/monitoring from the tool activity so we don't show the progress bar in monitoring --%> + + + + + + + + + + + <%-- only have sidebar and presence in learner --%> + + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + - - - - - -
- -
-
- - - - -
- - + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ + + ${titleHelpURL} + +
+ + + +
+
+
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file