Commit 4dfa423b by Albert (AJ) St. Aubin Committed by GitHub

Merge pull request #962 from edx/aj/TNL-6243_announce_feedback

Added the SR feedback announcement and the describedby region for stu…
parents ea256307 70a563d8
......@@ -89,22 +89,21 @@
</button>
</div>
<div class="ui-slidable__content" aria-labelledby="oa_training_{{ xblock_id }}_criterion--{{ criterion.order_num }}" id="oa_training_{{ xblock_id }}_content_criterion--{{ criterion.order_num }}">
<div class="step__message message message--correct is--hidden">
<div id="training__assessment__rubric__correct__message--{{ criterion.order_num }}__{{ xblock_id }}" class="step__message message message--correct is--hidden">
<h5 class="message__title">{% trans "Selected Options Agree" %}</h5>
<div class="message__content">
<p>{% trans "The option you selected is the option that the instructor selected." %}</p>
</div>
</div>
<div class="step__message message message--incorrect is--hidden">
<div id="training__assessment__rubric__incorrect__message--{{ criterion.order_num }}__{{ xblock_id }}" class="step__message message message--incorrect is--hidden">
<h5 class="message__title">{% trans "Selected Options Differ" %}</h5>
<div class="message__content">
<p>{% trans "The option you selected is not the option that the instructor selected." %}</p>
</div>
</div>
<div class="question__answers">
<div role="group" aria-labelledby="training__assessment__rubric__prompt--{{ criterion.order_num }}__{{ xblock_id }}">
<div class="question__answers" role="group" aria-labelledby="training__assessment__rubric__prompt--{{ criterion.order_num }}__{{ xblock_id }}">
{% for option in criterion.options %}
<div class="answer">
<div class="wrapper--input">
......@@ -127,7 +126,6 @@
{% endfor %}
</div>
</div>
</div>
</li>
{% endif %}
{% endfor %}
......
......@@ -98,6 +98,7 @@ OpenAssessment.StudentTrainingView.prototype = {
function(corrections) {
var incorrect = $(".openassessment__student-training--incorrect", view.element);
var instructions = $(".openassessment__student-training--instructions", view.element);
var $questionAnswers = $(".question__answers", view.rubric.element);
if (!view.rubric.showCorrections(corrections)) {
view.load(usageID);
......@@ -107,6 +108,11 @@ OpenAssessment.StudentTrainingView.prototype = {
} else {
instructions.addClass("is--hidden");
incorrect.removeClass("is--hidden");
$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.scrollToTop(".step--student-training");
}
......
......@@ -41,6 +41,12 @@ class BaseAssessmentPage(PageObject):
def get_sr_html(self):
return self.q(css='.sr.reader-feedback').html
def confirm_feedback_text(self, text):
def is_text_in_feedback():
return text in self.get_sr_html()[0]
self.wait_for(is_text_in_feedback, 'Waiting for %s, in %s' % (text, self.q(css='.sr.reader-feedback').html[0]))
class MultipleAssessmentPage(BaseAssessmentPage):
"""
......
......@@ -790,25 +790,22 @@ class FullWorkflowMixin(object):
(str, str): the username and password of the newly created user
"""
username, email = self.do_submission()
actual = self.submission_page.get_sr_html()
EmptyPromise(self.submission_page.button(".step--student-training").is_focused(),
"Student training button should be focused")
self.assertIn('Your Response Complete', actual[0])
self.assertIn('Learn to Assess Responses In Progress (1 of 2)', actual[0])
self.submission_page.confirm_feedback_text('Your Response Complete')
self.submission_page.confirm_feedback_text('Learn to Assess Responses In Progress (1 of 2)')
self.do_training()
actual = self.submission_page.get_sr_html()
EmptyPromise(self.submission_page.button(".step--self-assessment").is_focused(),
"Self assessment button should be focused")
self.assertIn('Learn to Assess Responses Complete', actual[0])
self.assertIn('Assess Your Response In Progress', actual[0])
self.submission_page.confirm_feedback_text('Learn to Assess Responses Complete')
self.submission_page.confirm_feedback_text('Assess Your Response In Progress')
self.submit_self_assessment(self.SELF_ASSESSMENT)
actual = self.submission_page.get_sr_html()
EmptyPromise(self.submission_page.button(".step--grade").is_focused(),
"Grade button should be focused")
self.assertIn('Assess Your Response Complete', actual[0])
self.assertIn('Assess Peers In Progress (1 of 1)', actual[0])
self.submission_page.confirm_feedback_text('Assess Your Response Complete')
self.submission_page.confirm_feedback_text('Assess Peers In Progress (1 of 1)')
return username, email
......
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