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.1 -r1.2 --- lams_tool_scratchie/web/pages/learning/learning.jsp 19 Jul 2012 19:20:09 -0000 1.1 +++ lams_tool_scratchie/web/pages/learning/learning.jsp 9 Aug 2012 21:55:36 -0000 1.2 @@ -30,42 +30,46 @@ //hide finish button if user haven't guessed correct answer nor used all attempts - $("#finishButton").hide(); + //$("#finishButton").hide(); }); - function scratchItem(itemUid){ + function scratchItem(answerUid){ $.ajax({ async: false, url: '', - data: 'sessionMapID=${sessionMapID}&mode=${mode}&toolSessionID=${toolSessionID}&itemUid=' + itemUid, + data: 'sessionMapID=${sessionMapID}&mode=${mode}&toolSessionID=${toolSessionID}&answerUid=' + answerUid, dataType: 'json', type: 'post', success: function (json) { - if (json.itemCorrect) { + if (json.answerCorrect) { //show animation - $('#image' + itemUid).attr("src", "?reqID=" + (new Date()).getTime()); + $('#image' + answerUid).attr("src", "?reqID=" + (new Date()).getTime()); disableScratching(); } else { //show animation, disable onclick, move to the bottom this item - $('#image' + itemUid).attr("src", "?reqID=" + (new Date()).getTime()); - $('#imageLink' + itemUid).removeAttr('onclick'); + $('#image' + answerUid).attr("src", "?reqID=" + (new Date()).getTime()); + $('#imageLink' + answerUid).removeAttr('onclick'); } } }); } function disableScratching() { - $("[id^=imageLink]").removeAttr('onclick'); - $("img", $("#scratches")).not("img[src*='scratchie-correct-animation.gif']").not("img[src*='scratchie-correct.gif']").fadeTo(1300, 0.3); - $("#finishButton").show(); + //$("[id^=imageLink]").removeAttr('onclick'); + //$("img", $("#scratches")).not("img[src*='scratchie-correct-animation.gif']").not("img[src*='scratchie-correct.gif']").fadeTo(1300, 0.3); + //$("#finishButton").show(); } function finishSession(){ - document.getElementById("finishButton").disabled = true; - document.location.href =''; - return false; + //var finishConfirmed = confirm(""); + + //if (finishConfirmed) { + document.getElementById("finishButton").disabled = true; + document.location.href =''; + return false; + //} } function continueReflect(){ document.location.href=''; @@ -86,34 +90,40 @@ <%@ include file="/common/messages.jsp"%> + + ${item.title} + ${item.description} + - - + + - + - + - - + + - ${item.description} + ${answer.description} + +