Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r13f3e7acf738bee2a21ace1c0694894bd1f48cdc -r9fff53f0354f026459ee60ee5e00ddd49fa71283
--- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 13f3e7acf738bee2a21ace1c0694894bd1f48cdc)
+++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9fff53f0354f026459ee60ee5e00ddd49fa71283)
@@ -323,9 +323,13 @@
label.learning.summary.other.team.answers = Other teams' answers
label.learning.summary.selected.by = Selected by:
label.disclose.correct.answers = Disclose correct answers
+message.disclose.correct.answers = Please confirm that you want to disclose the correct answer for this question. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this?
label.disclose.groups.answers = Disclose groups' answers
+message.disclose.groups.answers = Please confirm that you want to disclose the groups' answers for this question. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this?
label.disclose.all.correct.answers = Disclose all correct answers
+message.disclose.all.correct.answers = Please confirm that you want to disclose ALL the answers for all questions. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this?
label.disclose.all.groups.answers = Disclose all groups' answers
+message.disclose.all.groups.answers = Please confirm that you want to disclose the answers of ALL groups for ALL the questions. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this?
label.prefix.sequential.letters.for.each.answer = Prefix sequential letters for each answer
label.edit.in.monitor.warning = Attention: while you edit this assessment students don't have access to it. You must save your changes so students can re-attempt this assessment again.
outcome.authoring.title = Learning outcomes
Index: lams_tool_assessment/web/pages/monitoring/summary.jsp
===================================================================
diff -u -r897ad3c3694440281f178d7834a9233d62c4e874 -r9fff53f0354f026459ee60ee5e00ddd49fa71283
--- lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 897ad3c3694440281f178d7834a9233d62c4e874)
+++ lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 9fff53f0354f026459ee60ee5e00ddd49fa71283)
@@ -212,6 +212,10 @@
// ajax calls to disclose correct/groups answers
correctButton.click(function(){
+ if (!confirm("")) {
+ return;
+ };
+
$.ajax({
type: 'POST',
'url' : 'monitoring/discloseCorrectAnswers.do?',
@@ -226,6 +230,10 @@
});
groupsButton.click(function(){
+ if (!confirm("")) {
+ return;
+ };
+
$.ajax({
type: 'POST',
'url' : 'monitoring/discloseGroupsAnswers.do?',
@@ -240,6 +248,10 @@
});
correctAllButton.click(function(){
+ if (!confirm("")) {
+ return;
+ };
+
$('option[correctDisclosed="false"]', questionUidSelect).each(function(){
var option = $(this),
questionUid = option.val();
@@ -261,6 +273,10 @@
});
groupsAllButton.click(function(){
+ if (!confirm("")) {
+ return;
+ };
+
$('option[groupsDisclosed="false"]', questionUidSelect).each(function(){
var option = $(this),
questionUid = option.val();
Index: lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp
===================================================================
diff -u -r7ce053b800d419b47ac66cd074e02fdc64c6887d -r9fff53f0354f026459ee60ee5e00ddd49fa71283
--- lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp (.../assessment.jsp) (revision 7ce053b800d419b47ac66cd074e02fdc64c6887d)
+++ lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp (.../assessment.jsp) (revision 9fff53f0354f026459ee60ee5e00ddd49fa71283)
@@ -44,30 +44,29 @@
discloseAllGroupsEnabled = true;
}
- button.one('click', function() {
- $.ajax({
- 'url' : 'monitoring/'
- + (isCorrectButton ? 'discloseCorrectAnswers' : 'discloseGroupsAnswers')
- + '.do',
- 'type': 'POST',
- 'data' : {
- 'questionUid' : button.closest('.disclose-button-group').attr('questionUid'),
- 'toolContentID' : $('#selected-content-id').val(),
- '' : ''
- }
- }).done(function(){
- // disable the button after click
- disabledAndCheckButton(button);
- });
+
+
+ button.click(function(event) {
+ if (!confirm(isCorrectButton ? ""
+ : "")) {
+ return;
+ }
+
+ discloseAnswers(button);
});
});
// if disclose all correct/groups answers buttons are clickable, add a click handler
// and disable if not
var allCorrectButton = $('.disclose-all-correct-button', assessmentPane);
if (discloseAllCorrectEnabled) {
- allCorrectButton.one('click', function(){
- $('.disclose-correct-button', assessmentPane).not('[disabled]').click();
+ allCorrectButton.click(function(){
+ if (!confirm("")) {
+ return;
+ }
+ $('.disclose-correct-button', assessmentPane).not('[disabled]').each(function() {
+ discloseAnswers($(this));
+ });
disabledAndCheckButton(allCorrectButton);
});
} else {
@@ -76,15 +75,39 @@
var allGroupsButton = $('.disclose-all-groups-button', assessmentPane);
if (discloseAllGroupsEnabled) {
- allGroupsButton.one('click', function(){
- $('.disclose-groups-button', assessmentPane).not('[disabled]').click();
+ allGroupsButton.click(function(){
+ if (!confirm("")) {
+ return;
+ }
+ $('.disclose-groups-button', assessmentPane).not('[disabled]').each(function() {
+ discloseAnswers($(this));
+ });
disabledAndCheckButton(allGroupsButton);
});
} else {
disabledAndCheckButton(allGroupsButton);
}
});
});
+
+ function discloseAnswers(button) {
+ let isCorrectButton = button.hasClass('disclose-correct-button');
+
+ $.ajax({
+ 'url' : 'monitoring/'
+ + (isCorrectButton ? 'discloseCorrectAnswers' : 'discloseGroupsAnswers')
+ + '.do',
+ 'type': 'POST',
+ 'data' : {
+ 'questionUid' : button.closest('.disclose-button-group').attr('questionUid'),
+ 'toolContentID' : $('#selected-content-id').val(),
+ '' : ''
+ }
+ }).done(function(){
+ // disable the button after click
+ disabledAndCheckButton(button);
+ });
+ }
function disabledAndCheckButton(button){
button.attr('disabled', true).html(' ' + button.text());