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

Record and compute sub-requirement progress in a fine-grained way #344

Merged
merged 1 commit into from
Mar 7, 2021

Conversation

SamChou19815
Copy link
Contributor

@SamChou19815 SamChou19815 commented Mar 4, 2021

Summary

Implemented the proposal in #343. Check that issue for the discussion on design decisions.

Test Plan

Added a test to ensure perSlotMinCount.length === checkers.length for all requirements,

Example showing A&S's PSB vs MQR requirement is correctly handled:
Screen Shot 2021-03-04 at 15 58 56

Engineering requirement is still correctly computed:
consistent

Notes

Info-sci concentrations are not done in this PR to avoid getting this PR too large.

@SamChou19815 SamChou19815 requested a review from a team as a code owner March 4, 2021 21:00
@SamChou19815 SamChou19815 linked an issue Mar 4, 2021 that may be closed by this pull request
@dti-github-bot
Copy link
Member

dti-github-bot commented Mar 4, 2021

[diff-counting] Significant lines: 930.

@SamChou19815 SamChou19815 force-pushed the fine-grained-sub-req-progress branch from f53c11f to 2cc309b Compare March 4, 2021 21:02
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2021

Visit the preview URL for this PR (updated for commit 1896f55):

https://cornelldti-courseplan-dev--pr344-fine-grained-sub-req-0np259g5.web.app

