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:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -234,6 +234,8 @@ export interface SubmitRequest {
|
||||
result: string
|
||||
// Флаг тестового режима: проверка без создания Submission и очереди
|
||||
isTest?: boolean
|
||||
// Временные скрытые инструкции для тестовой проверки (не сохраняются в задачу)
|
||||
hiddenInstructions?: string
|
||||
}
|
||||
|
||||
export interface TestSubmissionResult {
|
||||
|
||||
Reference in New Issue
Block a user