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: increase grading rounding precision to avoid incorrect grades #27788

Conversation

Agrendalath
Copy link
Member

@Agrendalath Agrendalath commented May 31, 2021

Enabling the rounding in #16837 has been causing noticeable (up to 1 percentage point) differences between non-rounded subsection grades and a total grade for a course. This increases the grade precision to reduce the negative implications of double rounding.

Jira

OSPR-5819

Sandbox

https://pr27788.sandbox.opencraft.hosting/
Direct link to the progress page (you can log in as staff).

Testing instructions

  1. Import this course in Studio.
  2. Complete two units from there.
  3. Go to the Progress page and see that the score without this PR is 35%. After this change, it should be 34%.

Explanation

This course contains two subsections graded as Homework (weight: 75%):

  1. In the first subsection, users can get 2 out of 3 points (66.67%).
  2. In the second one, users can get 1 out of 4 points (25%).

In the current approach, the grades of subsections are rounded. Therefore, in this case, we're getting (67% + 25%) / 2 / 4 * 3 (/ 4 * 3 is because of the weight (75%)), which gives us 34.5. This is rounded up to 35%.

This PR changes these calculations to (66.67% + 25%) / 2 / 4 * 3, which returns 34.37625, which is then rounded down to 34%.

Deadline

None.

Reviewers

Other information

Private-ref: BB-4210
Product Review: openedx/platform-roadmap#238
Settings

Tutor requirements

git+https://github.com/overhangio/tutor.git@nightly
git+https://github.com/overhangio/tutor-discovery.git@nightly
git+https://github.com/overhangio/tutor-ecommerce.git@nightly
git+https://github.com/overhangio/tutor-xqueue.git@nightly
git+https://github.com/overhangio/tutor-forum.git@nightly

git+https://gitlab.com/opencraft/dev/[email protected]
git+https://github.com/hastexo/[email protected]

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels May 31, 2021
@openedx-webhooks
Copy link

openedx-webhooks commented May 31, 2021

Thanks for the pull request, @Agrendalath!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/wg-maintenance-edx-platform. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@Agrendalath Agrendalath marked this pull request as ready for review May 31, 2021 20:00
@openedx-webhooks openedx-webhooks added needs triage and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels May 31, 2021
@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from f296b60 to f8ef896 Compare May 31, 2021 20:44
Copy link
Contributor

@arjunsinghy96 arjunsinghy96 left a comment

Choose a reason for hiding this comment

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

👍 @Agrendalath LGTM.

  • I tested this: Scores are displayed with more precision on Progress page graph.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • N/A I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@Agrendalath
Copy link
Member Author

@natabene, this is ready for your review.

@natabene
Copy link
Contributor

natabene commented Jun 1, 2021

@Agrendalath Thank you for your contribution.

@arch-bom-gocd-alerts
Copy link

📣 💥 Heads-up: You must either rebase onto master or merge master into your branch to avoid breaking the build.

We recently removed diff-quality and introduced lint-amnesty. This means that the automated quality check that has run on your branch doesn't work the same way it will on master. If you have introduced any quality failures, they might pass on the PR but then break the build on master.

This branch has been detected to not have commit 2e33565 as an ancestor. Here's how to see for yourself:

git merge-base --is-ancestor 2e335653 agrendalath/bb-4210-increase_grading_precision && echo "You're all set" || echo "Please rebase onto master or merge master to your branch"

