openedx/frontend-lib-content-components

The 'Show Answer' option in Advanced settings doesn't affect the 'Show Answer' option for a specific Unit.

Closed this issue · 0 comments

Description:

If the Show Answer field has been changed in the Advance settings, then the Finished state will still remain on the Editor page.

Advanced Settings:

2

Editor Page:

1

But the inscription Default is correctly attributed:

3

If you save without changing anything, the value of the Show answer field for the course will be set to Finished. And this problem is not only with this field. The same behavior for the Show reset option field.

Perhaps the problem is that the state is being used (frontend-lib-content-components/src/editors/data/redux/problem/reducers.js):

const initialState = {
  rawOLX: '',
  problemType: null,
  question: '',
  answers: [],
  correctAnswerCount: 0,
  groupFeedbackList: [],
  generalFeedback: '',
  additionalAttributes: {},
  defaultSettings: {},
  settings: {
    randomization: null,
    scoring: {
      weight: 1,
      attempts: {
        unlimited: true,
        number: '',
      },
    },
    hints: [],
    timeBetween: 0,
    showAnswer: {
      on: ShowAnswerTypesKeys.FINISHED,
      afterAttempts: 0,
    },
    showResetButton: false,
    solutionExplanation: '',
    tolerance: {
      value: null,
      type: ToleranceTypes.none.type,
    },
  },
};