change override handling with no sections

closes OUT-2191

Test plan:
- create a course with no sections
- enable mastery paths in the course
- create a quiz assigned to "Mastery Paths" only
- verify that quiz is saved assigned
  to Mastery Paths only, not Everyone Else as well
- create a discussion topic assigned to
  "Mastery Paths" only
- verify that discussion is saved assigned
  to Mastery Paths only, not Everyone Else as well

Change-Id: I3af0c58f54a6f9a7ee612ab87276984574ef08d0
Reviewed-on: https://gerrit.instructure.com/155222
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
This commit is contained in:
Michael Brewer-Davis 2018-06-25 15:51:14 -05:00 committed by Michael Brewer-Davis
parent c7a3f4cd11
commit 2f83a2eac8
2 changed files with 2 additions and 3 deletions

View File

@ -377,7 +377,7 @@ define [
data.unlock_at = defaultDate?.get('unlock_at') or null
data.due_at = defaultDate?.get('due_at') or null
data.assignment_overrides = @dueDateOverrideView.getOverrides()
data.only_visible_to_overrides = @dueDateOverrideView.containsSectionsWithoutOverrides()
data.only_visible_to_overrides = !@dueDateOverrideView.overridesContainDefault()
assignment = @model.get('assignment')
assignment or= @model.createAssignment()

View File

@ -1848,7 +1848,7 @@ const lockedItems = lockManager.isChildContent() ? lockManager.getItemLocks() :
data.allowed_attempts = attempts;
data['quiz[allowed_attempts]'] = attempts;
var overrides = overrideView.getOverrides();
data['quiz[only_visible_to_overrides]'] = overrideView.containsSectionsWithoutOverrides();
data['quiz[only_visible_to_overrides]'] = !overrideView.overridesContainDefault()
if (overrideView.containsSectionsWithoutOverrides() && !hasCheckedOverrides) {
var sections = overrideView.sectionsWithoutOverrides();
var missingDateView = new MissingDateDialog({
@ -4293,4 +4293,3 @@ const lockedItems = lockManager.isChildContent() ? lockManager.getItemLocks() :
}
}).triggerHandler('change');
});