Add test submission feature for LLM checks without creating submissions; update API and UI components to support new functionality, enhancing task evaluation for teachers and challenge authors. Update localization for test check messages in English and Russian.

This commit is contained in:
2025-12-10 12:41:03 +03:00
parent 173954f685
commit ec79dd58aa
6 changed files with 408 additions and 0 deletions

View File

@@ -13,6 +13,9 @@ import type {
UpdateTaskRequest,
CreateChainRequest,
UpdateChainRequest,
SubmitRequest,
TestSubmissionResult,
APIResponse,
} from '../../types/challenge'
export const api = createApi({
@@ -141,6 +144,21 @@ export const api = createApi({
transformResponse: (response: { body: ChallengeSubmission[] }) => response.body,
providesTags: ['Submission'],
}),
// Test submission (LLM check without creating a real submission)
testSubmission: builder.mutation<TestSubmissionResult, SubmitRequest>({
query: ({ userId, taskId, result, isTest = true }) => ({
url: '/challenge/submit',
method: 'POST',
body: {
userId,
taskId,
result,
isTest,
},
}),
transformResponse: (response: APIResponse<TestSubmissionResult>) => response.data,
}),
}),
})
@@ -159,5 +177,6 @@ export const {
useGetSystemStatsV2Query,
useGetUserStatsQuery,
useGetUserSubmissionsQuery,
useTestSubmissionMutation,
} = api