Skip to content

Commit

Permalink
gradebook: hide comment bubble when locked for close date
Browse files Browse the repository at this point in the history
when a submission cell in the gradebook is locked
due to falling in a closed grading period, the
'comment bubble' is no longer available within the
cell.

closes CNVS-31205

test plan:

1. sign in as a non-admin teacher in a course with
   Multiple Grading Periods enabled and at least 1
   closed grading period.

2. create an assignment due for everyone in the
   closed grading period.

3. go to the gradebook and select the closed grading
   period from the dropdown.

4. verify all the submission cells for the assignment:
     a) are locked,
     b) have a tooltip stating the submission falls
        in a closed grading period, and
     c) do not contain a clickable 'comment bubble'
        in the cell.

Change-Id: I54d1638a6829c92a5a8dc786d62b11a386e466e8
Reviewed-on: https://gerrit.instructure.com/88500
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <[email protected]>
Reviewed-by: Keith T. Garner <[email protected]>
Reviewed-by: Derek Bender <[email protected]>
QA-Review: Alex Morris <[email protected]>
Product-Review: Keith T. Garner <[email protected]>
  • Loading branch information
spencerolson authored and roor0 committed Sep 27, 2016
1 parent 860d19a commit de6862d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/coffeescripts/gradebook2/SubmissionCell.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ define [

tooltipText = $.map(specialClasses, (c)-> GRADEBOOK_TRANSLATIONS["submission_tooltip_#{c}"]).join ', '

cellCommentHTML = if !opts.student.isConcluded
cellCommentHTML = if !opts.student.isConcluded && !opts.isLocked
"""
<a href="#" data-user-id=#{opts.submission.user_id} data-assignment-id=#{opts.assignment.id} class="gradebook-cell-comment"><span class="gradebook-cell-comment-label">submission comments</span></a>
"""
Expand Down
8 changes: 8 additions & 0 deletions spec/coffeescripts/gradebook2/SubmissionCellSpec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ define [
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { isLocked: true })
ok submissionCellResponse.indexOf("cannot_edit") > -1

test "#class.formatter, isLocked: true does not include the cell comment bubble", ->
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { isLocked: true })
equal submissionCellResponse.indexOf("gradebook-cell-comment"), -1

test "#class.formatter, isLocked: false doesn't add grayed-out", ->
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { isLocked: false })
equal submissionCellResponse.indexOf("grayed-out"), -1
Expand All @@ -75,6 +79,10 @@ define [
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { isLocked: false })
equal submissionCellResponse.indexOf("cannot_edit"), -1

test "#class.formatter, isLocked: false includes the cell comment bubble", ->
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { isLocked: false })
ok submissionCellResponse.indexOf("gradebook-cell-comment") > -1

test "#class.formatter, tooltip adds your text to the special classes", ->
submissionCellResponse = SubmissionCell.formatter(0, 0, { grade: 73 }, {}, {}, { tooltip: "dora_the_explorer" })
ok submissionCellResponse.indexOf("dora_the_explorer") > -1
Expand Down

0 comments on commit de6862d

Please sign in to comment.