forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reviewers to students in multiple sections
Students who are enrolled in multiple course sections can now have reviewers added to them without causing a canvas error. This change also includes a fix to make the moderation page render properly when a student has no grades awaiting moderation. fixes CNVS-27153 fixes CNVS-28190 test plan: - Create an course with multiple sections. - Enroll a student in more than one section. - Create an assignment that allows for moderation. - Go into the moderation panel and add a reviewer for all students. - Note that reviewers are added with no error. - Note that the final grade column is a - Change-Id: I77cf50c5928b3f947a580ce4db6e0fc01ea569ef Reviewed-on: https://gerrit.instructure.com/75035 Reviewed-by: Spencer Olson <[email protected]> Reviewed-by: Derek Bender <[email protected]> Tested-by: Jenkins QA-Review: Adrian Russell <[email protected]> Product-Review: Keith T. Garner <[email protected]>
- Loading branch information
Showing
4 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,18 @@ define [ | |
} | ||
] | ||
} | ||
fakeUngradedStudentList = {students: | ||
[ | ||
{ | ||
'id': 3 | ||
'display_name': '[email protected]' | ||
'avatar_image_url': 'https://canvas.instructure.com/images/messages/avatar-50.png' | ||
'html_url': 'http://localhost:3000/courses/1/users/3' | ||
'in_moderation_set': false | ||
'selected_provisional_grade_id': null | ||
} | ||
] | ||
} | ||
|
||
module 'ModeratedStudentList' | ||
|
||
|
@@ -97,6 +109,22 @@ define [ | |
equal gradeColumns[0].props.children[1].props.children, 4 | ||
React.unmountComponentAtNode(studentList.getDOMNode().parentNode) | ||
|
||
test 'properly renders final grade if there are no provisional grades', -> | ||
newFakeStudentList = _.extend({}, fakeUngradedStudentList) | ||
studentList = TestUtils.renderIntoDocument(React.createElement(ModeratedStudentList, | ||
urls: {assignment_speedgrader_url: 'blah'}, | ||
includeModerationSetColumns: true, | ||
studentList: newFakeStudentList, | ||
assignment: {published: false}, | ||
handleCheckbox: () => 'stub' | ||
onSelectProvisionalGrade: () => 'stub' | ||
) | ||
) | ||
|
||
gradeColumns = TestUtils.scryRenderedDOMComponentsWithClass(studentList, 'AssignmentList_Grade') | ||
equal gradeColumns[0].getDOMNode().querySelectorAll('span')[1].textContent, '-', 'grade column is a dash' | ||
React.unmountComponentAtNode(studentList.getDOMNode().parentNode) | ||
|
||
test 'does not show radio button if there is only one provisional grade', -> | ||
newFakeStudentList = _.extend({}, fakeStudentList) | ||
studentList = TestUtils.renderIntoDocument(React.createElement(ModeratedStudentList, | ||
|