Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Get Nested Prerequisites Method #5

Closed
patrick-5546 opened this issue Dec 30, 2020 · 0 comments · Fixed by #14
Closed

Fix Get Nested Prerequisites Method #5

patrick-5546 opened this issue Dec 30, 2020 · 0 comments · Fixed by #14

Comments

@patrick-5546
Copy link
Owner

patrick-5546 commented Dec 30, 2020

Uses recursion to get all the prerequisites required for a course, stored in the preq field of Course

Relevant code:

Example

Consider the tree:
image

What should be stored:

{child1: {}, child2: {child21: {}, child22: {}}, child3: {}}

Real Example

Immediate prerequisites of MATH 256 (under key preq in dictionary that course_info() returns):

['MATH 101', 'MATH 103', 'MATH 105', 'MATH 121', 'SCIE 001', 'MATH 152', 'MATH 221', 'MATH 223']

Prerequisites of MATH 223 include MATH 121. Prerequisites of MATH 121 include MATH 120 and MATH 100.

What course_info_with_prereq_tree("MATH", "256") should return:

{..., MATH 223: {MATH 121: {MATH 120: {}, MATH 100: {}, ...}, ...}}
@patrick-5546 patrick-5546 added this to To do in Finish Course Model via automation Dec 30, 2020
Finish Course Model automation moved this from To do to Done Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant