From 5e5c92f48779f5d82198de9760ba4041d3d405ee Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 8 Jan 2026 11:54:06 +0500 Subject: [PATCH] fix: type error --- src/editors/data/constants/problem.ts | 2 ++ src/editors/data/redux/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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;