add text to anonymous grading box
also disables the box if the assignment is a new quiz and already anonymous closes EVAL-3390 flag=anonymous_marking test plan: - create/edit a new quiz - notice the new text under the anonymous grading checkbox - edit a new quiz where anonymous grading is already enabled - notice the checkbox is disabled and cannot be turned off Change-Id: Ibc0e872c89ad6e932da55e93c93026e4dc492f11 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/324649 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com> QA-Review: Kai Bjorkman <kbjorkman@instructure.com> Product-Review: Jody Sailor
This commit is contained in:
parent
1ae72ff6a5
commit
5c6fdd30fe
|
@ -1674,6 +1674,13 @@ QUnit.module('EditView: anonymous grading', hooks => {
|
|||
strictEqual(view.$el.find('input#assignment_anonymous_grading').length, 1)
|
||||
})
|
||||
|
||||
test('shows warning text under checkbox when assignment is Quiz LTI', () => {
|
||||
ENV.ANONYMOUS_GRADING_ENABLED = true
|
||||
const view = editView({is_quiz_lti_assignment: true})
|
||||
strictEqual(view.toJSON().anonymousGradingEnabled, true)
|
||||
strictEqual(view.$el.find('#anonymous-lti-text').length, 1)
|
||||
})
|
||||
|
||||
test('is disabled when group assignment is enabled', () => {
|
||||
ENV.ANONYMOUS_GRADING_ENABLED = true
|
||||
ENV.GROUP_CATEGORIES = [{id: '1', name: 'Group Category #1'}]
|
||||
|
@ -1684,6 +1691,15 @@ QUnit.module('EditView: anonymous grading', hooks => {
|
|||
|
||||
strictEqual(anonymousGradingCheckbox.prop('disabled'), true)
|
||||
})
|
||||
|
||||
test('is disabled when editing a quiz lti assignment with anonymous grading turned on', () => {
|
||||
ENV.ANONYMOUS_GRADING_ENABLED = true
|
||||
const view = editView({is_quiz_lti_assignment: true, anonymous_grading: true})
|
||||
view.$el.appendTo($('#fixtures'))
|
||||
view.afterRender()
|
||||
const anonymousGradingCheckbox = view.$el.find('input#assignment_anonymous_grading')
|
||||
strictEqual(anonymousGradingCheckbox.prop('disabled'), true)
|
||||
})
|
||||
})
|
||||
|
||||
QUnit.module('EditView: Anonymous Instructor Annotations', hooks => {
|
||||
|
|
|
@ -1130,6 +1130,7 @@ EditView.prototype.toJSON = function () {
|
|||
(typeof ENV !== 'undefined' && ENV !== null
|
||||
? ENV.ANONYMOUS_INSTRUCTOR_ANNOTATIONS_ENABLED
|
||||
: void 0) || false,
|
||||
anonymousGradingCheckboxDisabled: !this.assignment.isNew() && this.assignment.isQuizLTIAssignment() && this.assignment.anonymousGrading(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -206,8 +206,12 @@
|
|||
class="GradeAnonymously__Checkbox"
|
||||
id="assignment_anonymous_grading"
|
||||
name="anonymous_grading"
|
||||
disabled="{{anonymousGradingCheckboxDisabled}}"
|
||||
}}
|
||||
{{#t}}Graders cannot view student names{{/t}}
|
||||
<div id="anonymous-lti-text" style="{{hiddenUnless isQuizLTIAssignment}};font-size: 0.9em">
|
||||
{{#t}}Once enabled for New Quizzes, anonymous grading will not be able to be toggled off.{{/t}}
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label class="checkbox" for="assignment_graders_anonymous_to_graders" style="{{hiddenUnless showGradersAnonymousToGradersCheckbox}}">
|
||||
|
|
Loading…
Reference in New Issue