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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user