Index: lams_tool_assessment/web/pages/learning/results.jsp
===================================================================
diff -u -r0e9494974eaff0acd6ae466566653dd2a2e7e8ba -r58f8a894e785390508199bfb43acefd77ee63d0a
--- lams_tool_assessment/web/pages/learning/results.jsp (.../results.jsp) (revision 0e9494974eaff0acd6ae466566653dd2a2e7e8ba)
+++ lams_tool_assessment/web/pages/learning/results.jsp (.../results.jsp) (revision 58f8a894e785390508199bfb43acefd77ee63d0a)
@@ -66,10 +66,7 @@
$(document).ready(function() {
$('#finishButton').bootstrapTooltip({
- 'trigger' : 'manual',
- 'title' : function(){
- return $(this).data('gateClosedTooltip');
- }
+ 'trigger' : 'manual'
});
});
@@ -83,18 +80,32 @@
$.ajax({
'url' : 'learning/learner/isNextGateActivityOpen.do?userId=${sessionMap.user.userId}&toolSessionId=${toolSessionID}',
'cache' : false,
- 'dataType' : 'text',
+ 'dataType' : 'json',
'success' : function(response) {
- if (response == 'true') {
+ if (response.status == 'open') {
document.location.href ='?sessionMapID=${sessionMapID}&mode=${mode}&toolSessionID=${toolSessionID}';
return;
}
+
+ if (response.status == 'closed') {
+ let timeoutFunction = null;
+ if (response.message) {
+ let finishButton = $('#finishButton').attr({
+ 'title' : response.message,
+ 'data-original-title' : response.message
+ }).bootstrapTooltip('show');
+ timeoutFunction = function(){
+ finishButton.bootstrapTooltip('hide');
+ $('.btn').prop('disabled', false);
+ };
+ } else {
+ timeoutFunction = function(){
+ $('.btn').prop('disabled', false);
+ };
+ }
- let finishButton = $('#finishButton').bootstrapTooltip('show');
- setTimeout(function(){
- finishButton.bootstrapTooltip('hide');
- $('.btn').prop('disabled', false);
- }, 5000);
+ setTimeout(timeoutFunction, 5000);
+ }
}
});
@@ -221,8 +232,7 @@
">
+ class="btn btn-primary voffset10 pull-right na">