diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap
index ea8ae5d6f..52a608aec 100644
--- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap
+++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap
@@ -62,7 +62,9 @@ exports[`SettingsWidget snapshot snapshot: renders Settings widget for Advanced
@@ -37,10 +39,10 @@ export const ResetCard = ({
)}
-
@@ -50,6 +52,7 @@ export const ResetCard = ({
ResetCard.propTypes = {
showResetButton: PropTypes.bool.isRequired,
+ defaultValue: PropTypes.bool.isRequired,
updateSettings: PropTypes.func.isRequired,
// injected
intl: intlShape.isRequired,
diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ShowAnswerCard.jsx b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ShowAnswerCard.jsx
index 5739abbed..2e92667fd 100644
--- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ShowAnswerCard.jsx
+++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/ShowAnswerCard.jsx
@@ -26,6 +26,8 @@ export const ShowAnswerCard = ({
showAttempts,
} = useAnswerSettings(showAnswer, updateSettings);
+ const currentShowAnswer = showAnswer.on || defaultValue;
+
const showAnswerSection = (
<>
@@ -43,7 +45,7 @@ export const ShowAnswerCard = ({
{Object.values(ShowAnswerTypesKeys).map((answerType) => {
@@ -79,7 +81,7 @@ export const ShowAnswerCard = ({
return (
{showAnswerSection}
diff --git a/src/editors/data/redux/problem/reducers.js b/src/editors/data/redux/problem/reducers.js
index 4173cbc9b..c672b85a3 100644
--- a/src/editors/data/redux/problem/reducers.js
+++ b/src/editors/data/redux/problem/reducers.js
@@ -2,7 +2,7 @@ import _ from 'lodash-es';
import { createSlice } from '@reduxjs/toolkit';
import { indexToLetterMap } from '../../../containers/ProblemEditor/data/OLXParser';
import { StrictDict } from '../../../utils';
-import { ProblemTypeKeys, RichTextProblems, ShowAnswerTypesKeys } from '../../constants/problem';
+import { ProblemTypeKeys, RichTextProblems } from '../../constants/problem';
import { ToleranceTypes } from '../../../containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/Tolerance/constants';
const nextAlphaId = (lastId) => String.fromCharCode(lastId.charCodeAt(0) + 1);
@@ -28,10 +28,10 @@ const initialState = {
hints: [],
timeBetween: 0,
showAnswer: {
- on: ShowAnswerTypesKeys.FINISHED,
+ on: '',
afterAttempts: 0,
},
- showResetButton: false,
+ showResetButton: null,
solutionExplanation: '',
tolerance: {
value: null,