(expires Sat, 13 Mar 2021 21:41:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@SamChou19815 SamChou19815 force-pushed the fine-grained-sub-req-progress branch from 2cc309b to 50ed657 Compare March 4, 2021 21:29
Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments below
main concern:

  • modal showing that a course fulfills PBS/MQR when it is already fulfilled by another course.

@hahnbeelee
Copy link
Contributor

hahnbeelee commented Mar 6, 2021

OK - so I'm seeing why I was confused. If you already took 2 MQR courses & take a third: on the add modal it shows that it'll satisfy PBS & MQR (not as desired) but when you add the course it doesn't end up affecting the sidebar (as desired).
image

We should make it so that it doesn't show that it fulfills MQR or PBS on the add modal. How? Is there a way to check through the frontend that it will eventually not fulfill the requirement? Or is there a way to ensure that it won't show up at all from some calculation in the requirements logic? (I am asking these questions to scope if this is a problem I need to address or if it's better for u to address right now in this PR) Clearly, some computation is happening after the course is added instead of when the requirements are shown on the modal.

@hahnbeelee
Copy link
Contributor

So, it seems as though now there is a hierarchy of requirement > sub-requirement > slot

Can you add definitions to all of these in the READ-ME in a future PR?

@hahnbeelee
Copy link
Contributor

OK - so I'm seeing why I was confused. If you already took 2 MQR courses & take a third: on the add modal it shows that it'll satisfy PBS & MQR (not as desired) but when you add the course it doesn't end up affecting the sidebar (as desired).
image

We should make it so that it doesn't show that it fulfills MQR or PBS on the add modal. How? Is there a way to check through the frontend that it will eventually not fulfill the requirement? Or is there a way to ensure that it won't show up at all from some calculation in the requirements logic? (I am asking these questions to scope if this is a problem I need to address or if it's better for u to address right now in this PR) Clearly, some computation is happening after the course is added instead of when the requirements are shown on the modal.

maybe some more computation needs to happen in the requirement-frontend-computation.ts file?

@hahnbeelee
Copy link
Contributor

Should I be able to run the tests somehow?

@SamChou19815
Copy link
Contributor Author

Should I be able to run the tests somehow?

@hahnbeelee npm run test

Copy link
Collaborator

@tcho6319 tcho6319 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sam! I left some comments about how the perSlotMinCount was determined for some of the reqs and requests for documentation in certain functions. The next sprint will involve the team looking through our requirements data and making sure it's as accurate as possible so perhaps more changes can be handled there, but I think some of the perSlotMinCount values were off. I also wanted to note an issue below:

  1. I don't think the frontend is correctly handling the PBS and MQR courses requirement. It only registers the 3 slots and doesn't add another one to complete the requirement. Not sure if it would be best to address in this PR since it's getting large:
Screen.Recording.2021-03-05.at.2.31.49.PM.mov

src/requirements/requirement-frontend-computation.ts Outdated Show resolved Hide resolved
src/requirements/data/majors/bme.ts Outdated Show resolved Hide resolved
src/requirements/data/majors/bio.ts Show resolved Hide resolved
src/requirements/data/checkers-common.ts Outdated Show resolved Hide resolved
src/requirements/data/majors/bio.ts Outdated Show resolved Hide resolved
src/requirements/data/majors/bme.ts Outdated Show resolved Hide resolved
@SamChou19815 SamChou19815 force-pushed the fine-grained-sub-req-progress branch from 50ed657 to 700164a Compare March 6, 2021 21:32
@SamChou19815 SamChou19815 force-pushed the fine-grained-sub-req-progress branch from 700164a to 1896f55 Compare March 6, 2021 21:38
@SamChou19815
Copy link
Contributor Author

@tcho6319 I updated some incorrect requirement perSlotMinCount setup. They should be accurate now. It turns out the original setup is also wrong, but this setup now give them the expressive power to specify the requirement correctly now.

@hahnbeelee
In terms of the PBS/MQR requirement, we do need additional work to make them right. However, I think this PR is a good start. To ensure the add modal doesn't report that you can still use a MQR course to fulfill the requirement when all the slots are already used up, we can use the computeFulfillmentCoursesAndStatistics function to compute a new statistics after the new course is added, and only allow if the new stat is greater than the old stat.

@tcho6319
In terms of the 3 slot vs 4 slot issue in the PBS/MQR requirement, I believe we should actually use 3 slots, since logically there are 3 slots. Currently, it's slightly broken because the frontend code assumes that 1 slot can only be filled by 1 course. This is something we might want to change. Loop in @einc for potential design work.

@SamChou19815 SamChou19815 self-assigned this Mar 6, 2021
Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, sounds good then!

@einc
Copy link
Contributor

einc commented Mar 7, 2021

For the "3 slot vs 4 slot issue in the PBS/MQR requirement", I thought there were supposed to be 4 slots also?
Two for PBS classes, One for MQR, and One for MQR or PBS?

Is there only 3 slots right now because we adding one MQR class counts for both the MQR AND the (MQR or PBS) slot? Is the problem that we currently can't differentiate the (MQR or PBS) sub-requirement from the PBS and MQR subrequirements?

@SamChou19815
Copy link
Contributor Author

For the "3 slot vs 4 slot issue in the PBS/MQR requirement", I thought there were supposed to be 4 slots also?

Two for PBS classes, One for MQR, and One for MQR or PBS?

Is there only 3 slots right now because we adding one MQR class counts for both the MQR AND the (MQR or PBS) slot? Is the problem that we currently can't differentiate the (MQR or PBS) sub-requirement from the PBS and MQR subrequirements?

@einc It's currently 3 slots because the slots are PSB: 2 courses, MQR: 1 course, PSB/MQR: 1 course.

Copy link
Collaborator

@tcho6319 tcho6319 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Sam!

@tcho6319 In terms of the 3 slot vs 4 slot issue in the PBS/MQR requirement, I believe we should actually use 3 slots, since logically there are 3 slots. Currently, it's slightly broken because the frontend code assumes that 1 slot can only be filled by 1 course. This is something we might want to change. Loop in @einc for potential design work.

I think this frontend code fix should be done in a separate PR. I will make a Story item for it on Notion.

@SamChou19815 SamChou19815 merged commit d6b9884 into master Mar 7, 2021
@SamChou19815 SamChou19815 deleted the fine-grained-sub-req-progress branch March 7, 2021 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Fine-grained sub-requirement progress calculation
5 participants