If you have any questions, please reach out to the Architecture team (either #edx-shared-architecture on Open edX Slack or #architecture on edX internal).

@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from f8ef896 to ebc2adf Compare June 15, 2021 12:19
@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from ebc2adf to 16b88f9 Compare November 8, 2021 12:01
@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from 16b88f9 to 6c60390 Compare December 1, 2021 00:55
@nizarmah
Copy link
Contributor

Hello @natabene, would this change require a product review or is it suitable for a core contributor review?

@natabene
Copy link
Contributor

@nizarmah Let me check and get back to you asap.

@natabene
Copy link
Contributor

@nizarmah Thanks for asking, we considered this and will need to do a product review first.

@Agrendalath
Copy link
Member Author

@natabene, just checking on this PR.

@natabene
Copy link
Contributor

Sorry, no news yet.

@ProductRyan
Copy link

Hey @Agrendalath - I'm the new 2U Product Manager working on grading. Apologies on the delay in response here.

Can you confirm my understanding of this change?

It appears that this will increase the accuracy, of the rounding that is already in place, up to 4 decimal places.

Is that correct? are there any other changes that I'm not catching?

@Agrendalath
Copy link
Member Author

Hi @ProductRyan, thank you for checking. That's correct - the subsection grades calculated by the platform are inaccurate because of the double rounding. Therefore, we want to increase the rounding precision to produce correct results.

This change will not affect existing persistent grades as long as they are not re-generated. Otherwise, this can cause up to a 1 percentage point difference in the results (on a rare occasion, like the one described in the PR).

@Agrendalath
Copy link
Member Author

@ProductRyan, @natabene, just a friendly reminder that this is still waiting for the product review.

@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from 19ac721 to 80f3177 Compare May 26, 2024 23:55
@feanil
Copy link
Contributor

feanil commented Jul 3, 2024

@Agrendalath I'm going through the old PRs, do you still want to pursue this PR or should we close this for now? If you're still interested I can try to get some eyes on this that could review this for you.

@feanil feanil added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Jul 3, 2024
@Agrendalath
Copy link
Member Author

@feanil, thank you for checking. We're definitely interested in merging this. Please see my last comment in the product review thread.

@feanil
Copy link
Contributor

feanil commented Jul 15, 2024

Sounds good , thanks I'll watch the product review thread and see what I can do to help unblock that.

@itsjeyd itsjeyd added product review complete PR has gone through product review and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Sep 20, 2024
Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

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

Approving since Jenna has signed off on this from the product side: openedx/platform-roadmap#238 (comment)

Agrendalath added a commit to open-craft/frontend-app-learning that referenced this pull request Sep 23, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.
@Agrendalath Agrendalath marked this pull request as ready for review September 23, 2024 11:53
Enabling the rounding in openedx#16837 has been causing noticeable (up to 1 percentage
point) differences between non-rounded subsection grades and a total grade for
a course. This increases the grade precision to reduce the negative
implications of double rounding.
@Agrendalath Agrendalath force-pushed the agrendalath/bb-4210-increase_grading_precision branch from 80f3177 to aabc594 Compare September 23, 2024 11:53
@Agrendalath Agrendalath self-assigned this Sep 23, 2024
@Agrendalath
Copy link
Member Author

Update: I'll merge this once openedx/frontend-app-learning#1397 is approved.

bradenmacdonald pushed a commit to openedx/frontend-app-learning that referenced this pull request Sep 23, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.
Agrendalath added a commit to open-craft/frontend-app-learning that referenced this pull request Sep 24, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.

(cherry picked from commit e4a0105)
Agrendalath added a commit to open-craft/frontend-app-learning that referenced this pull request Sep 24, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.

(cherry picked from commit e4a0105)
@Agrendalath Agrendalath merged commit 84d2ad9 into openedx:master Sep 24, 2024
50 checks passed
@Agrendalath Agrendalath deleted the agrendalath/bb-4210-increase_grading_precision branch September 24, 2024 14:05
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Agrendalath added a commit to open-craft/frontend-app-learning that referenced this pull request Sep 25, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.

(cherry picked from commit e4a0105)
Agrendalath added a commit to open-craft/frontend-app-learning that referenced this pull request Sep 25, 2024
We used two decimal digits to match the experience from the edx-platform.
However, openedx/edx-platform#27788 increased
the precision to reduce the impact of double rounding.

(cherry picked from commit e4a0105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U product review complete PR has gone through product review product review PR requires product review before merging
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.