Index: lams_tool_scratchie/web/pages/learning/learning.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/web/pages/learning/learning.jsp,v diff -u -r1.24 -r1.25 --- lams_tool_scratchie/web/pages/learning/learning.jsp 20 Jul 2016 15:44:38 -0000 1.24 +++ lams_tool_scratchie/web/pages/learning/learning.jsp 12 Dec 2016 16:54:44 -0000 1.25 @@ -21,7 +21,7 @@ <%@ include file="/common/header.jsp"%> - + @@ -66,20 +66,35 @@ } //time limit feature - + $(document).ready(function(){ - //show confirmation dialog - $.blockUI({ - message: $('#timelimit-start-dialog'), - css: { width: '325px', height: '120px'}, - overlayCSS: { opacity: '.98'} - }); + + //show timelimit-start-dialog in order to start countdown + if (${isTimeLimitNotLaunched}) { + + $.blockUI({ + message: $('#timelimit-start-dialog'), + css: { width: '325px', height: '120px'}, + overlayCSS: { opacity: '.98'} + }); - //once OK button pressed start countdown - $('#timelimit-start-ok').click(function() { - $.unblockUI(); - displayCountdown(); - }); + //once OK button pressed start countdown + $('#timelimit-start-ok').click(function() { + + //store date when user has started activity with time limit + $.ajax({ + async: true, + url: '', + data: 'sessionMapID=${sessionMapID}', + type: 'post' + }); + + $.unblockUI(); + displayCountdown(); + }); + } else { + displayCountdown(); + } }); function displayCountdown(){ @@ -100,7 +115,7 @@ }); $('#countdown').countdown({ - until: '+${scratchie.timeLimit * 60}S', + until: '+${secondsLeft}S', format: 'hMS', compact: true, onTick: function(periods) { @@ -147,6 +162,7 @@ function refreshQuestionList() { var url = "", scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + $("#questionListArea").load( url, {