-
Notifications
You must be signed in to change notification settings - Fork 33
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: add grading method field in problem editor #430
Conversation
Thanks for the pull request, @BryanttV! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
ddb78dc
to
e5e4016
Compare
src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/messages.js
Outdated
Show resolved
Hide resolved
...s/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ScoringCard.jsx
Outdated
Show resolved
Hide resolved
d035480
to
5045fb5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
==========================================
- Coverage 89.25% 89.16% -0.10%
==========================================
Files 246 246
Lines 4475 4493 +18
Branches 917 923 +6
==========================================
+ Hits 3994 4006 +12
- Misses 454 460 +6
Partials 27 27 ☔ View full report in Codecov by Sentry. |
5045fb5
to
f61d254
Compare
...blemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ScoringCard.test.jsx
Outdated
Show resolved
Hide resolved
src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/messages.js
Outdated
Show resolved
Hide resolved
src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/messages.js
Outdated
Show resolved
Hide resolved
src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/messages.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this alongside openedx/edx-platform#33911, and it worked as expected. Once the edx-platform PR is merged and this review is done, we can merge it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After testing it out, I left an approval yesterday for this PR, but now the backend will suffer some changes. Please, review this thread for more context: https://openedx.slack.com/archives/C02QN50TYMD/p1710176417562869
So we'll have to add that feature flag here too. I'll remove my approval for the time being.
6c3fb22
to
7af8d8c
Compare
705d22c
to
2716b5f
Compare
2716b5f
to
fcd649f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing all my comments. LGTM!
Hi @openedx/2u-tnl, Could you take a look at this PR? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good from a code perspective!
- Uses
getConfig
✔️ - Uses Paragon components ✔️
I left a couple nits about relative import paths, and I haven't tested this out locally, maybe it makes sense to get a sandbox up for it?
import { Form, Hyperlink } from '@openedx/paragon'; | ||
import { selectors } from '../../../../../../data/redux'; | ||
import SettingsOption from '../SettingsOption'; | ||
import messages from '../messages'; | ||
import { scoringCardHooks } from '../hooks'; | ||
import { GradingMethod, GradingMethodKeys } from '../../../../../../data/constants/problem'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could become problematic if we ever want to move this file. Does
import { GradingMethod, GradingMethodKeys } from '../../../../../../data/constants/problem'; | |
import { GradingMethod, GradingMethodKeys } from 'data/constants/problem'; |
not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your review! I was trying your suggestions and unfortunately, it doesn't work. I get that it doesn't find the module :(. It must be an absolute path, and that's how it's currently done in all the code.
import { formatMessage } from '../../../../../../../testUtils'; | ||
import { scoringCardHooks } from '../hooks'; | ||
import { ScoringCard } from './ScoringCard'; | ||
import { GradingMethodKeys } from '../../../../../../data/constants/problem'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about relative import paths as before (I see that formatMessage
is also doing this here, could be nice to clean that up too)
@brian-smith-tcril, It would be great if you could try these changes. Note that to show or hide the grading method field, changes in this PR are required: |
Hi @brian-smith-tcril, just a little reminder. The course authoring PR has been approved. |
Thanks for the reminder! I plan on doing a bit of local testing of this PR this afternoon and trying to get a PR sandbox deployed for it tomorrow morning. edit: I didn't get a chance to set up local testing for this yesterday. I plan on getting the sandbox up at the beginning of next week. |
I got a sandbox deployed for this here: openedx/frontend-app-authoring#969 (comment) @jmakowski1123 if you or anyone else who is familiar with the intended behavior of this could test it out in the sandbox that would be wonderful! |
Hi @brian-smith-tcril, thanks for generating the sandbox! If it might help, I copy a comment with the different test cases that was included in the backend PR. Note for the reviewer: Below is a list of all the test cases, and I have attached a course that can be used for this purpose. Test Course: grading-method.tar.gz Test Cases
Rescoring
Note Keep in mind that in cases of rescoring, the instructor can perform it in three different ways:
|
Hi @brian-smith-tcril! Here are the instructions I've used for testing:
Those were taken from the backend PR which I reviewed. About testing from a product POV, we can also help with testing following the approved product proposal. Please, let us know. We only have a few project hours left (~2 weeks), but we'll do our best to move this forward. Thank you! |
Hi @brian-smith-tcril! Is this something you're still able to look at? |
export const GradingMethod = StrictDict({ | ||
[GradingMethodKeys.LAST_SCORE]: { | ||
id: 'authoring.problemeditor.settings.gradingmethod.last_score', | ||
defaultMessage: 'Last Score', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'Last Score', | |
defaultMessage: 'Last score (Default)', |
}, | ||
[GradingMethodKeys.HIGHEST_SCORE]: { | ||
id: 'authoring.problemeditor.settings.gradingmethod.highest_score', | ||
defaultMessage: 'Highest Score', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'Highest Score', | |
defaultMessage: 'Highest score', |
}, | ||
[GradingMethodKeys.AVERAGE_SCORE]: { | ||
id: 'authoring.problemeditor.settings.gradingmethod.average_score', | ||
defaultMessage: 'Average Score', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'Average Score', | |
defaultMessage: 'Average score', |
}, | ||
[GradingMethodKeys.FIRST_SCORE]: { | ||
id: 'authoring.problemeditor.settings.gradingmethod.first_score', | ||
defaultMessage: 'First Score', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'First Score', | |
defaultMessage: 'First score', |
{isGradingMethodEnabled && <FormattedMessage {...messages.scoringSettingsLabelWithGradingMethod} />} | ||
{!isGradingMethodEnabled && <FormattedMessage {...messages.scoringSettingsLabel} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{isGradingMethodEnabled && <FormattedMessage {...messages.scoringSettingsLabelWithGradingMethod} />} | |
{!isGradingMethodEnabled && <FormattedMessage {...messages.scoringSettingsLabel} />} | |
{isGradingMethodEnabled ? | |
(<FormattedMessage {...messages.scoringSettingsLabelWithGradingMethod} /> | |
) : ( | |
<FormattedMessage {...messages.scoringSettingsLabel} /> | |
)} |
Hi! Thank you for your contribution to this repo. This repo is being deprecated and all the code is being moved to |
As mentioned above, we've now moved this code into https://github.com/openedx/frontend-app-course-authoring/ so we'll need you to please re-open this PR against |
@BryanttV Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
1 similar comment
@BryanttV Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR adds a new field in the Problem Editor for choosing a Grading Method. Currently, the only Grading Method is the Last Score. From now on, the new grading methods are:
Note
This field will only appear if the following feature flag is activated:
ENABLE_GRADING_METHOD_IN_PROBLEMS
Supporting information
These changes are part of the effort made to implement Configurable grading method for problems with multiple attempts
Demo
grading-method-demo.mp4
Dependencies
Important
This PR needs the changes made from these PRs:
ENABLE_GRADING_METHOD_IN_PROBLEMS
feature flag frontend-app-authoring#932, which includes the feature flag to enable the grading method in the problem editor.These are the last PRs needed to add support to the MFE for the Configurable grading method for problems with multiple attempts.
Testing Instructions
Using
tutor
you can test these changes:In your tutor environment clone the Course Authoring MFE with these changes.
Enable grading method in the Course Authoring MFE, you can use this tutor plugin:
Create a mount with
tutor mounts add frontend-app-course-authoring
Run
tutor config save
andtutor dev start -d
Inside the
frontend-app-course-authoring
folder clone this repository and checkout to this branch.Inside the
frontend-app-course-authoring
folder create a new file calledmodule.config.js
with this content:Then run
npm install
(First infrontend-lib-content-components
, then infrontend-app-course-authoring
)Active in the Django admin (
admin/waffle/flag/
) this waffle flags:new_core_editors.use_new_problem_editor
andnew_core_editors.use_new_text_editor
like this:Go to Studio and create a new component with a problem, for example: Single select
In the component settings you should see the new field.