Commit 1ed3fc69 by Albert (AJ) St. Aubin Committed by GitHub

Merge pull request #961 from edx/aj/TNL-6242_announce_save_state

Aj/tnl 6242 announce save state
parents 4dfa423b df827a42
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -47,6 +47,7 @@ OpenAssessment.BaseView.prototype = { ...@@ -47,6 +47,7 @@ OpenAssessment.BaseView.prototype = {
SLIDABLE_CONTENT_CLASS: "ui-slidable__content", SLIDABLE_CONTENT_CLASS: "ui-slidable__content",
SLIDABLE_CONTROLS_CLASS: "ui-slidable__control", SLIDABLE_CONTROLS_CLASS: "ui-slidable__control",
SLIDABLE_CONTAINER_CLASS: "ui-slidable__container", SLIDABLE_CONTAINER_CLASS: "ui-slidable__container",
READER_FEEDBACK_CLASS: '.sr.reader-feedback',
/** /**
* Checks to see if the scrollTo function is available, then scrolls to the * Checks to see if the scrollTo function is available, then scrolls to the
...@@ -69,15 +70,21 @@ OpenAssessment.BaseView.prototype = { ...@@ -69,15 +70,21 @@ OpenAssessment.BaseView.prototype = {
}, },
/** /**
* Clear the text in the Aria live region.
*/
srClear: function() {
$(this.READER_FEEDBACK_CLASS).html('');
},
/**
* Add the text messages to the Aria live region. * Add the text messages to the Aria live region.
* *
* @param {string[]} texts * @param {string[]} texts
*/ */
srReadTexts: function(texts) { srReadTexts: function(texts) {
var readerFeedbackID = '.sr.reader-feedback', var $readerFeedbackSelector = $(this.READER_FEEDBACK_CLASS),
$readerFeedbackSelector = $(readerFeedbackID),
htmlFeedback = ''; htmlFeedback = '';
this.srClear();
$.each(texts, function(ids, value) { $.each(texts, function(ids, value) {
htmlFeedback = htmlFeedback + '<p>' + value + '</p>\n'; htmlFeedback = htmlFeedback + '<p>' + value + '</p>\n';
}); });
......
...@@ -351,7 +351,9 @@ OpenAssessment.ResponseView.prototype = { ...@@ -351,7 +351,9 @@ OpenAssessment.ResponseView.prototype = {
}); });
if (currentResponseEqualsSaved) { if (currentResponseEqualsSaved) {
view.saveEnabled(false); 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) { }).fail(function(errMsg) {
view.saveStatus(gettext('Error')); view.saveStatus(gettext('Error'));
......
...@@ -108,11 +108,11 @@ OpenAssessment.StudentTrainingView.prototype = { ...@@ -108,11 +108,11 @@ OpenAssessment.StudentTrainingView.prototype = {
} else { } else {
instructions.addClass("is--hidden"); instructions.addClass("is--hidden");
incorrect.removeClass("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"); var $notification = $(".step__message.message", view.rubric.element).not(".is--hidden");
$(answer).attr('aria-describedby', $($notification[index]).attr('id')); $(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"); 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