[Moved to openedx/frontend-app-course-authoring] A library of high-level components for content handling (viewing, editing, etc. of HTML, video, problems, etc.), to be shared by multiple MFEs.
This PR fixes problems where the maximum attempts is null by default. Previously, when a course had unlimited attempts by default and a user created a new problem, the unlimited option was not checked so the scoring card said, "1 point • 0 attempts". Now for new problems the unlimited option is checked and the card reads, "1 point • Unlimited attempts". This PR allows resolved the issue when changing a problems number of attempts from unlimited to a number and back to unlimited, the revert back to unlimited was not saved. This is because the default value of settings is not saved to problems so that it is able to automatically update if the default settings are changed. However, not saving the unlimited value did not revert the problem back to use the default maximum attempts. Now the unlimited value is saved even when it is the default value to reset the problem. The backend value is null so it does not inhibit the updating of the problem dynamically to match the advanced setting changes.
Supporting information
Github Issue #480
Testing
Open a course
Navigate to the Advanced settings page and confirm that "Maximum attempts" is set to null
Navigate to a unit page
Add a new simple problem
Check that the scoring card reads, "1 point • Unlimited attempts"
Click on the scoring card
Confirm that the unlimited checkbox is checked
Uncheck the box and add a new number of attempts
Click "Save"
Click "Edit" for the problem you just saved
Click on the scoring card
Check the unlimited checkbox
Click "Save"
Should not mention the number of attempts in the problem preview
Navigate to the Advanced settings page
Set "Maximum attempts" is set to 5
Navigate back to unit page
Confirm that problem preview shows the text "You have used 0 of 5 attempts"
Description
This PR fixes problems where the maximum attempts is null by default. Previously, when a course had unlimited attempts by default and a user created a new problem, the unlimited option was not checked so the scoring card said, "1 point • 0 attempts". Now for new problems the unlimited option is checked and the card reads, "1 point • Unlimited attempts". This PR allows resolved the issue when changing a problems number of attempts from unlimited to a number and back to unlimited, the revert back to unlimited was not saved. This is because the default value of settings is not saved to problems so that it is able to automatically update if the default settings are changed. However, not saving the unlimited value did not revert the problem back to use the default maximum attempts. Now the unlimited value is saved even when it is the default value to reset the problem. The backend value is null so it does not inhibit the updating of the problem dynamically to match the advanced setting changes.
Supporting information
Github Issue #480
Testing
null