-
Notifications
You must be signed in to change notification settings - Fork 1
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 strategy field in problem editor #2
Conversation
@@ -38,6 +38,8 @@ export const parseScoringSettings = (metadata, defaultSettings) => { | |||
|
|||
scoring = popuplateItem(scoring, 'weight', 'weight', metadata); | |||
|
|||
scoring = popuplateItem(scoring, 'grading_strategy', 'gradingStrategy', metadata); |
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 needs to be covered in SettingsParser.test.js
@@ -82,6 +82,16 @@ const messages = defineMessages({ | |||
defaultMessage: 'Points', | |||
description: 'Scoring weight input label', | |||
}, | |||
scoringGradingStrategyInputLabel: { |
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.
These two messages need to be covered in index.test.jsx
@@ -117,6 +127,11 @@ const messages = defineMessages({ | |||
defaultMessage: 'If a value is not set, the problem is worth one point', | |||
description: 'Summary text for scoring weight', | |||
}, | |||
gradingStrategyHint: { |
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.
className="scoringCard" | ||
> | ||
<div className="mb-4"> | ||
<FormattedMessage {...messages.scoringSettingsLabel} /> | ||
</div> | ||
<Form.Group> | ||
<Form.Control |
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 select needs to be covered in ScordingCard.test.jsx
floatingLabel={intl.formatMessage(messages.scoringGradingStrategyInputLabel)} | ||
> | ||
{Object.values(GradingStrategyKeys).map((gradingStrategy) => { | ||
let optionDisplayName = GradingStrategy[gradingStrategy]; |
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.
let optionDisplayName = GradingStrategy[gradingStrategy]; | |
const { defaultMessage } = GradingStrategy[gradingStrategy]; | |
const optionDisplayName = { | |
...GradingStrategy[gradingStrategy], | |
defaultMessage: gradingStrategy === defaultValue ? `${defaultMessage} (Default)` : defaultMessage | |
}; | |
d035480
to
5045fb5
Compare
Currently, the grading_strategy is sent in the request to the CMS but it's not updated
5045fb5
to
f61d254
Compare
Description
This PR adds a new field in the Problem Editor for choosing a Grading Strategy. Currently, the only Grading Strategy is the Last Score. From now on, the new grading strategies are:
Screenshots
Dependencies
This PR needs the changes made from this PR, which includes the new field from the Backend.
Testing Instructions
Using
tutor
you can test these changes:In your tutor environment clone the frontend-app-course-authoring MFE
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 settings of the component you should see the new field.