Skip to content
Snippets Groups Projects
Commit d90a1392 authored by Calen Pennington's avatar Calen Pennington
Browse files

Only add PLS dates to graded sections that have scored, non-ORA content.

parent 1d7ff32a
No related branches found
Tags release-2021-06-30-06.16
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment