Index: lams_tool_scratchie/web/pages/learning/learning.jsp
===================================================================
diff -u -rbbe6b21a663059e2539bc0ea5ce761445b5ae1c1 -rbefcbcc85e9673de8236395435f2232a4e962f96
--- lams_tool_scratchie/web/pages/learning/learning.jsp (.../learning.jsp) (revision bbe6b21a663059e2539bc0ea5ce761445b5ae1c1)
+++ lams_tool_scratchie/web/pages/learning/learning.jsp (.../learning.jsp) (revision befcbcc85e9673de8236395435f2232a4e962f96)
@@ -93,8 +93,6 @@
scratchMcq(itemUid, optionUid);
});
-
-
// hide Finish button for non-leaders until leader finishes
if (${hideFinishButton}) {
@@ -135,6 +133,8 @@
setTimeout(
function(){
image.attr("src", "includes/images/scratchie-" + imageSuffix + ".png");
+ image.attr("alt", isCorrect ? '' :
+ '');
},
1300
);
@@ -160,18 +160,20 @@
}
scratchImage(itemUid, optionUid, json.optionCorrect);
-
+
+ //disable scratching
+ var imageLinkIds = json.optionCorrect ? "[id^=imageLink-" + itemUid + "]" : '#imageLink' + '-' + itemUid + '-' + optionUid;
+ var imageLinks = $(imageLinkIds);
+ imageLinks.removeAttr('onClick').removeAttr('onDblClick');
+ imageLinks.css('cursor', 'default');
+ imageLinks.attr('aria-disabled', 'true');
+
if (json.optionCorrect) {
- //disable scratching
- $("[id^=imageLink-" + itemUid + "]").removeAttr('onClick').removeAttr('onDblClick');
- $("[id^=imageLink-" + itemUid + "]").css('cursor','default');
+ //fade all realted images
$("[id^=image-" + itemUid + "]").not("img[src*='scratchie-correct-animation.gif']").not("img[src*='scratchie-correct.gif']").fadeTo(1300, 0.3);
+ //enable Finish button
checkAllCorrectMcqAnswersFound();
- } else {
- var id = '-' + itemUid + '-' + optionUid;
- $('#imageLink' + id).removeAttr('onclick');
- $('#imageLink' + id).css('cursor','default');
}
},
@@ -286,13 +288,16 @@
function checkAllCorrectMcqAnswersFound() {
var numberOfAvailableScratches = $("[id^=imageLink-][onclick]").length;
if (numberOfAvailableScratches > 0) {
- $('#finishButton').prop('disabled', true).css('pointer-events', 'none')
- .parent().attr('data-title', '')
- .tooltip();
+ $('#finishButton')
+ .prop('disabled', true)
+ .css('pointer-events', 'none')
+ .parent().attr('data-title', '')
+ .tooltip();
} else {
- $('#finishButton').prop('disabled', false)
- .css('pointer-events', 'auto')
- .parent().tooltip('dispose');
+ $('#finishButton')
+ .prop('disabled', false)
+ .css('pointer-events', 'auto')
+ .parent().tooltip('dispose');
}
}
@@ -318,11 +323,11 @@
return hash;
}
+ // time limit feature
- // time limit feature
-
function displayCountdown(secondsLeft){
- var countdown = ''
+ var countdown = '' +
+ '';
$.blockUI({
message: countdown,
showOverlay: false,
@@ -351,11 +356,32 @@
} else {
$(this).removeClass('countdown-timeout');
}
+
+ //handle screenreaders
+ var screenCountdown = $("#screenreader-countdown");
+ var hours = $("#countdown").countdown('getTimes')[4];
+ var minutes = $("#countdown").countdown('getTimes')[5];
+ if (screenCountdown.data("hours") != hours || screenCountdown.data("minutes") != minutes) {
+ var timeLeftText = " ";
+ if (hours > 0) {
+ timeLeftText += hours + " ";
+ }
+ timeLeftText += minutes + " ";
+ screenCountdown.html(timeLeftText);
+
+ screenCountdown.data("hours", hours);
+ screenCountdown.data("minutes", minutes);
+ }
},
onExpiry: function(periods) {
- $.blockUI({ message: '
' });
+ $.blockUI({
+ message: '' +
+ ' ' +
+ '' +
+ '
'
+ });
- setTimeout(function() {
+ setTimeout(function() {
if (${isUserLeader}) {
finish(true);
} else {