Index: lams_admin/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.10 -r1.1.2.11 --- lams_admin/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:00:17 -0000 1.1.2.10 +++ lams_admin/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:18 -0000 1.1.2.11 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_build/lib/lams/lams-learning.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-learning.jar,v diff -u -r1.51.2.5 -r1.51.2.6 Binary files differ Index: lams_central/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.15 -r1.1.2.16 --- lams_central/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:03:06 -0000 1.1.2.15 +++ lams_central/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:19 -0000 1.1.2.16 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch2040066.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/dbupdates/Attic/patch2040066.sql,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch2040066.sql 10 Aug 2016 18:33:15 -0000 1.1.2.1 +++ lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch2040066.sql 11 Aug 2016 13:19:29 -0000 1.1.2.2 @@ -11,7 +11,10 @@ user_name VARCHAR(191), create_date DATETIME NOT NULL, command_text TEXT, - PRIMARY KEY (uid) + PRIMARY KEY (uid), + INDEX idx_lesson_id (lesson_id), + INDEX idx_user_name (user_name), + INDEX idx_create_date (create_date) )ENGINE=InnoDB; COMMIT; Index: lams_learning/conf/hibernate/mappings/org/lamsfoundation/lams/learning/command/Command.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_learning/conf/hibernate/mappings/org/lamsfoundation/lams/learning/command/Attic/Command.hbm.xml,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_learning/conf/hibernate/mappings/org/lamsfoundation/lams/learning/command/Command.hbm.xml 10 Aug 2016 18:36:37 -0000 1.1.2.1 +++ lams_learning/conf/hibernate/mappings/org/lamsfoundation/lams/learning/command/Command.hbm.xml 11 Aug 2016 13:19:28 -0000 1.1.2.2 @@ -7,7 +7,7 @@ Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml,v diff -u -r1.32.2.10 -r1.32.2.11 --- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml 28 Jul 2016 03:45:04 -0000 1.32.2.10 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml 11 Aug 2016 13:19:28 -0000 1.32.2.11 @@ -54,6 +54,7 @@ + @@ -97,11 +98,13 @@ - + + + Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `lams_learning/src/java/org/lamsfoundation/lams/learning/command/Command.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_learning/src/java/org/lamsfoundation/lams/learning/command/CommandWebsocketServer.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/command/Attic/CommandWebsocketServer.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_learning/src/java/org/lamsfoundation/lams/learning/command/CommandWebsocketServer.java 10 Aug 2016 18:36:37 -0000 1.1.2.1 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/command/CommandWebsocketServer.java 11 Aug 2016 13:19:27 -0000 1.1.2.2 @@ -16,6 +16,7 @@ import javax.websocket.server.ServerEndpoint; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learning.command.model.Command; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.util.hibernate.HibernateSessionManager; import org.lamsfoundation.lams.web.session.SessionManager; @@ -39,7 +40,7 @@ private static class SendWorker extends Thread { private boolean stopFlag = false; // how ofter the thread runs - private static final long CHECK_INTERVAL = 2000; + private static final long CHECK_INTERVAL = 5000; // mapping lessonId -> timestamp when the check was last performed, so the thread does not run too often private final Map lastSendTimes = new TreeMap(); @@ -95,10 +96,13 @@ } /** - * Feeds opened websockets with messages. + * Feeds opened websockets with commands. */ private void send(Long lessonId) throws IOException { Long lastSendTime = lastSendTimes.get(lessonId); + if (lastSendTime == null) { + lastSendTime = System.currentTimeMillis() - CHECK_INTERVAL; + } lastSendTimes.put(lessonId, System.currentTimeMillis()); List commands = CommandWebsocketServer.getLearnerService().getCommandsForLesson(lessonId, Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_learning/src/java/org/lamsfoundation/lams/learning/command/dao/ICommandDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_learning/src/java/org/lamsfoundation/lams/learning/command/dao/hibernate/CommandDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_learning/src/java/org/lamsfoundation/lams/learning/command/model/Command.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/ILearnerService.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/service/ILearnerService.java,v diff -u -r1.34.2.3 -r1.34.2.4 --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/ILearnerService.java 10 Aug 2016 18:36:37 -0000 1.34.2.3 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/ILearnerService.java 11 Aug 2016 13:19:28 -0000 1.34.2.4 @@ -26,7 +26,7 @@ import java.util.Date; import java.util.List; -import org.lamsfoundation.lams.learning.command.Command; +import org.lamsfoundation.lams.learning.command.model.Command; import org.lamsfoundation.lams.learning.web.bean.ActivityPositionDTO; import org.lamsfoundation.lams.tool.ToolOutput; Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java,v diff -u -r1.112.2.12 -r1.112.2.13 --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java 10 Aug 2016 18:36:37 -0000 1.112.2.12 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java 11 Aug 2016 13:19:28 -0000 1.112.2.13 @@ -37,7 +37,8 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.gradebook.service.IGradebookService; -import org.lamsfoundation.lams.learning.command.Command; +import org.lamsfoundation.lams.learning.command.dao.ICommandDAO; +import org.lamsfoundation.lams.learning.command.model.Command; import org.lamsfoundation.lams.learning.progress.ProgressBuilder; import org.lamsfoundation.lams.learning.progress.ProgressEngine; import org.lamsfoundation.lams.learning.progress.ProgressException; @@ -104,6 +105,7 @@ private IGroupUserDAO groupUserDAO; private ProgressEngine progressEngine; private IDataFlowDAO dataFlowDAO; + private ICommandDAO commandDAO; private ILamsCoreToolService lamsCoreToolService; private ActivityMapping activityMapping; private IUserManagementService userManagementService; @@ -1308,6 +1310,14 @@ this.dataFlowDAO = dataFlowDAO; } + public ICommandDAO getCommandDAO() { + return commandDAO; + } + + public void setCommandDAO(ICommandDAO commandDAO) { + this.commandDAO = commandDAO; + } + /** * Gets the concreted tool output (not the definition) from a tool. This method is called by target tool in order to * get data from source tool. @@ -1400,14 +1410,12 @@ @Override public void createCommandForLearner(Long lessonId, String userName, String jsonCommand) { Command command = new Command(lessonId, userName, jsonCommand); - activityDAO.insert(command); + commandDAO.insert(command); } @Override - @SuppressWarnings("unchecked") public List getCommandsForLesson(Long lessonId, Date laterThan) { - String query = "FROM Command WHERE lessonId=? AND createDate >= ?"; - return activityDAO.find(query, new Object[] { lessonId, laterThan }); + return commandDAO.getNewCommands(lessonId, laterThan); } @Override Index: lams_learning/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.11 -r1.1.2.12 --- lams_learning/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:03:22 -0000 1.1.2.11 +++ lams_learning/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:28 -0000 1.1.2.12 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/conf/language/lams/ApplicationResources.properties,v diff -u -r1.66.2.14 -r1.66.2.15 --- lams_monitoring/conf/language/lams/ApplicationResources.properties 7 Jul 2016 06:35:19 -0000 1.66.2.14 +++ lams_monitoring/conf/language/lams/ApplicationResources.properties 11 Aug 2016 13:19:13 -0000 1.66.2.15 @@ -270,6 +270,7 @@ force.complete.activity.confirm =Are you sure you want to move learner "[0]" to activity "[1]"? force.complete.drop.fail =You have dropped the learner "[0]" on either its current or on its completed activity "[1]". force.complete.end.lesson.tooltip =To move a learner to the end of lesson, drag the learner icon over to this bar. +force.complete.learner.command.message =Teacher moved you to another activity. learner.group.list.title =Learners: learner.group.count =learners in total. learner.group.show =Double-click to see the full list. 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.118.2.45 -r1.118.2.46 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 10 Aug 2016 18:34:06 -0000 1.118.2.45 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 11 Aug 2016 13:19:14 -0000 1.118.2.46 @@ -134,6 +134,8 @@ private static ILearnerService learnerService; + private static MessageService messageService; + private Integer getUserId() { HttpSession ss = SessionManager.getSession(); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); @@ -636,7 +638,7 @@ MonitoringAction.auditService.log(MonitoringConstants.MONITORING_MODULE_NAME, auditMessage + " " + message); JSONObject jsonCommand = new JSONObject(); - jsonCommand.put("message", "Teacher moved you to another activity."); + jsonCommand.put("message", getMessageService().getMessage("force.complete.learner.command.message")); jsonCommand.put("redirectURL", "/lams/learning/learner.do?method=joinLesson&lessonID=" + lessonId); User learner = (User) getUserManagementService().findById(User.class, learnerId); getLearnerService().createCommandForLearner(lessonId, learner.getLogin(), jsonCommand.toString()); @@ -1404,6 +1406,15 @@ return MonitoringAction.learnerService; } + private MessageService getMessageService() { + if (MonitoringAction.messageService == null) { + WebApplicationContext ctx = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + MonitoringAction.messageService = (MessageService) ctx.getBean("monitoringMessageService"); + } + return MonitoringAction.messageService; + } + /** * Set whether or not the presence available button is available in learner. Expects parameters lessonID and * presenceAvailable. Index: lams_monitoring/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.10 -r1.1.2.11 --- lams_monitoring/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:03:35 -0000 1.1.2.10 +++ lams_monitoring/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:14 -0000 1.1.2.11 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_assessment/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_assessment/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_assessment/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:06:00 -0000 1.1.2.12 +++ lams_tool_assessment/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:31 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_bbb/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_bbb/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_bbb/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:05:57 -0000 1.1.2.13 +++ lams_tool_bbb/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:58 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_chat/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_chat/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_chat/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:05:59 -0000 1.1.2.13 +++ lams_tool_chat/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:03 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_daco/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_daco/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_daco/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:05:58 -0000 1.1.2.12 +++ lams_tool_daco/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:59 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_forum/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.14 -r1.1.2.15 --- lams_tool_forum/web/WEB-INF/tags/Page.tag 10 Aug 2016 18:33:12 -0000 1.1.2.14 +++ lams_tool_forum/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:17 -0000 1.1.2.15 @@ -93,7 +93,8 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar commandWebsocket = null, bars = { @@ -199,8 +200,9 @@ }); } + // it is not an obvious place to init the websocket, but we need lesson ID commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); - //when the server pushes new commands + // when the server pushes new commands commandWebsocket.onmessage = function(e){ // read JSON object var command = JSON.parse(e.data); Index: lams_tool_gmap/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_gmap/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_gmap/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:12 -0000 1.1.2.13 +++ lams_tool_gmap/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:18:56 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_images/web/WEB-INF/tags/CommentsAuthor.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_images/web/WEB-INF/tags/Attic/CommentsAuthor.tag,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_tool_images/web/WEB-INF/tags/CommentsAuthor.tag 12 May 2016 09:54:34 -0000 1.1.2.1 +++ lams_tool_images/web/WEB-INF/tags/CommentsAuthor.tag 11 Aug 2016 13:19:15 -0000 1.1.2.2 @@ -1,13 +1,16 @@ <%@ taglib uri="tags-core" prefix="c"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="allowCommentsVariableName" required="false" rtexprvalue="true"%> <%@ attribute name="allowCommentLabelKey" required="false" rtexprvalue="true"%> <%@ attribute name="likeDislikeVariableName" required="false" rtexprvalue="true"%> <%@ attribute name="likeOnlyCommentLabelKey" required="false" rtexprvalue="true"%> <%@ attribute name="likeDislikeLabelKey" required="false" rtexprvalue="true"%> +<%@ attribute name="commentPanelHeaderKey" required="false" rtexprvalue="true"%> + @@ -23,7 +26,11 @@ + + + +
+
Index: lams_tool_imscc/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_imscc/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_imscc/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:16 -0000 1.1.2.12 +++ lams_tool_imscc/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:30 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_kaltura/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_kaltura/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:13 -0000 1.1.2.12 +++ lams_tool_kaltura/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:36 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_lamc/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_lamc/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:18 -0000 1.1.2.13 +++ lams_tool_lamc/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:47 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_laqa/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.14 -r1.1.2.15 --- lams_tool_laqa/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:09 -0000 1.1.2.14 +++ lams_tool_laqa/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:09 -0000 1.1.2.15 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_larsrc/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_larsrc/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:10 -0000 1.1.2.12 +++ lams_tool_larsrc/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:55 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_leader/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_leader/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:21 -0000 1.1.2.12 +++ lams_tool_leader/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:18:59 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_mindmap/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_mindmap/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:23 -0000 1.1.2.12 +++ lams_tool_mindmap/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:50 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_nb/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_nb/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:15 -0000 1.1.2.13 +++ lams_tool_nb/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:32 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_notebook/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.15 -r1.1.2.16 --- lams_tool_notebook/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:20 -0000 1.1.2.15 +++ lams_tool_notebook/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:00 -0000 1.1.2.16 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_pixlr/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_pixlr/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_pixlr/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:25 -0000 1.1.2.12 +++ lams_tool_pixlr/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:18:55 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_preview/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_preview/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_preview/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:26 -0000 1.1.2.12 +++ lams_tool_preview/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:35 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_sbmt/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_sbmt/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:08 -0000 1.1.2.13 +++ lams_tool_sbmt/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:21 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_scratchie/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_scratchie/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:11 -0000 1.1.2.12 +++ lams_tool_scratchie/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:40 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_scribe/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_scribe/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:14 -0000 1.1.2.13 +++ lams_tool_scribe/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:18:54 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_spreadsheet/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_spreadsheet/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:24 -0000 1.1.2.13 +++ lams_tool_spreadsheet/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:37 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_survey/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_survey/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:17 -0000 1.1.2.13 +++ lams_tool_survey/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:04 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_task/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_task/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.13 -r1.1.2.14 --- lams_tool_task/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:09:19 -0000 1.1.2.13 +++ lams_tool_task/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:53 -0000 1.1.2.14 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_vote/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_vote/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:11:07 -0000 1.1.2.12 +++ lams_tool_vote/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:18:57 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_tool_wiki/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wiki/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.12 -r1.1.2.13 --- lams_tool_wiki/web/WEB-INF/tags/Page.tag 10 Aug 2016 11:11:06 -0000 1.1.2.12 +++ lams_tool_wiki/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:41 -0000 1.1.2.13 @@ -93,7 +93,10 @@ LAMS_URL = '', APP_URL = LAMS_URL + 'learning/', - + + // it gets initialised along with progress bar + commandWebsocket = null, + bars = { 'learnerMainBar' : { 'containerId' : 'progressBarDiv' @@ -196,9 +199,25 @@ } }); } + + // it is not an obvious place to init the websocket, but we need lesson ID + commandWebsocket = new WebSocket(APP_URL.replace('http', 'ws') + 'commandWebsocket?lessonID=' + lessonId); + // when the server pushes new commands + commandWebsocket.onmessage = function(e){ + // read JSON object + var command = JSON.parse(e.data); + if (command.message) { + alert(command.message); + } + if (command.redirectURL) { + window.location.href = command.redirectURL; + } + }; } }); } + + }); Index: lams_www/web/WEB-INF/tags/Page.tag =================================================================== RCS file: /usr/local/cvsroot/lams_www/web/WEB-INF/tags/Attic/Page.tag,v diff -u -r1.1.2.1 -r1.1.2.2 --- lams_www/web/WEB-INF/tags/Page.tag 29 Jun 2016 02:10:34 -0000 1.1.2.1 +++ lams_www/web/WEB-INF/tags/Page.tag 11 Aug 2016 13:19:34 -0000 1.1.2.2 @@ -1,49 +1,343 @@ <%@ 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="usePanel" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + + 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 main window, not in popup windows --%> + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + - - - - - -
- -
-
- - - ${titleHelpURL} - -
- - + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + ${toolForm.toolSessionID} + + + + + + + + + <%-- end of sidebar stuff - only used if in learner screen --%> + + +
+ + + - + \ No newline at end of file