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

feat: default grade designations configurable from settings #32406

Merged

Conversation

kaustavb12
Copy link
Contributor

@kaustavb12 kaustavb12 commented Jun 9, 2023

Description

Currently a maximum of 5 grade cutoffs are configurable from the Grading Settings in Studio.
However, some universities might require more that 5 cutoffs depending on their grading policy.

Also, when a new grade cutoff is added, a default grade desgination is assigned to this cufoff. These default grade designations are hard coded in the javascript code. This means, if the maximum number of grade cutoff are to be increased, more default grade designations also need to be defined.

This PR address this issue.

In this PR, a new setting DEFAULT_GRADE_DESIGNATIONS is introduced which can be used to define the pass grade designations. This has a default value of ['A', 'B', 'C', 'D'], which is the current default.

The maximum number of grade cutoffs is now dependent on the length of the grade designations list, instead of being hard-coded to 5.

As before, the failure grade designation is always set to F which cannot be changed and is not to be included in the DEFAULT_GRADE_DESIGNATIONS list.

Ex. If there is a need to configure 7 grade cutoffs instead of the default 5, the following setting can be used:

DEFAULT_GRADE_DESIGNATIONS = ['A+', 'A', 'B+', 'B', 'C', 'D']

The DEFAULT_GRADE_DESIGNATIONS list must have more than 1 desginations, otherwise the default grade designations falls back to ['A', 'B', 'C', 'D'].

Supporting information

Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.

Testing instructions

Default Scenario

  1. Start studio in devstack using the PR branch
  2. Open an exisiting course or create a new one.
  3. Go to Settings --> Grading
  4. Click on the + button repeatedly to add new grade cutoffs
  5. Verify that maximum 5 grade cutoff designations are configurable with the values 'A', 'B', 'C', 'D' and 'F'

Modify Grade Designations

  1. Add this to cms\envs\devstack.py : DEFAULT_GRADE_DESIGNATIONS = ['A+', 'A', 'B+', 'B', 'C', 'D']
  2. Start studio in devstack using the PR branch
  3. Open an exisiting course or create a new one.
  4. Go to Settings --> Grading
  5. Click on the + button repeatedly to add new grade cutoffs
  6. Verify that maximum 7 grade cutoff designations are configurable with the values 'A+', 'A', 'B+', 'B', 'C', 'D' and 'F'

Grade Designations Fallback

  1. Add this to cms\envs\devstack.py : DEFAULT_GRADE_DESIGNATIONS = ['A+']
  2. Start studio in devstack using the PR branch
  3. Open an exisiting course or create a new one.
  4. Go to Settings --> Grading
  5. Click on the + button repeatedly to add new grade cutoffs
  6. Verify that maximum 5 grade cutoff designations are configurable with the values 'A', 'B', 'C', 'D' and 'F'

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

OpenCraft internal ticket : BB-7378

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 9, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Jun 9, 2023

Thanks for the pull request, @kaustavb12! 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.

Please let us know once your PR is ready for our review and all tests are green.

