Commit d02880dd by Albert St. Aubin

Add SR Live text to save status on responses

TNL-6242
parent 4dfa423b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -69,6 +69,13 @@ OpenAssessment.BaseView.prototype = {
},
/**
* Clear the text in the Aria live region.
*/
srClear: function() {
$('.sr.reader-feedback').html('');
},
/**
* Add the text messages to the Aria live region.
*
* @param {string[]} texts
......@@ -77,7 +84,7 @@ OpenAssessment.BaseView.prototype = {
var readerFeedbackID = '.sr.reader-feedback',
$readerFeedbackSelector = $(readerFeedbackID),
htmlFeedback = '';
this.srClear();
$.each(texts, function(ids, value) {
htmlFeedback = htmlFeedback + '<p>' + value + '</p>\n';
});
......
......@@ -351,7 +351,9 @@ OpenAssessment.ResponseView.prototype = {
});
if (currentResponseEqualsSaved) {
view.saveEnabled(false);
view.saveStatus(gettext("This response has been saved but not submitted."));
var msg = gettext("This response has been saved but not submitted.");
view.saveStatus(msg);
view.baseView.srReadTexts([msg]);
}
}).fail(function(errMsg) {
view.saveStatus(gettext('Error'));
......
......@@ -108,11 +108,11 @@ OpenAssessment.StudentTrainingView.prototype = {
} else {
instructions.addClass("is--hidden");
incorrect.removeClass("is--hidden");
$questionAnswers.each(function (index, answer) {
$questionAnswers.each(function(index, answer) {
var $notification = $(".step__message.message", view.rubric.element).not(".is--hidden");
$(answer).attr('aria-describedby', $($notification[index]).attr('id'));
});
baseView.srReadTexts([gettext('Feedback available for selection.')])
baseView.srReadTexts([gettext('Feedback available for selection.')]);
}
baseView.scrollToTop(".step--student-training");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment