Merge pull request #24050 from cpennington/exclude-ora-pls

Only add PLS dates to graded sections that have scored, non-ORA content.
This commit is contained in:
Calen Pennington
2020-05-26 10:56:35 -04:00
committed by GitHub

View File

@@ -53,13 +53,25 @@ def extract_dates_from_course(course):
# unless that item already has a relative date set
for _, section, weeks_to_complete in spaced_out_sections(course):
items = [section]
has_non_ora_scored_content = False
section_date_items = []
while items:
next_item = items.pop()
# TODO: This is pretty gross, and should maybe be configurable in the future,
# especially if we find ourselves needing more exceptions.
if next_item.graded:
# TODO: Once studio can manually set relative dates,
# we would need to manually check for them here
date_items.append((next_item.location, {'due': weeks_to_complete}))
section_date_items.append((next_item.location, {'due': weeks_to_complete}))
has_non_ora_scored_content = (
has_non_ora_scored_content or
(next_item.has_score and next_item.category != 'openassessment')
)
items.extend(next_item.get_children())
if has_non_ora_scored_content:
date_items.extend(section_date_items)
else:
date_items = []
store = modulestore()