assignment index shows when assignemnt is excused

this patchset also shows users of srgb that an
assignment is excused.

fixes CNVS-21665

test plan
  - log in as student
  - view the assignments index page
  - verify that an excused assignment is labeled
    as 'Excused'
  - verify accessibility

  - log in as teacher
  - switch to Screenreader Gradebook
  - select a student from the dropdown
  - select an assignment
  - verify 'Excused' shows up next to the
    grade selector if the assignment has
    been excused

Change-Id: I3e01835a6d310b5fda605dd768c1719908a4879f
Reviewed-on: https://gerrit.instructure.com/58396
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Dylan Ross <dross@instructure.com>
This commit is contained in:
Dylan Ross 2015-07-14 09:33:09 -06:00
parent b973a898ea
commit da20209c3c
4 changed files with 76 additions and 59 deletions

View File

@ -38,7 +38,9 @@ define [
]
outOfText: (->
if @get('isGpaScale')
if @submission && @submission.excused
I18n.t "Excused"
else if @get('isGpaScale')
""
else if @get('isLetterGrade') or @get('isPassFail')
I18n.t "out_of_with_score", "(%{score} out of %{points})",

View File

@ -233,7 +233,6 @@ define [
json.submission.gradingType = json.gradingType if json.submission?
if json.gradingType is 'not_graded'
json.hideGrade = true
json

View File

@ -1,45 +1,49 @@
<span class="non-screenreader" aria-hidden=true>
{{#unless hideGrade}}
{{#ifAll submission submission.submitted_or_graded}}
{{#ifAll submission submission.excused}}
{{#t}}Excused{{/t}}
{{else}}
{{#ifAll submission submission.submitted_or_graded}}
{{#with submission}}
{{#if notYetGraded}}
{{#with submission}}
{{#if notYetGraded}}
<span class="score-display text-right ellipsis">
<span class="score-display text-right ellipsis">
{{#t "empty_points_possible"}}
-/{{pointsPossible}} pts
{{/t}}
</span>
<span class="grade-display text-left ellipsis">
{{#t "not_yet_graded"}}
<em>Not Yet Graded</em>
{{/t}}
</span>
{{else}}
<span class="score-display text-right ellipsis">
{{#t "score_with_points_possible"}}
<b>{{score}}</b>/{{pointsPossible}} pts
{{/t}}
</span>
<span class="grade-display text-left ellipsis">
<strong>
{{gradeDisplay}}
</strong>
</span>
{{/if}}
{{/with}}
{{else}}
<span data-tooltip="" class="score-display ellipsis text-right" title='{{#t "no_submission"}}No Submission{{/t}}'>
{{#t "empty_points_possible"}}
-/{{pointsPossible}} pts
{{/t}}
</span>
<span class="grade-display text-left ellipsis">
{{#t "not_yet_graded"}}
<em>Not Yet Graded</em>
{{/t}}
</span>
{{else}}
<span class="score-display text-right ellipsis">
{{#t "score_with_points_possible"}}
<b>{{score}}</b>/{{pointsPossible}} pts
{{/t}}
</span>
<span class="grade-display text-left ellipsis">
<strong>
{{gradeDisplay}}
</strong>
</span>
{{/if}}
{{/with}}
{{else}}
<span data-tooltip="" class="score-display ellipsis text-right" title='{{#t "no_submission"}}No Submission{{/t}}'>
{{#t "empty_points_possible"}}
-/{{pointsPossible}} pts
{{/t}}
</span>
</span>
{{/ifAll}}
{{/ifAll}}
{{/unless}}
</span>
@ -50,31 +54,36 @@
This assignment will not be assigned a grade.
{{/t}}
{{else}}
{{#ifAll submission submission.submitted_or_graded}}
{{#with submission}}
{{#if notYetGraded}}
{{#t "assignment_not_yet_graded_screenreader"}}
Assignment not yet graded. {{pointsPossible}} points possible.
{{/t}}
{{else}}
{{#t "score_with_points_possible_screenreader"}}
Score: {{score}} out of {{pointsPossible}} points.
{{/t}}
{{gradeDisplayForScreenreader}}
{{/if}}
{{/with}}
{{#ifAll submission submission.excused}}
{{#t}}This assignment has been excused.{{/t}}
{{else}}
{{#ifAll submission submission.submitted_or_graded}}
{{#t "no_submission_for_assignment_screenreader"}}
No submission for this assignment. {{pointsPossible}} points possible.
{{/t}}
{{#with submission}}
{{#if notYetGraded}}
{{#t "assignment_not_yet_graded_screenreader"}}
Assignment not yet graded. {{pointsPossible}} points possible.
{{/t}}
{{else}}
{{#t "score_with_points_possible_screenreader"}}
Score: {{score}} out of {{pointsPossible}} points.
{{/t}}
{{gradeDisplayForScreenreader}}
{{/if}}
{{/with}}
{{else}}
{{#t "no_submission_for_assignment_screenreader"}}
No submission for this assignment. {{pointsPossible}} points possible.
{{/t}}
{{/ifAll}}
{{/ifAll}}
{{/if}}

View File

@ -406,6 +406,13 @@ define [
ok nonScreenreaderText().match('1.56/5 pts')[0], 'sets non-screenreader screen text'
ok nonScreenreaderText().match('90%')[0], 'sets non-screenreader grade text'
test "excused score and grade outputs", ->
@submission.set 'excused': true
@model.set 'submission', @submission
@model.trigger 'change:submission'
ok screenreaderText().match('This assignment has been excused.')
ok nonScreenreaderText().match('Excused')
module 'AssignmentListItemViewSpec—alternate grading type: pass_fail',
setup: ->