Index: lams_tool_scribe/web/pages/learning/learning.jsp
===================================================================
diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r2d2c869032858b474398c651f8c45371410ba0d2
--- lams_tool_scribe/web/pages/learning/learning.jsp (.../learning.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80)
+++ lams_tool_scribe/web/pages/learning/learning.jsp (.../learning.jsp) (revision 2d2c869032858b474398c651f8c45371410ba0d2)
@@ -1,150 +1,182 @@
+
+
+
<%@ include file="/common/taglibs.jsp"%>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
- scribeWebsocketPingFunc = function(skipPing){
- if (scribeWebsocket.readyState == scribeWebsocket.CLOSING
- || scribeWebsocket.readyState == scribeWebsocket.CLOSED){
- if (Date.now() - scribeWebsocketInitTime < 1000) {
- return;
+
+
+
+
+
+
- // check and ping every 3 minutes
- scribeWebsocketPingTimeout = setTimeout(scribeWebsocketPingFunc, 3*60*1000);
- // initial set up does not send ping
- if (!skipPing) {
- scribeWebsocket.send("ping");
- }
- };
-
- // set up timer for the first time
- scribeWebsocketPingFunc(true);
-
- // run when the server pushes new reports and vote statistics
- scribeWebsocket.onmessage = function(e) {
- // create JSON object
- var input = JSON.parse(e.data),
- agreeButton = $('#agreeButton').parent();
+
- // if the scribe or monitor force completes the activity, reload to display report page
- if (input.close) {
- window.location.href = '${tool}learning.do?toolSessionID=${scribeSessionDTO.sessionID}&mode=${MODE}';
- return;
- }
-
- // reset ping timer
- clearTimeout(scribeWebsocketPingTimeout);
- scribeWebsocketPingFunc(true);
+
+
+
- // only changed reports will be sent
- if (input.reports) {
- reportSubmitted = true;
- $.each(input.reports, function() {
- $('#reportText-' + this.uid).html(this.text);
- });
- }
+ <%@include file="/pages/parts/voteDisplay.jsp"%>
- // can the user vote
- if (!reportSubmitted || input.approved) {
- agreeButton.hide();
- } else {
- agreeButton.show();
- }
+
+ ">
+
+
+ : ${appointedScribe}
- // update vote statistics
- var label = agreementPercentageLabel.replace('{0}', input.numberOfVotes)
- .replace('{1}', input.numberOfLearners);
- $('#agreementPercentageLabel').text(label);
- $('#agreementPercentage').text('(' + input.votePercentage + '%)');
- $('#agreementPercentageBar').attr('aria-valuenow', input.votePercentage)
- .css('width',input.votePercentage + '%');
- };
-
- function submitApproval() {
- var agreeButton = $('#agreeButton').parent(),
- data = {
- type : 'vote'
- };
- scribeWebsocket.send(JSON.stringify(data));
+
- agreeButton.hide();
- }
-
-
-
-
-
-
-
-
- <%@include file="/pages/parts/voteDisplay.jsp"%>
-
-
- ">
-
-
- : ${appointedScribe}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
\ No newline at end of file