edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

fix: increase grading rounding precision to avoid incorrect grades

Open Agrendalath opened this issue 4 years ago • 30 comments

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

  • [x] @arjunsinghy96
  • [ ] edX reviewer[s] TBD

Other information

Private-ref: BB-4210

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]

Agrendalath avatar May 31 '21 15:05 Agrendalath

Thanks for the pull request, @Agrendalath! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate.

openedx-webhooks avatar May 31 '21 15:05 openedx-webhooks

@natabene, this is ready for your review.

Agrendalath avatar May 31 '21 21:05 Agrendalath

@Agrendalath Thank you for your contribution.

natabene avatar Jun 01 '21 13:06 natabene

📣 💥 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 2e335653 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).

arch-bom-gocd-alerts avatar Jun 11 '21 18:06 arch-bom-gocd-alerts

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

edx-status-bot avatar Nov 08 '21 12:11 edx-status-bot

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

nizarmah avatar Jan 11 '22 02:01 nizarmah

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

natabene avatar Jan 12 '22 15:01 natabene

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

natabene avatar Jan 12 '22 15:01 natabene

@natabene, just checking on this PR.

Agrendalath avatar May 24 '22 14:05 Agrendalath

Sorry, no news yet.

natabene avatar May 24 '22 14:05 natabene

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?

ProductRyan avatar Aug 15 '22 15:08 ProductRyan

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 avatar Aug 15 '22 15:08 Agrendalath

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

Agrendalath avatar Sep 01 '22 14:09 Agrendalath

Flagging for you @ProductRyan and @jmakowski1123 - looks like this is waiting on Product review.

mphilbrick211 avatar Dec 16 '22 17:12 mphilbrick211

Hi @jmakowski1123 and @ProductRyan - flagging this. Looks like it still needs product review.

mphilbrick211 avatar Jan 23 '23 21:01 mphilbrick211

Status update: 1/31 - On hold for review across platform for consistent UI. Timeline TBD.

jmakowski1123 avatar Jan 31 '23 16:01 jmakowski1123

Since this ticket requires deeper edX product input, I've created a Product Feature ticket here to track continued product communications and feedback.

jmakowski1123 avatar Feb 23 '23 14:02 jmakowski1123

Hi @Agrendalath! While this is with product in review, would you mind re-running the tests? We've had a couple new ones pop up ("shellcheck"). Thanks!

mphilbrick211 avatar Apr 25 '23 17:04 mphilbrick211

@Agrendalath if you need, you can access the sandbox at https://pr-27788-0e7f8a.staging.do.opencraft.hosting/

gabor-boros avatar Jul 21 '23 16:07 gabor-boros

@Agrendalath hi there! Per Jenna's comment here, would you mind moving this to a draft? Thanks!

mphilbrick211 avatar Aug 29 '23 15:08 mphilbrick211

@mphilbrick211, sure thing. Done.

Agrendalath avatar Aug 29 '23 17:08 Agrendalath

@gabor-boros, I see "This site is currently being provisioned. Please try again in a few minutes." when I try to access the sandbox.

Agrendalath avatar Sep 22 '23 09:09 Agrendalath

@Agrendalath Ah, in the meantime I had to reprovision the whole cluster, so the instance got destroyed. I'm going to quickly recreate the instance.

gabor-boros avatar Sep 22 '23 09:09 gabor-boros

@Agrendalath the sandbox is up and running but forum won't work as of now. -- I need to fix something before. If you update the branch, please trigger a pipeline manually as I disabled the PR watcher now. (i.e. do a commit with [AutoDeploy][Update] pr-27788-0e7f8a|2 message for the grove-stage-digitalocean repo.)

gabor-boros avatar Sep 22 '23 12:09 gabor-boros

@gabor-boros, the MFEs also seem to be down - when I try to sign in, I get "The page you're looking for is unavailable or there's an error in the URL. Please check the URL and try again.".

Agrendalath avatar Sep 22 '23 12:09 Agrendalath

Sandbox deployment successful.

Sandbox LMS is available at pr-27788-139931.staging.do.opencraft.hosting Sandbox Studio is available at studio.pr-27788-139931.staging.do.opencraft.hosting

open-craft-grove avatar Oct 30 '23 16:10 open-craft-grove

Sandbox deployment successful.

Sandbox LMS is available at pr-27788-139931.staging.do.opencraft.hosting Sandbox Studio is available at studio.pr-27788-139931.staging.do.opencraft.hosting

open-craft-grove avatar Oct 30 '23 17:10 open-craft-grove

Sandbox destroy request received.

open-craft-grove avatar Nov 30 '23 10:11 open-craft-grove

@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 avatar Jul 03 '24 12:07 feanil

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

Agrendalath avatar Jul 08 '24 09:07 Agrendalath