diff --git a/src/editors/data/constants/problem.ts b/src/editors/data/constants/problem.ts index c8c8dfb61..a0be26389 100644 --- a/src/editors/data/constants/problem.ts +++ b/src/editors/data/constants/problem.ts @@ -371,6 +371,8 @@ export const GradingMethodKeys = StrictDict({ FIRST_SCORE: 'first_score', }); +export type GradingMethodKey = typeof GradingMethodKeys[keyof typeof GradingMethodKeys]; + export const GradingMethod = StrictDict({ [GradingMethodKeys.LAST_SCORE]: { id: 'authoring.problemeditor.settings.gradingmethod.last_score', diff --git a/src/editors/data/redux/index.ts b/src/editors/data/redux/index.ts index 52057abfb..195b63606 100644 --- a/src/editors/data/redux/index.ts +++ b/src/editors/data/redux/index.ts @@ -9,7 +9,7 @@ import * as video from './video'; import * as problem from './problem'; import * as game from './game'; import type { RequestKeys, RequestStates } from '../constants/requests'; -import { AdvancedProblemType, GradingMethodKeys, ProblemType } from '../constants/problem'; +import { AdvancedProblemType, type GradingMethodKey, ProblemType } from '../constants/problem'; export { default as thunkActions } from './thunkActions'; @@ -176,7 +176,7 @@ export interface EditorState { scoring: { weight: number; attempts: { unlimited: boolean; number: number | null; }; - gradingMethod: GradingMethodKeys.LAST_SCORE; + gradingMethod: GradingMethodKey; }, hints: any[]; timeBetween: number;