Enhance test submission feature by adding optional hiddenInstructions field for temporary instructions during LLM checks; update API, UI components, and types to support this functionality, improving task evaluation for teachers and challenge authors.

This commit is contained in:
2025-12-10 14:50:17 +03:00
parent fb25422df1
commit 7b9cb044fa
4 changed files with 18 additions and 12 deletions

View File

@@ -147,7 +147,7 @@ export const api = createApi({
// Test submission (LLM check without creating a real submission)
testSubmission: builder.mutation<TestSubmissionResult, SubmitRequest>({
query: ({ userId, taskId, result, isTest = true }) => ({
query: ({ userId, taskId, result, isTest = true, hiddenInstructions }) => ({
url: '/challenge/submit',
method: 'POST',
body: {
@@ -155,6 +155,7 @@ export const api = createApi({
taskId,
result,
isTest,
hiddenInstructions,
},
}),
transformResponse: (response: APIResponse<TestSubmissionResult>) => response.data,

View File

@@ -136,6 +136,7 @@ export const TaskFormPage: React.FC = () => {
taskId: task.id,
result: testAnswer.trim(),
isTest: true,
hiddenInstructions: hiddenInstructions.trim() || undefined,
}).unwrap()
setTestStatus(result.status)

View File

@@ -234,6 +234,8 @@ export interface SubmitRequest {
result: string
// Флаг тестового режима: проверка без создания Submission и очереди
isTest?: boolean
// Временные скрытые инструкции для тестовой проверки (не сохраняются в задачу)
hiddenInstructions?: string
}
export interface TestSubmissionResult {