Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
801acb68
Commit
801acb68
authored
3 years ago
by
Sofia Yoon
Browse files
Options
Downloads
Patches
Plain Diff
fix: only apply due date to subsection if there is non-ora content
parent
67da5bbb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/course_date_signals/handlers.py
+17
-0
17 additions, 0 deletions
openedx/core/djangoapps/course_date_signals/handlers.py
with
17 additions
and
0 deletions
openedx/core/djangoapps/course_date_signals/handlers.py
+
17
−
0
View file @
801acb68
...
...
@@ -91,13 +91,30 @@ def _get_custom_pacing_children(subsection, num_weeks):
Return relative date items for the subsection and its children
"""
items
=
[
subsection
]
has_content
=
False
all_problems_are_ora
=
True
section_date_items
=
[]
while
items
:
next_item
=
items
.
pop
()
is_problem
=
next_item
.
category
not
in
{
'
sequential
'
,
'
vertical
'
}
if
is_problem
:
has_content
=
True
# Open response assessment problems have their own due dates
if
next_item
.
category
!=
'
openassessment
'
:
section_date_items
.
append
((
next_item
.
location
,
{
'
due
'
:
timedelta
(
weeks
=
num_weeks
)}))
items
.
extend
(
next_item
.
get_children
())
if
is_problem
:
all_problems_are_ora
=
False
# If all the problems are ORA then we return an empty list. This is to avoid potential conflicts with
# custom relative dates through PLS and Studio since ORA problems have their own due dates.
if
has_content
and
all_problems_are_ora
:
return
[]
# If there are non ORA content problems or if there are no problems at all return the list of date items.
# Relative dates should apply to subsections and their children if there are other graded assignments
# in it (i.e. non-ORA problems). The current custom PLS allows for due dates to be set even for empty
# units.
return
section_date_items
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment