diff --git a/src/editors/data/redux/problem/reducers.js b/src/editors/data/redux/problem/reducers.js index 42e1f7c57c..034f1bbb38 100644 --- a/src/editors/data/redux/problem/reducers.js +++ b/src/editors/data/redux/problem/reducers.js @@ -60,11 +60,9 @@ const problem = createSlice({ if (obj.id === id) { if (_.has(answer, 'correct') && payload.correct) { correctAnswerCount += 1; - return { ...obj, ...answer }; } - if (_.has(answer, 'correct') && payload.correct === false) { + if (_.has(answer, 'correct') && payload.correct === false && correctAnswerCount > 0) { correctAnswerCount -= 1; - return { ...obj, ...answer }; } return { ...obj, ...answer }; }