@kaustavb12 kaustavb12 force-pushed the kaustav/default_grade_designations branch from c3428c8 to 59e3957 Compare June 9, 2023 06:30
@@ -314,7 +315,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
addNewGrade: function(e) {
e.preventDefault();
var gradeLength = this.descendingCutoffs.length; // cutoffs doesn't include fail/f so this is only the passing grades
if (gradeLength > 3) {
if (gradeLength > this.GRADES.length - 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kaustavb12 could be a dumb question, but is there a possibility of this.GRADES being undefined if this line is invoked?

Eg. if options.gradeDesignations == 0 then these lines will trigger an error:

this.setupGradeDesignations([])
this.addNewGrade()

Copy link
Contributor Author

@kaustavb12 kaustavb12 Jun 11, 2023

Choose a reason for hiding this comment

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

@keithgg

Great question.

We already have a default value of this.GRADES, therefore I feel the chances of this.GRADES being undefined is slim.

The place which is most likely to break with an erroneous value of options.gradeDesignations is the length check in the setupGradeDesignations method. Although, for most scenarios, such as passing an intereger, strings, empty arrays etc., this seems to be handled elegently by the browser and nothing breaks. Only explicitly passing None/null seems to break this.

To mitigate that, I have now added a check to verify that gradeDesignations is infact a valid array. This seems to handle those edge cases I mentioned above.

@kaustavb12 kaustavb12 force-pushed the kaustav/default_grade_designations branch from a399053 to 376514b Compare June 11, 2023 14:27
Copy link
Contributor

@keithgg keithgg left a comment

Choose a reason for hiding this comment

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

@kaustavb12 LGTM 👍

  • I read through the code
  • I confirmed that I could replicate the test instructions

@mphilbrick211
Copy link

Hi @jmakowski1123 - checking on this one to see if it should go through Product review?

@mphilbrick211
Copy link

Hi @jmakowski1123! Any update on this?

@jmakowski1123
Copy link

Product Feature Ticket is ready for product review: https://github.com/orgs/openedx/projects/4/views/20

@kaustavb12
Copy link
Contributor Author

@mphilbrick211

I believe this feature now has product approval and I have made the changes requested there.

Are we good to move this PR to review now ?

@mphilbrick211 mphilbrick211 added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Jan 11, 2024
@mphilbrick211
Copy link

Thanks for flagging, @kaustavb12! I've sent this over to @openedx/2u-arch-bom to take a look at.

@kaustavb12
Copy link
Contributor Author

kaustavb12 commented Mar 6, 2024

@mphilbrick211 Just checking to see, could this ticket be CC reviewed ?

@timmc-edx
Copy link
Contributor

Sorry, looks like we didn't end up routing this properly. @openedx/2u-tnl can you take a look?

@farhaanbukhsh
Copy link
Member

farhaanbukhsh commented Mar 30, 2024

@mphilbrick211 I can help to review this PR 😇

@mphilbrick211
Copy link

@mphilbrick211 I can help to review this PR 😇

Thank you so much, @farhaanbukhsh!

@mphilbrick211 mphilbrick211 added product review complete PR has gone through product review and removed product review PR requires product review before merging labels Apr 2, 2024
@0x29a
Copy link
Contributor

0x29a commented Apr 10, 2024

@farhaanbukhsh, @kaustavb12, if I'm not mistaken, we have around two weeks before the Redwood release cut. It'd be really awesome if we could get this PR reviewed and merged before the cut.

Copy link
Member

@farhaanbukhsh farhaanbukhsh left a comment

Choose a reason for hiding this comment

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

@kaustavb12 apart from the clarification everything looks good, Kudos on the work.

@kaustavb12 kaustavb12 force-pushed the kaustav/default_grade_designations branch from cb99549 to 5911cbf Compare May 2, 2024 11:00
@kaustavb12
Copy link
Contributor Author

kaustavb12 commented May 2, 2024

@farhaanbukhsh

Thanks a lot for the review.

Review comment addressed. I have also rebased and squashed the commits.

@farhaanbukhsh
Copy link
Member

jenkins run all

@kaustavb12 kaustavb12 force-pushed the kaustav/default_grade_designations branch 2 times, most recently from 32e10d0 to 851dafa Compare May 3, 2024 10:48
Copy link
Member

@farhaanbukhsh farhaanbukhsh left a comment

Choose a reason for hiding this comment

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

👍

  • ✅ I tested this on devstack and it works perfectly
  • ✅ I read through the code
  • ❌ I checked for accessibility issues
  • ❌ Includes documentation
  • ❌ I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@farhaanbukhsh
Copy link
Member

@kaustavb12 can you rebase the PR, thanks :)

@kaustavb12 kaustavb12 force-pushed the kaustav/default_grade_designations branch from 851dafa to 218a010 Compare May 7, 2024 15:30
@kaustavb12
Copy link
Contributor Author

@farhaanbukhsh Rebased and Squashed

@farhaanbukhsh farhaanbukhsh merged commit d43a2f7 into openedx:master May 7, 2024
79 checks passed
@farhaanbukhsh farhaanbukhsh deleted the kaustav/default_grade_designations branch May 7, 2024 19:44
@openedx-webhooks
Copy link

@kaustavb12 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@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.

@itsjeyd itsjeyd removed the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label May 23, 2024
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
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

10 participants