fix: sort sections in course-optimizer before returning result#36441
fix: sort sections in course-optimizer before returning result#36441hinakhadim merged 6 commits intomasterfrom
Conversation
|
|
||
| sections_map = {section['id']: section for section in data['LinkCheckOutput']['sections']} | ||
| sorted_sections = [sections_map[section_id] for section_id in sorted_section_ids if section_id in sections_map] | ||
| data['LinkCheckOutput']['sections'] = sorted_sections |
There was a problem hiding this comment.
Why are you using sorted_sections instead of directly assigning?
There was a problem hiding this comment.
data["LinkCheckOutput"]["sections"] = [
sections_map[section_id]
for section_id in sorted_section_ids
if section_id in sections_map
]
There was a problem hiding this comment.
Nice catch! fixed it.
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
Course Optimizer detected unusual section ordering where Section 3 appears before Section 1, which is unexpected and inconsistent with standard 'Course Outline' Ordering. This PR fixes by getting ordered section_ids and place sections in sorted manner basis on sections_ids ordering.
Useful information to include:
Other information
Before
After