feat(api): add candidate assessment attempt contract
This commit is contained in:
1 parent
6c86c4e559
commit
565ef8d4f5
100 files changed
+30314
-74
No files matched your search
@@ -0,0 +1,113 @@
|
||||
import { describe, expect, expectTypeOf, it } from "vitest";
|
||||
import { submitMyAssessmentAnswer } from "./endpoints/assessment/assessment";
|
||||
import {
|
||||
AssessmentAnswerSubmission,
|
||||
AssessmentItem,
|
||||
ItemContent,
|
||||
SubmitMyAssessmentAnswerBody,
|
||||
} from "./schemas";
|
||||
|
||||
// These tests pin the generated assessment contract that the FSD adapters
|
||||
// consume. They fail when regeneration drops an answer format or adds a field
|
||||
// that would carry a score, a key, or a seed between the client and the server.
|
||||
|
||||
const itemId = "01928f7a-4a10-7b2c-9d3e-5f6a7b8c9d01";
|
||||
|
||||
const answers = {
|
||||
choice: { format: "choice", option_ids: ["x9"] },
|
||||
number: { format: "number", number: 254 },
|
||||
string: { format: "string", text: "Retry-After" },
|
||||
order: { format: "order", element_ids: ["a7", "b1", "c2", "d3"] },
|
||||
find_error: { format: "find_error", line_numbers: [5] },
|
||||
configuration: { format: "configuration", config: "interface Gi0/1" },
|
||||
practice: { format: "practice", language: "python", source_code: "print(1)" },
|
||||
} as const;
|
||||
|
||||
const bodySchemas = [
|
||||
["AssessmentAnswerSubmission", AssessmentAnswerSubmission],
|
||||
["SubmitMyAssessmentAnswerBody", SubmitMyAssessmentAnswerBody],
|
||||
] as const;
|
||||
|
||||
describe.each(bodySchemas)("generated %s", (_name, schema) => {
|
||||
it.each(Object.entries(answers))("accepts a %s answer", (format, answer) => {
|
||||
const parsed = schema.parse({ expected_version: 1, item_id: itemId, answer });
|
||||
|
||||
expect(parsed.answer.format).toBe(format);
|
||||
});
|
||||
|
||||
it("rejects an unknown answer format", () => {
|
||||
const result = schema.safeParse({
|
||||
expected_version: 1,
|
||||
item_id: itemId,
|
||||
answer: { format: "essay", text: "..." },
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects version 0, which no attempt has", () => {
|
||||
const result = schema.safeParse({
|
||||
expected_version: 0,
|
||||
item_id: itemId,
|
||||
answer: answers.choice,
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error?.issues).toEqual([expect.objectContaining({ path: ["expected_version"] })]);
|
||||
});
|
||||
|
||||
it("never carries a client score or seed in the parsed body", () => {
|
||||
const parsed = schema.parse({
|
||||
expected_version: 1,
|
||||
item_id: itemId,
|
||||
score: 1,
|
||||
answer: { ...answers.practice, seed: 42 },
|
||||
});
|
||||
|
||||
// Generated Zod strips unknown keys; the server rejects them with 400.
|
||||
expect(parsed).not.toHaveProperty("score");
|
||||
expect(parsed.answer).not.toHaveProperty("seed");
|
||||
});
|
||||
});
|
||||
|
||||
it("parses a practice item without hidden checks", () => {
|
||||
const parsed = AssessmentItem.parse({
|
||||
id: itemId,
|
||||
sequence: 15,
|
||||
prompt: "Реализуйте функцию merge_intervals.",
|
||||
content: {
|
||||
format: "practice",
|
||||
languages: ["python"],
|
||||
max_source_length: 20000,
|
||||
public_examples: [{ input: "[[1,3],[2,6]]", expected_output: "[[1,6]]" }],
|
||||
hidden_tests: [{ input: "secret" }],
|
||||
},
|
||||
});
|
||||
|
||||
expect(parsed.content.format).toBe("practice");
|
||||
expect(parsed.content).not.toHaveProperty("hidden_tests");
|
||||
});
|
||||
|
||||
// Every key of every variant of a union.
|
||||
type KeysOf<T> = T extends unknown ? keyof T : never;
|
||||
type ForbiddenKey =
|
||||
| "score"
|
||||
| "points"
|
||||
| "seed"
|
||||
| "key"
|
||||
| "answer_key"
|
||||
| "correct"
|
||||
| "is_correct"
|
||||
| "correct_option_ids"
|
||||
| "hidden_tests"
|
||||
| "family_id";
|
||||
|
||||
it("exposes answer and item DTOs without scores, keys, seeds, or correctness", () => {
|
||||
expectTypeOf<Extract<KeysOf<AssessmentAnswerSubmission>, ForbiddenKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<
|
||||
Extract<KeysOf<AssessmentAnswerSubmission["answer"]>, ForbiddenKey>
|
||||
>().toEqualTypeOf<never>();
|
||||
expectTypeOf<Extract<KeysOf<AssessmentItem>, ForbiddenKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<Extract<KeysOf<ItemContent>, ForbiddenKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf(submitMyAssessmentAnswer).parameter(1).toEqualTypeOf<AssessmentAnswerSubmission>();
|
||||
});
|
||||
@@ -0,0 +1,230 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
faker
|
||||
} from '@faker-js/faker';
|
||||
|
||||
import {
|
||||
HttpResponse,
|
||||
http
|
||||
} from 'msw';
|
||||
import type {
|
||||
RequestHandlerOptions
|
||||
} from 'msw';
|
||||
|
||||
import {
|
||||
AssessmentAttemptState,
|
||||
AssessmentGradeAvailabilityStatus,
|
||||
AssessmentLimitation,
|
||||
AssessmentMode,
|
||||
AssessmentNextAction,
|
||||
AssessmentNotDeterminedReason,
|
||||
AssessmentOutcome,
|
||||
AssessmentStrength,
|
||||
CalibrationStatus,
|
||||
GradeCode,
|
||||
PracticeFailureReason,
|
||||
PracticeKind,
|
||||
PracticeStatus,
|
||||
SpecializationCode,
|
||||
TaskLanguage
|
||||
} from '../../schemas';
|
||||
import type {
|
||||
AssessmentAttempt,
|
||||
AssessmentAvailability,
|
||||
AssessmentItem,
|
||||
AssessmentResult,
|
||||
AssessmentSessions,
|
||||
AssessmentUncertainty,
|
||||
BasicScore,
|
||||
ChoiceItemContent,
|
||||
ConfigurationItemContent,
|
||||
FindErrorItemContent,
|
||||
NumberItemContent,
|
||||
OrderItemContent,
|
||||
PracticeItemContent,
|
||||
PracticeVerdict,
|
||||
StringItemContent
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getGetMyAssessmentAvailabilityResponseMock = (overrideResponse: Partial<Extract<AssessmentAvailability, object>> = {}): AssessmentAvailability => ({specializations: Array.from({ length: faker.number.int({min: 1, max: 2}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(GradeCode)),null,]), active_attempt_id: faker.helpers.arrayElement([faker.string.uuid(), null]), grades: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({grade: faker.helpers.arrayElement(Object.values(GradeCode)), status: faker.helpers.arrayElement(Object.values(AssessmentGradeAvailabilityStatus)), mode: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(AssessmentMode)),null,]), available_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), time_limit_seconds: faker.helpers.arrayElement([faker.number.int({min: 1}), null]), max_sessions: faker.helpers.arrayElement([faker.number.int({min: 1, max: 10}), null]), max_items: faker.helpers.arrayElement([faker.number.int({min: 1, max: 100}), null]), practice_required: faker.helpers.arrayElement([faker.datatype.boolean(), null])}))})), ...overrideResponse})
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseNumberItemContentMock = (overrideResponse: Partial<NumberItemContent> = {}): NumberItemContent => ({...{format: faker.helpers.arrayElement(['number'] as const), unit: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 32}}), null])}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseStringItemContentMock = (overrideResponse: Partial<StringItemContent> = {}): StringItemContent => ({...{format: faker.helpers.arrayElement(['string'] as const), max_length: faker.number.int({min: 1, max: 500})}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseOrderItemContentMock = (overrideResponse: Partial<OrderItemContent> = {}): OrderItemContent => ({...{format: faker.helpers.arrayElement(['order'] as const), elements: Array.from({ length: faker.number.int({min: 2, max: 20}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})}))}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseFindErrorItemContentMock = (overrideResponse: Partial<FindErrorItemContent> = {}): FindErrorItemContent => ({...{format: faker.helpers.arrayElement(['find_error'] as const), syntax: faker.helpers.arrayElement([faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), null]), lines: Array.from({ length: faker.number.int({min: 1, max: 500}) }, (_, i) => i + 1).map(() => ({number: faker.number.int({min: 1, max: 500}), text: faker.string.alpha({length: {min: 10, max: 1000}})})), max_selections: faker.number.int({min: 1, max: 10})}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseConfigurationItemContentMock = (overrideResponse: Partial<ConfigurationItemContent> = {}): ConfigurationItemContent => ({...{format: faker.helpers.arrayElement(['configuration'] as const), syntax: faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), initial_config: faker.string.alpha({length: {min: 10, max: 20000}}), max_length: faker.number.int({min: 1, max: 20000})}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponsePracticeItemContentMock = (overrideResponse: Partial<PracticeItemContent> = {}): PracticeItemContent => ({...{format: faker.helpers.arrayElement(['practice'] as const), languages: faker.helpers.arrayElements(Object.values(TaskLanguage)), public_examples: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({input: faker.string.alpha({length: {min: 10, max: 10000}}), expected_output: faker.string.alpha({length: {min: 10, max: 10000}})})), max_source_length: faker.number.int({min: 1, max: 65536})}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseAssessmentItemMock = (overrideResponse: Partial<AssessmentItem> = {}): AssessmentItem => ({...{id: faker.string.uuid(), sequence: faker.number.int({min: 1, max: 100}), prompt: faker.string.alpha({length: {min: 1, max: 20000}}), content: faker.helpers.arrayElement([{...getCreateMyAssessmentAttemptResponseChoiceItemContentMock()},{...getCreateMyAssessmentAttemptResponseNumberItemContentMock()},{...getCreateMyAssessmentAttemptResponseStringItemContentMock()},{...getCreateMyAssessmentAttemptResponseOrderItemContentMock()},{...getCreateMyAssessmentAttemptResponseFindErrorItemContentMock()},{...getCreateMyAssessmentAttemptResponseConfigurationItemContentMock()},{...getCreateMyAssessmentAttemptResponsePracticeItemContentMock()},])}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponsePracticeVerdictMock = (overrideResponse: Partial<PracticeVerdict> = {}): PracticeVerdict => ({...{score: faker.number.int({min: 0, max: 3}), max_score: faker.number.int({min: 3, max: 3}), groups: Array.from({ length: faker.number.int({min: 3, max: 3}) }, (_, i) => i + 1).map(() => ({group: faker.number.int({min: 1, max: 3}), passed: faker.datatype.boolean()}))}, ...overrideResponse});
|
||||
|
||||
export const getCreateMyAssessmentAttemptResponseMock = (overrideResponse: Partial<Extract<AssessmentAttempt, object>> = {}): AssessmentAttempt => ({id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), target_grade: faker.helpers.arrayElement(Object.values(GradeCode)), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(TaskLanguage)),null,]), mode: faker.helpers.arrayElement(Object.values(AssessmentMode)), state: faker.helpers.arrayElement(Object.values(AssessmentAttemptState)), versions: {policy_version: faker.number.int({min: 1}), bank_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$"), algorithm_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$")}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getCreateMyAssessmentAttemptResponseAssessmentSessionsMock()},null,]), finished_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), progress: {answered_items: faker.number.int({min: 0, max: 100}), max_items: faker.number.int({min: 1, max: 100})}, current_item: faker.helpers.arrayElement([{...getCreateMyAssessmentAttemptResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(Object.values(PracticeKind)), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(Object.values(PracticeStatus)), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getCreateMyAssessmentAttemptResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(PracticeFailureReason)),null,])})), ...overrideResponse})
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseNumberItemContentMock = (overrideResponse: Partial<NumberItemContent> = {}): NumberItemContent => ({...{format: faker.helpers.arrayElement(['number'] as const), unit: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 32}}), null])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseStringItemContentMock = (overrideResponse: Partial<StringItemContent> = {}): StringItemContent => ({...{format: faker.helpers.arrayElement(['string'] as const), max_length: faker.number.int({min: 1, max: 500})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseOrderItemContentMock = (overrideResponse: Partial<OrderItemContent> = {}): OrderItemContent => ({...{format: faker.helpers.arrayElement(['order'] as const), elements: Array.from({ length: faker.number.int({min: 2, max: 20}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})}))}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseFindErrorItemContentMock = (overrideResponse: Partial<FindErrorItemContent> = {}): FindErrorItemContent => ({...{format: faker.helpers.arrayElement(['find_error'] as const), syntax: faker.helpers.arrayElement([faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), null]), lines: Array.from({ length: faker.number.int({min: 1, max: 500}) }, (_, i) => i + 1).map(() => ({number: faker.number.int({min: 1, max: 500}), text: faker.string.alpha({length: {min: 10, max: 1000}})})), max_selections: faker.number.int({min: 1, max: 10})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseConfigurationItemContentMock = (overrideResponse: Partial<ConfigurationItemContent> = {}): ConfigurationItemContent => ({...{format: faker.helpers.arrayElement(['configuration'] as const), syntax: faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), initial_config: faker.string.alpha({length: {min: 10, max: 20000}}), max_length: faker.number.int({min: 1, max: 20000})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponsePracticeItemContentMock = (overrideResponse: Partial<PracticeItemContent> = {}): PracticeItemContent => ({...{format: faker.helpers.arrayElement(['practice'] as const), languages: faker.helpers.arrayElements(Object.values(TaskLanguage)), public_examples: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({input: faker.string.alpha({length: {min: 10, max: 10000}}), expected_output: faker.string.alpha({length: {min: 10, max: 10000}})})), max_source_length: faker.number.int({min: 1, max: 65536})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseAssessmentItemMock = (overrideResponse: Partial<AssessmentItem> = {}): AssessmentItem => ({...{id: faker.string.uuid(), sequence: faker.number.int({min: 1, max: 100}), prompt: faker.string.alpha({length: {min: 1, max: 20000}}), content: faker.helpers.arrayElement([{...getGetMyAssessmentAttemptResponseChoiceItemContentMock()},{...getGetMyAssessmentAttemptResponseNumberItemContentMock()},{...getGetMyAssessmentAttemptResponseStringItemContentMock()},{...getGetMyAssessmentAttemptResponseOrderItemContentMock()},{...getGetMyAssessmentAttemptResponseFindErrorItemContentMock()},{...getGetMyAssessmentAttemptResponseConfigurationItemContentMock()},{...getGetMyAssessmentAttemptResponsePracticeItemContentMock()},])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponsePracticeVerdictMock = (overrideResponse: Partial<PracticeVerdict> = {}): PracticeVerdict => ({...{score: faker.number.int({min: 0, max: 3}), max_score: faker.number.int({min: 3, max: 3}), groups: Array.from({ length: faker.number.int({min: 3, max: 3}) }, (_, i) => i + 1).map(() => ({group: faker.number.int({min: 1, max: 3}), passed: faker.datatype.boolean()}))}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentAttemptResponseMock = (overrideResponse: Partial<Extract<AssessmentAttempt, object>> = {}): AssessmentAttempt => ({id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), target_grade: faker.helpers.arrayElement(Object.values(GradeCode)), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(TaskLanguage)),null,]), mode: faker.helpers.arrayElement(Object.values(AssessmentMode)), state: faker.helpers.arrayElement(Object.values(AssessmentAttemptState)), versions: {policy_version: faker.number.int({min: 1}), bank_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$"), algorithm_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$")}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getGetMyAssessmentAttemptResponseAssessmentSessionsMock()},null,]), finished_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), progress: {answered_items: faker.number.int({min: 0, max: 100}), max_items: faker.number.int({min: 1, max: 100})}, current_item: faker.helpers.arrayElement([{...getGetMyAssessmentAttemptResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(Object.values(PracticeKind)), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(Object.values(PracticeStatus)), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getGetMyAssessmentAttemptResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(PracticeFailureReason)),null,])})), ...overrideResponse})
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseNumberItemContentMock = (overrideResponse: Partial<NumberItemContent> = {}): NumberItemContent => ({...{format: faker.helpers.arrayElement(['number'] as const), unit: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 32}}), null])}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseStringItemContentMock = (overrideResponse: Partial<StringItemContent> = {}): StringItemContent => ({...{format: faker.helpers.arrayElement(['string'] as const), max_length: faker.number.int({min: 1, max: 500})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseOrderItemContentMock = (overrideResponse: Partial<OrderItemContent> = {}): OrderItemContent => ({...{format: faker.helpers.arrayElement(['order'] as const), elements: Array.from({ length: faker.number.int({min: 2, max: 20}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})}))}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseFindErrorItemContentMock = (overrideResponse: Partial<FindErrorItemContent> = {}): FindErrorItemContent => ({...{format: faker.helpers.arrayElement(['find_error'] as const), syntax: faker.helpers.arrayElement([faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), null]), lines: Array.from({ length: faker.number.int({min: 1, max: 500}) }, (_, i) => i + 1).map(() => ({number: faker.number.int({min: 1, max: 500}), text: faker.string.alpha({length: {min: 10, max: 1000}})})), max_selections: faker.number.int({min: 1, max: 10})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseConfigurationItemContentMock = (overrideResponse: Partial<ConfigurationItemContent> = {}): ConfigurationItemContent => ({...{format: faker.helpers.arrayElement(['configuration'] as const), syntax: faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), initial_config: faker.string.alpha({length: {min: 10, max: 20000}}), max_length: faker.number.int({min: 1, max: 20000})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponsePracticeItemContentMock = (overrideResponse: Partial<PracticeItemContent> = {}): PracticeItemContent => ({...{format: faker.helpers.arrayElement(['practice'] as const), languages: faker.helpers.arrayElements(Object.values(TaskLanguage)), public_examples: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({input: faker.string.alpha({length: {min: 10, max: 10000}}), expected_output: faker.string.alpha({length: {min: 10, max: 10000}})})), max_source_length: faker.number.int({min: 1, max: 65536})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseAssessmentItemMock = (overrideResponse: Partial<AssessmentItem> = {}): AssessmentItem => ({...{id: faker.string.uuid(), sequence: faker.number.int({min: 1, max: 100}), prompt: faker.string.alpha({length: {min: 1, max: 20000}}), content: faker.helpers.arrayElement([{...getSubmitMyAssessmentAnswerResponseChoiceItemContentMock()},{...getSubmitMyAssessmentAnswerResponseNumberItemContentMock()},{...getSubmitMyAssessmentAnswerResponseStringItemContentMock()},{...getSubmitMyAssessmentAnswerResponseOrderItemContentMock()},{...getSubmitMyAssessmentAnswerResponseFindErrorItemContentMock()},{...getSubmitMyAssessmentAnswerResponseConfigurationItemContentMock()},{...getSubmitMyAssessmentAnswerResponsePracticeItemContentMock()},])}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponsePracticeVerdictMock = (overrideResponse: Partial<PracticeVerdict> = {}): PracticeVerdict => ({...{score: faker.number.int({min: 0, max: 3}), max_score: faker.number.int({min: 3, max: 3}), groups: Array.from({ length: faker.number.int({min: 3, max: 3}) }, (_, i) => i + 1).map(() => ({group: faker.number.int({min: 1, max: 3}), passed: faker.datatype.boolean()}))}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseMock = (overrideResponse: Partial<Extract<AssessmentAttempt, object>> = {}): AssessmentAttempt => ({id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), target_grade: faker.helpers.arrayElement(Object.values(GradeCode)), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(TaskLanguage)),null,]), mode: faker.helpers.arrayElement(Object.values(AssessmentMode)), state: faker.helpers.arrayElement(Object.values(AssessmentAttemptState)), versions: {policy_version: faker.number.int({min: 1}), bank_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$"), algorithm_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$")}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getSubmitMyAssessmentAnswerResponseAssessmentSessionsMock()},null,]), finished_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), progress: {answered_items: faker.number.int({min: 0, max: 100}), max_items: faker.number.int({min: 1, max: 100})}, current_item: faker.helpers.arrayElement([{...getSubmitMyAssessmentAnswerResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(Object.values(PracticeKind)), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(Object.values(PracticeStatus)), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getSubmitMyAssessmentAnswerResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(PracticeFailureReason)),null,])})), ...overrideResponse})
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseNumberItemContentMock = (overrideResponse: Partial<NumberItemContent> = {}): NumberItemContent => ({...{format: faker.helpers.arrayElement(['number'] as const), unit: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 32}}), null])}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseStringItemContentMock = (overrideResponse: Partial<StringItemContent> = {}): StringItemContent => ({...{format: faker.helpers.arrayElement(['string'] as const), max_length: faker.number.int({min: 1, max: 500})}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseOrderItemContentMock = (overrideResponse: Partial<OrderItemContent> = {}): OrderItemContent => ({...{format: faker.helpers.arrayElement(['order'] as const), elements: Array.from({ length: faker.number.int({min: 2, max: 20}) }, (_, i) => i + 1).map(() => ({id: faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), text: faker.string.alpha({length: {min: 1, max: 2000}})}))}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseFindErrorItemContentMock = (overrideResponse: Partial<FindErrorItemContent> = {}): FindErrorItemContent => ({...{format: faker.helpers.arrayElement(['find_error'] as const), syntax: faker.helpers.arrayElement([faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), null]), lines: Array.from({ length: faker.number.int({min: 1, max: 500}) }, (_, i) => i + 1).map(() => ({number: faker.number.int({min: 1, max: 500}), text: faker.string.alpha({length: {min: 10, max: 1000}})})), max_selections: faker.number.int({min: 1, max: 10})}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseConfigurationItemContentMock = (overrideResponse: Partial<ConfigurationItemContent> = {}): ConfigurationItemContent => ({...{format: faker.helpers.arrayElement(['configuration'] as const), syntax: faker.helpers.fromRegExp("^[a-z0-9_+-]+$"), initial_config: faker.string.alpha({length: {min: 10, max: 20000}}), max_length: faker.number.int({min: 1, max: 20000})}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponsePracticeItemContentMock = (overrideResponse: Partial<PracticeItemContent> = {}): PracticeItemContent => ({...{format: faker.helpers.arrayElement(['practice'] as const), languages: faker.helpers.arrayElements(Object.values(TaskLanguage)), public_examples: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({input: faker.string.alpha({length: {min: 10, max: 10000}}), expected_output: faker.string.alpha({length: {min: 10, max: 10000}})})), max_source_length: faker.number.int({min: 1, max: 65536})}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseAssessmentItemMock = (overrideResponse: Partial<AssessmentItem> = {}): AssessmentItem => ({...{id: faker.string.uuid(), sequence: faker.number.int({min: 1, max: 100}), prompt: faker.string.alpha({length: {min: 1, max: 20000}}), content: faker.helpers.arrayElement([{...getFinalizeMyAssessmentAttemptResponseChoiceItemContentMock()},{...getFinalizeMyAssessmentAttemptResponseNumberItemContentMock()},{...getFinalizeMyAssessmentAttemptResponseStringItemContentMock()},{...getFinalizeMyAssessmentAttemptResponseOrderItemContentMock()},{...getFinalizeMyAssessmentAttemptResponseFindErrorItemContentMock()},{...getFinalizeMyAssessmentAttemptResponseConfigurationItemContentMock()},{...getFinalizeMyAssessmentAttemptResponsePracticeItemContentMock()},])}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponsePracticeVerdictMock = (overrideResponse: Partial<PracticeVerdict> = {}): PracticeVerdict => ({...{score: faker.number.int({min: 0, max: 3}), max_score: faker.number.int({min: 3, max: 3}), groups: Array.from({ length: faker.number.int({min: 3, max: 3}) }, (_, i) => i + 1).map(() => ({group: faker.number.int({min: 1, max: 3}), passed: faker.datatype.boolean()}))}, ...overrideResponse});
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptResponseMock = (overrideResponse: Partial<Extract<AssessmentAttempt, object>> = {}): AssessmentAttempt => ({id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), target_grade: faker.helpers.arrayElement(Object.values(GradeCode)), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(TaskLanguage)),null,]), mode: faker.helpers.arrayElement(Object.values(AssessmentMode)), state: faker.helpers.arrayElement(Object.values(AssessmentAttemptState)), versions: {policy_version: faker.number.int({min: 1}), bank_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$"), algorithm_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$")}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getFinalizeMyAssessmentAttemptResponseAssessmentSessionsMock()},null,]), finished_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), progress: {answered_items: faker.number.int({min: 0, max: 100}), max_items: faker.number.int({min: 1, max: 100})}, current_item: faker.helpers.arrayElement([{...getFinalizeMyAssessmentAttemptResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(Object.values(PracticeKind)), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(Object.values(PracticeStatus)), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getFinalizeMyAssessmentAttemptResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(PracticeFailureReason)),null,])})), ...overrideResponse})
|
||||
|
||||
export const getGetMyAssessmentResultResponseAssessmentUncertaintyMock = (overrideResponse: Partial<AssessmentUncertainty> = {}): AssessmentUncertainty => ({...{theta: faker.number.float({fractionDigits: 2}), standard_error: faker.number.float({min: 0, fractionDigits: 2}), interval_95: {low: faker.number.float({fractionDigits: 2}), high: faker.number.float({fractionDigits: 2})}, p_grade: faker.number.float({min: 0, max: 1, fractionDigits: 2})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentResultResponseBasicScoreMock = (overrideResponse: Partial<BasicScore> = {}): BasicScore => ({...{points: faker.number.int({min: 0}), max_points: faker.number.int({min: 1}), pass_points: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyAssessmentResultResponseMock = (overrideResponse: Partial<Extract<AssessmentResult, object>> = {}): AssessmentResult => ({attempt_id: faker.string.uuid(), specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), target_grade: faker.helpers.arrayElement(Object.values(GradeCode)), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(TaskLanguage)),null,]), mode: faker.helpers.arrayElement(Object.values(AssessmentMode)), versions: {policy_version: faker.number.int({min: 1}), bank_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$"), algorithm_version: faker.helpers.fromRegExp("^[A-Za-z0-9._-]+$")}, outcome: faker.helpers.arrayElement(Object.values(AssessmentOutcome)), not_determined_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(AssessmentNotDeterminedReason)),null,]), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(GradeCode)),null,]), previous_confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(GradeCode)),null,]), strength: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(AssessmentStrength)),null,]), calibration_status: faker.helpers.arrayElement(Object.values(CalibrationStatus)), limitations: faker.helpers.arrayElements(Object.values(AssessmentLimitation)), uncertainty: faker.helpers.arrayElement([{...getGetMyAssessmentResultResponseAssessmentUncertaintyMock()},null,]), basic_score: faker.helpers.arrayElement([{...getGetMyAssessmentResultResponseBasicScoreMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(Object.values(PracticeKind)), verdict: {score: faker.number.int({min: 0, max: 3}), max_score: faker.number.int({min: 3, max: 3}), groups: Array.from({ length: faker.number.int({min: 3, max: 3}) }, (_, i) => i + 1).map(() => ({group: faker.number.int({min: 1, max: 3}), passed: faker.datatype.boolean()}))}})), gaps: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => ({domain: faker.helpers.fromRegExp("^[a-z0-9_]+$"), title: faker.string.alpha({length: {min: 1, max: 200}})})), durations: {items_seconds: faker.number.int({min: 0}), practice_seconds: faker.helpers.arrayElement([faker.number.int({min: 0}), null])}, next_steps: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({action: faker.helpers.arrayElement(Object.values(AssessmentNextAction)), grade: faker.helpers.arrayElement(Object.values(GradeCode)), available_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])})), decided_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
|
||||
export const getGetMyAssessmentAvailabilityMockHandler = (overrideResponse?: AssessmentAvailability | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<AssessmentAvailability> | AssessmentAvailability), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/assessment-availability', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyAssessmentAvailabilityResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getCreateMyAssessmentAttemptMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getCreateMyAssessmentAttemptResponseMock(),
|
||||
{ status: 201
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetMyAssessmentAttemptMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/assessment-attempts/:attemptId', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyAssessmentAttemptResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSubmitMyAssessmentAnswerMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts/:attemptId/answers', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getSubmitMyAssessmentAnswerResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts/:attemptId/finalize', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getFinalizeMyAssessmentAttemptResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetMyAssessmentResultMockHandler = (overrideResponse?: AssessmentResult | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<AssessmentResult> | AssessmentResult), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/assessment-attempts/:attemptId/result', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyAssessmentResultResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
export const getAssessmentMock = () => [
|
||||
getGetMyAssessmentAvailabilityMockHandler(),
|
||||
getCreateMyAssessmentAttemptMockHandler(),
|
||||
getGetMyAssessmentAttemptMockHandler(),
|
||||
getSubmitMyAssessmentAnswerMockHandler(),
|
||||
getFinalizeMyAssessmentAttemptMockHandler(),
|
||||
getGetMyAssessmentResultMockHandler()
|
||||
]
|
||||
@@ -0,0 +1,678 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
MutationFunction,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
AssessmentAnswerSubmission,
|
||||
AssessmentAttempt,
|
||||
AssessmentAttemptCreate,
|
||||
AssessmentAvailability,
|
||||
AssessmentFinalization,
|
||||
AssessmentResult,
|
||||
CreateMyAssessmentAttemptHeaders,
|
||||
FinalizeMyAssessmentAttemptHeaders,
|
||||
Problem,
|
||||
SubmitMyAssessmentAnswerHeaders
|
||||
} from '../../schemas';
|
||||
|
||||
import { apiRequest } from '../../client';
|
||||
import type { ErrorType } from '../../client';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {
|
||||
const result = { queryKey } as T & { queryKey: K };
|
||||
for (const key of Object.keys(query)) {
|
||||
// The explicit queryKey always wins, matching the previous
|
||||
// `{ ...query, queryKey }` spread where it was set last.
|
||||
if (key === 'queryKey') continue;
|
||||
Object.defineProperty(result, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: () => (query as Record<string, unknown>)[key],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getGetMyAssessmentAvailabilityUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-availability`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account; the candidate comes from the session. For each specialization of the questionnaire, returns the confirmed grade, the active attempt, and for every grade whether an attempt can start now, in which mode, and with which limits: the time limit, the session limit, the item limit, and whether a code practice is required. The client shows them before the start, together with the method and the signals that are collected, and resumes an active attempt by `active_attempt_id`, for example after it lost the response of CreateMyAssessmentAttempt.
|
||||
*
|
||||
* `insufficient_bank` is the state of a category whose bank is not published or has too few families that this candidate has not seen; the server limits attempts instead of repeating families. `cooldown` carries the date when the attempt opens, so the client can explain a blocked attempt with that date and offer support. Specializations and their retry intervals are independent. Attempts that ended as `insufficient_bank` or with the reason `sandbox_unavailable` are platform limitations and never cause a `cooldown`.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
* @summary Read which assessment attempts the current candidate can start.
|
||||
*/
|
||||
export const getMyAssessmentAvailability = async ( options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentAvailability> => {
|
||||
|
||||
return apiRequest<AssessmentAvailability>(getGetMyAssessmentAvailabilityUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyAssessmentAvailabilityQueryKey = () => {
|
||||
return [
|
||||
`/api/v1/me/assessment-availability`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMyAssessmentAvailabilityQueryOptions = <TData = Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError = ErrorType<Problem>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMyAssessmentAvailabilityQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyAssessmentAvailability>>> = ({ signal }) => getMyAssessmentAvailability({ signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMyAssessmentAvailabilityQueryResult = NonNullable<Awaited<ReturnType<typeof getMyAssessmentAvailability>>>
|
||||
export type GetMyAssessmentAvailabilityQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMyAssessmentAvailability<TData = Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError = ErrorType<Problem>>(
|
||||
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentAvailability>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentAvailability>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentAvailability<TData = Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentAvailability>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentAvailability>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentAvailability<TData = Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read which assessment attempts the current candidate can start.
|
||||
*/
|
||||
|
||||
export function useGetMyAssessmentAvailability<TData = Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError = ErrorType<Problem>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAvailability>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMyAssessmentAvailabilityQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getCreateMyAssessmentAttemptUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The body names the category, a specialization of the questionnaire and a target grade, and the task language. The server picks the mode from the published bank, `demo_basic` or `adaptive`, and fixes the policy, bank, and algorithm versions, the time and session limits, and the item variants in one transaction; the client never sends a mode, a seed, or a version. Creation starts session 1. The self-assessed grade only chooses where the test starts and adds no points. An adaptive retest starts from the previous ability estimate of the specialization, adjusted for the time passed, so a new attempt adds evidence instead of starting the measurement over.
|
||||
*
|
||||
* A specialization has at most one active attempt. A new attempt cannot start while one is active, during a retry or promotion interval or past the attempt limit of the policy, or when the bank is insufficient; each answers 409 state_conflict and creates nothing, not even a placeholder attempt. GetMyAssessmentAvailability tells which case applies and when a blocked attempt opens. After a failure, including the first test, a lower grade can be tested at once. An attempt that ends as `expired` or with the reason `practice_incomplete` counts toward the attempt limit and starts the same-grade retry interval; one that ends as `insufficient_bank` or with the reason `sandbox_unavailable` counts toward neither.
|
||||
*
|
||||
* The limits are server-side: `expires_at` and `sessions` come from the policy version, the client clock never extends them, and after them the attempt accepts no command. Within them the attempt is also bounded by the item limit of the policy.
|
||||
*
|
||||
* Idempotency: a retry with the same key and body within 24 hours replays the stored 201 or 409 state_conflict response and creates nothing, so a lost response never creates a second attempt. A different body with the same key answers 422 idempotency_key_reused. 400 is never stored, so a corrected retry is evaluated again.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), the Idempotency-Key (422, 409 idempotency_in_progress, replay), domain rules (400 with a pointer, for example `/specialization` for a specialization that is not in the questionnaire or `/task_language` for a language that the bank does not offer), then availability (409 state_conflict). The rate limit can answer 429 with Retry-After before any of them; it is not stored.
|
||||
* @summary Start an assessment attempt for a category of the current candidate.
|
||||
*/
|
||||
export const createMyAssessmentAttempt = async (assessmentAttemptCreate: AssessmentAttemptCreate,
|
||||
headers: CreateMyAssessmentAttemptHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentAttempt> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<AssessmentAttempt>(getCreateMyAssessmentAttemptUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json',...headers, ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(assessmentAttemptCreate)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getCreateMyAssessmentAttemptMutationKey = () => ['createMyAssessmentAttempt'] as const;
|
||||
|
||||
export const getCreateMyAssessmentAttemptMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createMyAssessmentAttempt>>, TError,CreateMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof createMyAssessmentAttempt>>, TError,CreateMyAssessmentAttemptMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getCreateMyAssessmentAttemptMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createMyAssessmentAttempt>>, CreateMyAssessmentAttemptMutationVariables> = (props) => {
|
||||
const {data,headers} = props ?? {};
|
||||
|
||||
return createMyAssessmentAttempt(data,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CreateMyAssessmentAttemptMutationResult = NonNullable<Awaited<ReturnType<typeof createMyAssessmentAttempt>>>
|
||||
export type CreateMyAssessmentAttemptMutationBody = AssessmentAttemptCreate
|
||||
export type CreateMyAssessmentAttemptMutationError = ErrorType<Problem>
|
||||
export type CreateMyAssessmentAttemptMutationVariables = {data: AssessmentAttemptCreate;headers: CreateMyAssessmentAttemptHeaders}
|
||||
|
||||
/**
|
||||
* @summary Start an assessment attempt for a category of the current candidate.
|
||||
*/
|
||||
export const useCreateMyAssessmentAttempt = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createMyAssessmentAttempt>>, TError,CreateMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createMyAssessmentAttempt>>,
|
||||
TError,
|
||||
CreateMyAssessmentAttemptMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getCreateMyAssessmentAttemptMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getGetMyAssessmentAttemptUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. Returns the attempt with its state, fixed versions, time and session limits, progress, the item to answer now, and the practices. A reload, a retried request, or a new session returns the same item instance with the same text and option order; a lost connection never creates a new attempt. The response never says whether an earlier answer was correct and never contains answer keys, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.
|
||||
*
|
||||
* Reading an active attempt counts as activity: after the previous session ended it starts the next session, and when that would exceed the session limit it starts none and the attempt becomes `expired`. Before it answers, the server commits any transition that is due, with a new version: past `expires_at`, `ready_to_finalize` becomes `completed`, an unsubmitted additional practice is declined and the attempt becomes `completed`, and the other active states become `expired`; a practice still `pending` is graded first. The client polls this operation while a practice is `pending`. Reading a terminal attempt changes nothing.
|
||||
*
|
||||
* The attempt must belong to the candidate of the session: an attempt of another candidate answers 404 not_found, the same as an unknown identifier, so identifiers cannot be probed. An employer account answers 403 forbidden; no operation gives an employer the answers or the attempt history.
|
||||
* @summary Read or resume an assessment attempt of the current candidate.
|
||||
*/
|
||||
export const getMyAssessmentAttempt = async (attemptId: string, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentAttempt> => {
|
||||
|
||||
return apiRequest<AssessmentAttempt>(getGetMyAssessmentAttemptUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyAssessmentAttemptQueryKey = (attemptId: string,) => {
|
||||
return [
|
||||
`/api/v1/me/assessment-attempts/${attemptId}`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMyAssessmentAttemptQueryOptions = <TData = Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError = ErrorType<Problem>>(attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMyAssessmentAttemptQueryKey(attemptId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyAssessmentAttempt>>> = ({ signal }) => getMyAssessmentAttempt(attemptId, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: attemptId !== null && attemptId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMyAssessmentAttemptQueryResult = NonNullable<Awaited<ReturnType<typeof getMyAssessmentAttempt>>>
|
||||
export type GetMyAssessmentAttemptQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMyAssessmentAttempt<TData = Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentAttempt>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentAttempt>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentAttempt<TData = Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentAttempt>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentAttempt>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentAttempt<TData = Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read or resume an assessment attempt of the current candidate.
|
||||
*/
|
||||
|
||||
export function useGetMyAssessmentAttempt<TData = Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentAttempt>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMyAssessmentAttemptQueryOptions(attemptId,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSubmitMyAssessmentAnswerUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/answers`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The body names the item and carries the answer in the format of that item: `choice`, `number`, `string`, `order`, `find_error`, `configuration`, or `practice`. It never carries a score, a duration, or a correctness flag; the server records the times itself and scores the answer with the key of the fixed item instance. Time never enters the ability estimate or the grade decision.
|
||||
*
|
||||
* The response is the attempt with the next item to answer. It never says whether the answer was correct. Items are answered in order and each answer is final.
|
||||
*
|
||||
* Practice: an answer with format `practice` submits the solution of the main or the additional practice. It is stored, and the sandbox runs it asynchronously against the hidden check groups; the response shows the practice `pending`, and the client polls GetMyAssessmentAttempt for the verdict. Only the score 0-3 and the pass state of each group are shown, never the checks, error output, or seeds. Every outcome caused by the solution, such as a compilation error, a crash, or a time or memory limit, is a `finished` verdict. A `failed` verdict means only that the sandbox infrastructure could not run it; it consumes nothing. After `finished` the practice accepts no other solution, so hidden group results cannot be used to tune it. Debug runs of the candidate's own tests and the public examples are unlimited apart from the sandbox rate limit and never show hidden group results; they are planned as a separate operation.
|
||||
*
|
||||
* Repeats and conflicts, per item:
|
||||
* - A retry with the same Idempotency-Key and body within 24 hours replays the stored response.
|
||||
* - Sending the answer already stored for the item again, even with a new key or an older `expected_version`, stores nothing, keeps the version, and answers 200 with the current attempt. Each answer format defines equality: sets for `option_ids` and `line_numbers`, the exact sequence for `element_ids`, numeric equality for `number`, identical text without normalization for `text` and `config`, and the same language with identical source for a practice.
|
||||
* - A different answer for an item that already has one answers 409 state_conflict when `expected_version` is current; with a stale version the version check comes first and answers 412.
|
||||
* - Exception for a practice whose latest verdict is `failed`: the repeat rule does not apply. A submission with the same or a different solution, with the current `expected_version`, queues it again and advances the version.
|
||||
*
|
||||
* Optimistic concurrency: `expected_version` must equal the current attempt version, otherwise the server answers 412 version_conflict and stores nothing; the client reads the attempt again. 412 is the repository status for a stale version, also used by SaveMyQuestionnaire; 409 state_conflict is kept for commands that the attempt state does not allow at the current version.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the attempt (404 not_found for an unknown attempt or one of another candidate; the server first commits any due transition such as expiry, and the request counts as activity for the session limit), the repeat of the stored answer (200, skipped for a practice whose latest verdict is `failed`), the version (412), the state (409 state_conflict: the attempt is terminal, the item is not current, the item has a different answer, or the practice verdict is pending or finished), then the answer against the item (400 with a pointer such as `/answer/format` or `/answer/option_ids/0`). Following the Idempotency-Key convention, 404 and 409 state_conflict are stored under the key and replayed; 400, 412, 429, and 5xx are not. The rate limit can answer 429 with Retry-After before any check.
|
||||
* @summary Answer the current item or submit a practice of an assessment attempt.
|
||||
*/
|
||||
export const submitMyAssessmentAnswer = async (attemptId: string,
|
||||
assessmentAnswerSubmission: AssessmentAnswerSubmission,
|
||||
headers: SubmitMyAssessmentAnswerHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentAttempt> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<AssessmentAttempt>(getSubmitMyAssessmentAnswerUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json',...headers, ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(assessmentAnswerSubmission)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getSubmitMyAssessmentAnswerMutationKey = () => ['submitMyAssessmentAnswer'] as const;
|
||||
|
||||
export const getSubmitMyAssessmentAnswerMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof submitMyAssessmentAnswer>>, TError,SubmitMyAssessmentAnswerMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof submitMyAssessmentAnswer>>, TError,SubmitMyAssessmentAnswerMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getSubmitMyAssessmentAnswerMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof submitMyAssessmentAnswer>>, SubmitMyAssessmentAnswerMutationVariables> = (props) => {
|
||||
const {attemptId,data,headers} = props ?? {};
|
||||
|
||||
return submitMyAssessmentAnswer(attemptId,data,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type SubmitMyAssessmentAnswerMutationResult = NonNullable<Awaited<ReturnType<typeof submitMyAssessmentAnswer>>>
|
||||
export type SubmitMyAssessmentAnswerMutationBody = AssessmentAnswerSubmission
|
||||
export type SubmitMyAssessmentAnswerMutationError = ErrorType<Problem>
|
||||
export type SubmitMyAssessmentAnswerMutationVariables = {attemptId: string;data: AssessmentAnswerSubmission;headers: SubmitMyAssessmentAnswerHeaders}
|
||||
|
||||
/**
|
||||
* @summary Answer the current item or submit a practice of an assessment attempt.
|
||||
*/
|
||||
export const useSubmitMyAssessmentAnswer = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof submitMyAssessmentAnswer>>, TError,SubmitMyAssessmentAnswerMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof submitMyAssessmentAnswer>>,
|
||||
TError,
|
||||
SubmitMyAssessmentAnswerMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getSubmitMyAssessmentAnswerMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getFinalizeMyAssessmentAttemptUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/finalize`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. Finalize always answers with the attempt, never with the result: the decision may continue the attempt, and one response type keeps that unambiguous for every generated client. When the returned state is `completed`, the client reads the result with GetMyAssessmentResult.
|
||||
*
|
||||
* Allowed in `ready_to_finalize`, where every required part is done, and in `additional_practice_pending` while the additional practice is `not_started` or `failed`. The server decides from the stored answers with the policy, bank, and algorithm versions fixed at creation:
|
||||
* - `demo_basic` compares the raw score with the pass mark of the recorded basic grading policy and completes the attempt. It never offers an additional practice.
|
||||
* - `adaptive` applies the probability bands of the recorded policy. Confirmation or rejection completes the attempt. A probability in the band below confirmation (0.50 to below 0.80 in the demo policy) on the first finalize, while time and sessions remain, completes nothing: the server appends an `additional` practice, moves the attempt to `additional_practice_pending`, and answers 200 with it. The additional practice continues the same attempt, keeps its limits, and spends no new attempt. The next finalize, after its verdict, decides with the added evidence; a probability still below confirmation gives `not_confirmed`. An attempt offers at most one additional practice.
|
||||
* - Finalize in `additional_practice_pending` declines the offer and gives `not_confirmed` with the current evidence. A retry of the first finalize with a new key cannot decline by accident: it carries the version from before the offer and answers 412.
|
||||
*
|
||||
* A failed attempt never lowers a confirmed grade. Repeats return the same outcome: a retry with the same Idempotency-Key replays the stored response, and a finalize of a `completed` attempt answers 200 with that attempt even with a new key or an older `expected_version`; the result is computed once. When `expires_at` passes or the session limit is reached, the server finalizes `ready_to_finalize` itself, without offering an additional practice, so a finalize after that also answers 200 with the `completed` attempt.
|
||||
*
|
||||
* An attempt in `in_progress` or `practice_pending`, one with a practice verdict `pending`, or one that ended as `expired` or `insufficient_bank` answers 409 state_conflict. The problem does not list what is unfinished; the attempt shows it in `state`, `progress`, `current_item`, and `practices`. A stale `expected_version` answers 412 version_conflict, the repository status for a stale version.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the attempt (404 not_found, after any due transition), the repeat on a `completed` attempt (200), the version (412), then the state (409 state_conflict). 404 and 409 state_conflict are stored under the key; 400 and 412 are not.
|
||||
* @summary Ask for the grade decision of an assessment attempt.
|
||||
*/
|
||||
export const finalizeMyAssessmentAttempt = async (attemptId: string,
|
||||
assessmentFinalization: AssessmentFinalization,
|
||||
headers: FinalizeMyAssessmentAttemptHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentAttempt> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<AssessmentAttempt>(getFinalizeMyAssessmentAttemptUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json',...headers, ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(assessmentFinalization)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptMutationKey = () => ['finalizeMyAssessmentAttempt'] as const;
|
||||
|
||||
export const getFinalizeMyAssessmentAttemptMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getFinalizeMyAssessmentAttemptMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, FinalizeMyAssessmentAttemptMutationVariables> = (props) => {
|
||||
const {attemptId,data,headers} = props ?? {};
|
||||
|
||||
return finalizeMyAssessmentAttempt(attemptId,data,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type FinalizeMyAssessmentAttemptMutationResult = NonNullable<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>>
|
||||
export type FinalizeMyAssessmentAttemptMutationBody = AssessmentFinalization
|
||||
export type FinalizeMyAssessmentAttemptMutationError = ErrorType<Problem>
|
||||
export type FinalizeMyAssessmentAttemptMutationVariables = {attemptId: string;data: AssessmentFinalization;headers: FinalizeMyAssessmentAttemptHeaders}
|
||||
|
||||
/**
|
||||
* @summary Ask for the grade decision of an assessment attempt.
|
||||
*/
|
||||
export const useFinalizeMyAssessmentAttempt = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>, TError,FinalizeMyAssessmentAttemptMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof finalizeMyAssessmentAttempt>>,
|
||||
TError,
|
||||
FinalizeMyAssessmentAttemptMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getFinalizeMyAssessmentAttemptMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getGetMyAssessmentResultUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/result`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. Returns the immutable result of a terminal attempt: `completed`, `expired`, or `insufficient_bank`. It records the mode, the policy, bank, and algorithm versions, the decision, the previously confirmed grade, the calibration status and limitations of the method, the uncertainty where the method computes it, the practice verdicts, the weak domains, the working time as a separate label, and the next steps that the server allows. A later policy, bank, or algorithm version never changes it.
|
||||
*
|
||||
* Fields that the method does not compute are null and never zero: a `demo_basic` result has null `uncertainty` and `strength`. The result never contains answers, per-item correctness, answer keys, seeds, hidden checks, or anti-cheat signals.
|
||||
*
|
||||
* An active attempt answers 409 state_conflict; an attempt in `additional_practice_pending` is active and has no result yet. The server first commits any due transition, so an attempt past its limits is read as terminal. An attempt of another candidate answers 404 not_found, the same as an unknown identifier. An employer account answers 403 forbidden; employers see only the current category through a separate projection, never this result or the attempt history.
|
||||
* @summary Read the result of an assessment attempt of the current candidate.
|
||||
*/
|
||||
export const getMyAssessmentResult = async (attemptId: string, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentResult> => {
|
||||
|
||||
return apiRequest<AssessmentResult>(getGetMyAssessmentResultUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMyAssessmentResultQueryKey = (attemptId: string,) => {
|
||||
return [
|
||||
`/api/v1/me/assessment-attempts/${attemptId}/result`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMyAssessmentResultQueryOptions = <TData = Awaited<ReturnType<typeof getMyAssessmentResult>>, TError = ErrorType<Problem>>(attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMyAssessmentResultQueryKey(attemptId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyAssessmentResult>>> = ({ signal }) => getMyAssessmentResult(attemptId, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: attemptId !== null && attemptId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMyAssessmentResultQueryResult = NonNullable<Awaited<ReturnType<typeof getMyAssessmentResult>>>
|
||||
export type GetMyAssessmentResultQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMyAssessmentResult<TData = Awaited<ReturnType<typeof getMyAssessmentResult>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentResult>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentResult>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentResult<TData = Awaited<ReturnType<typeof getMyAssessmentResult>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMyAssessmentResult>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMyAssessmentResult>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMyAssessmentResult<TData = Awaited<ReturnType<typeof getMyAssessmentResult>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read the result of an assessment attempt of the current candidate.
|
||||
*/
|
||||
|
||||
export function useGetMyAssessmentResult<TData = Awaited<ReturnType<typeof getMyAssessmentResult>>, TError = ErrorType<Problem>>(
|
||||
attemptId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAssessmentResult>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMyAssessmentResultQueryOptions(attemptId,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export { getAssessmentMock } from './assessment/assessment.msw'
|
||||
export { getCandidateMock } from './candidate/candidate.msw'
|
||||
export { getCatalogMock } from './catalog/catalog.msw'
|
||||
export { getHealthMock } from './health/health.msw'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './assessment/assessment';
|
||||
export * from './candidate/candidate';
|
||||
export * from './catalog/catalog';
|
||||
export * from './health/health';
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentAnswerOneOptionIdsItemMax = 32;
|
||||
|
||||
|
||||
export const assessmentAnswerOneOptionIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAnswerOneOptionIdsMax = 10;
|
||||
|
||||
export const assessmentAnswerThreeTextMax = 500;
|
||||
|
||||
export const assessmentAnswerFourElementIdsItemMax = 32;
|
||||
|
||||
|
||||
export const assessmentAnswerFourElementIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAnswerFourElementIdsMin = 2;
|
||||
export const assessmentAnswerFourElementIdsMax = 20;
|
||||
|
||||
export const assessmentAnswerFiveLineNumbersItemMax = 500;
|
||||
|
||||
export const assessmentAnswerFiveLineNumbersMax = 10;
|
||||
|
||||
export const assessmentAnswerSixConfigMax = 20000;
|
||||
|
||||
export const assessmentAnswerSevenSourceCodeMax = 65536;
|
||||
|
||||
|
||||
export const AssessmentAnswer = zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"option_ids": zod.array(zod.string().min(1).max(assessmentAnswerOneOptionIdsItemMax).regex(assessmentAnswerOneOptionIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(1).max(assessmentAnswerOneOptionIdsMax)
|
||||
}).describe('Selected options of a choice item: exactly one unless the item allows several. Two answers are equal when they select the same set of options, in any order.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"number": zod.number()
|
||||
}).describe('Numeric answer in the unit of the item. Two answers are equal when their decoded values are numerically equal, so 254 and 254.0 are the same answer.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"text": zod.string().min(1).max(assessmentAnswerThreeTextMax)
|
||||
}).describe('String answer, at most the `max_length` of the item. Two answers are equal only when their texts are identical; no trimming, case folding, or Unicode normalization applies to that comparison.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"element_ids": zod.array(zod.string().min(1).max(assessmentAnswerFourElementIdsItemMax).regex(assessmentAnswerFourElementIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(assessmentAnswerFourElementIdsMin).max(assessmentAnswerFourElementIdsMax)
|
||||
}).describe('Every element of the item exactly once, in the chosen order. Two answers are equal only when the sequences are identical.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"line_numbers": zod.array(zod.int().min(1).max(assessmentAnswerFiveLineNumbersItemMax)).min(1).max(assessmentAnswerFiveLineNumbersMax)
|
||||
}).describe('Selected line numbers, at most the `max_selections` of the item. Two answers are equal when they select the same set of lines, in any order.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"config": zod.string().min(1).max(assessmentAnswerSixConfigMax)
|
||||
}).describe('Submitted configuration text, at most the `max_length` of the item. Two answers are equal only when their texts are identical, including whitespace and line breaks.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('One of the `languages` of the practice item, or null when the item offers none.'),
|
||||
"source_code": zod.string().min(1).max(assessmentAnswerSevenSourceCodeMax)
|
||||
}).describe('Practice solution. It runs in the isolated sandbox without network access, secrets, or business data. Two submissions are equal only when the language is the same and the source texts are identical. The source is never echoed in a response or a problem.')]).describe('Candidate answer, selected by `format`, which must equal the format of the answered item. It carries only the answer: no score, duration, correctness flag, or seed. The server records the times itself and scores the answer with the key of the fixed item instance. Each format defines when two answers are equal, which decides whether a repeated submission is the same answer.')
|
||||
|
||||
export type AssessmentAnswer = zod.input<typeof AssessmentAnswer>;
|
||||
export type AssessmentAnswerOutput = zod.output<typeof AssessmentAnswer>;
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerOneOptionIdsItemMax = 32;
|
||||
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerOneOptionIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAnswerSubmissionAnswerOneOptionIdsMax = 10;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerThreeTextMax = 500;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerFourElementIdsItemMax = 32;
|
||||
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerFourElementIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAnswerSubmissionAnswerFourElementIdsMin = 2;
|
||||
export const assessmentAnswerSubmissionAnswerFourElementIdsMax = 20;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerFiveLineNumbersItemMax = 500;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerFiveLineNumbersMax = 10;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerSixConfigMax = 20000;
|
||||
|
||||
export const assessmentAnswerSubmissionAnswerSevenSourceCodeMax = 65536;
|
||||
|
||||
|
||||
export const AssessmentAnswerSubmission = zod.object({
|
||||
"expected_version": zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.'),
|
||||
"item_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"answer": zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"option_ids": zod.array(zod.string().min(1).max(assessmentAnswerSubmissionAnswerOneOptionIdsItemMax).regex(assessmentAnswerSubmissionAnswerOneOptionIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(1).max(assessmentAnswerSubmissionAnswerOneOptionIdsMax)
|
||||
}).describe('Selected options of a choice item: exactly one unless the item allows several. Two answers are equal when they select the same set of options, in any order.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"number": zod.number()
|
||||
}).describe('Numeric answer in the unit of the item. Two answers are equal when their decoded values are numerically equal, so 254 and 254.0 are the same answer.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"text": zod.string().min(1).max(assessmentAnswerSubmissionAnswerThreeTextMax)
|
||||
}).describe('String answer, at most the `max_length` of the item. Two answers are equal only when their texts are identical; no trimming, case folding, or Unicode normalization applies to that comparison.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"element_ids": zod.array(zod.string().min(1).max(assessmentAnswerSubmissionAnswerFourElementIdsItemMax).regex(assessmentAnswerSubmissionAnswerFourElementIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(assessmentAnswerSubmissionAnswerFourElementIdsMin).max(assessmentAnswerSubmissionAnswerFourElementIdsMax)
|
||||
}).describe('Every element of the item exactly once, in the chosen order. Two answers are equal only when the sequences are identical.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"line_numbers": zod.array(zod.int().min(1).max(assessmentAnswerSubmissionAnswerFiveLineNumbersItemMax)).min(1).max(assessmentAnswerSubmissionAnswerFiveLineNumbersMax)
|
||||
}).describe('Selected line numbers, at most the `max_selections` of the item. Two answers are equal when they select the same set of lines, in any order.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"config": zod.string().min(1).max(assessmentAnswerSubmissionAnswerSixConfigMax)
|
||||
}).describe('Submitted configuration text, at most the `max_length` of the item. Two answers are equal only when their texts are identical, including whitespace and line breaks.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('One of the `languages` of the practice item, or null when the item offers none.'),
|
||||
"source_code": zod.string().min(1).max(assessmentAnswerSubmissionAnswerSevenSourceCodeMax)
|
||||
}).describe('Practice solution. It runs in the isolated sandbox without network access, secrets, or business data. Two submissions are equal only when the language is the same and the source texts are identical. The source is never echoed in a response or a problem.')]).describe('Candidate answer, selected by `format`, which must equal the format of the answered item. It carries only the answer: no score, duration, correctness flag, or seed. The server records the times itself and scores the answer with the key of the fixed item instance. Each format defines when two answers are equal, which decides whether a repeated submission is the same answer.')
|
||||
}).describe('Answer to one item of the attempt. Unknown fields are rejected, so a request cannot send a score, a duration, or a correctness flag.')
|
||||
|
||||
export type AssessmentAnswerSubmission = zod.input<typeof AssessmentAnswerSubmission>;
|
||||
export type AssessmentAnswerSubmissionOutput = zod.output<typeof AssessmentAnswerSubmission>;
|
||||
@@ -0,0 +1,190 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
|
||||
export const assessmentAttemptVersionsBankVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentAttemptVersionsBankVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentAttemptVersionsAlgorithmVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentAttemptVersionsAlgorithmVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentAttemptSessionsOneUsedMax = 10;
|
||||
|
||||
export const assessmentAttemptSessionsOneMaxMax = 10;
|
||||
|
||||
export const assessmentAttemptSessionsOneIdleTimeoutSecondsMin = 60;
|
||||
export const assessmentAttemptSessionsOneIdleTimeoutSecondsMax = 86400;
|
||||
|
||||
export const assessmentAttemptProgressAnsweredItemsMin = 0;
|
||||
export const assessmentAttemptProgressAnsweredItemsMax = 100;
|
||||
|
||||
export const assessmentAttemptProgressMaxItemsMax = 100;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneSequenceMax = 100;
|
||||
|
||||
export const assessmentAttemptCurrentItemOnePromptMax = 20000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentOneOptionsItemIdMax = 32;
|
||||
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentOneOptionsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAttemptCurrentItemOneContentOneOptionsItemTextMax = 2000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentOneOptionsMin = 2;
|
||||
export const assessmentAttemptCurrentItemOneContentOneOptionsMax = 10;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentTwoUnitMax = 32;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentThreeMaxLengthMax = 500;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFourElementsItemIdMax = 32;
|
||||
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFourElementsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentAttemptCurrentItemOneContentFourElementsItemTextMax = 2000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFourElementsMin = 2;
|
||||
export const assessmentAttemptCurrentItemOneContentFourElementsMax = 20;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFiveSyntaxMax = 32;
|
||||
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFiveSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const assessmentAttemptCurrentItemOneContentFiveLinesItemNumberMax = 500;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFiveLinesItemTextMax = 1000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFiveLinesMax = 500;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentFiveMaxSelectionsMax = 10;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSixSyntaxMax = 32;
|
||||
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSixSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const assessmentAttemptCurrentItemOneContentSixInitialConfigMax = 20000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSixMaxLengthMax = 20000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSevenLanguagesMax = 2;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSevenPublicExamplesItemInputMax = 10000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSevenPublicExamplesItemExpectedOutputMax = 10000;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSevenPublicExamplesMax = 10;
|
||||
|
||||
export const assessmentAttemptCurrentItemOneContentSevenMaxSourceLengthMax = 65536;
|
||||
|
||||
export const assessmentAttemptPracticesItemVerdictOneScoreMin = 0;
|
||||
export const assessmentAttemptPracticesItemVerdictOneScoreMax = 3;
|
||||
|
||||
export const assessmentAttemptPracticesItemVerdictOneMaxScoreMin = 3;
|
||||
export const assessmentAttemptPracticesItemVerdictOneMaxScoreMax = 3;
|
||||
|
||||
export const assessmentAttemptPracticesItemVerdictOneGroupsItemGroupMax = 3;
|
||||
|
||||
export const assessmentAttemptPracticesItemVerdictOneGroupsMin = 3;
|
||||
export const assessmentAttemptPracticesItemVerdictOneGroupsMax = 3;
|
||||
|
||||
export const assessmentAttemptPracticesMax = 5;
|
||||
|
||||
|
||||
export const AssessmentAttempt = zod.object({
|
||||
"id": zod.uuid().describe('Attempt identifier.'),
|
||||
"version": zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.'),
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"target_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"task_language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('Task language of the attempt, or null when the bank offers no choice.'),
|
||||
"mode": zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.'),
|
||||
"state": zod.enum(['in_progress', 'practice_pending', 'additional_practice_pending', 'ready_to_finalize', 'completed', 'expired', 'insufficient_bank']).describe('Lifecycle state of an attempt and the commands it accepts.\n\n- in_progress: items are being answered; `current_item` is the item to answer. Accepts SubmitMyAssessmentAnswer for that item.\n- practice_pending: the item part is finished, and the main practice has no finished verdict yet: it is not submitted, its verdict is pending in the sandbox, or the sandbox failed and the practice can be submitted again. Accepts SubmitMyAssessmentAnswer with the practice item while its status is `not_started` or `failed`. No grade is confirmed while the practice is unfinished, even when the adaptive stop rule has already ended the item part.\n- additional_practice_pending: adaptive only. Finalize found the probability of reaching the grade in the band below confirmation, so the attempt offers one additional practice without spending a new attempt; it keeps the time and session limits of the attempt. Accepts SubmitMyAssessmentAnswer with the additional practice item while its status is `not_started` or `failed`, and FinalizeMyAssessmentAttempt in the same statuses, which declines the offer and decides `not_confirmed` with the current evidence.\n- ready_to_finalize: every required part is done, including a submitted additional practice with a finished verdict. Accepts FinalizeMyAssessmentAttempt.\n- completed: a decision was made; the result is available.\n- expired: the time or session limit passed before the candidate finished the required parts. The result is available and confirms no grade.\n- insufficient_bank: the published bank could not supply the items required for coverage within the limit, and the attempt ended without a confirmed grade instead of repeating families. The result is available.\n\nWhen `expires_at` passes or the session limit is reached, a practice submitted before that and still `pending` is graded first. Then the server decides without another command: `ready_to_finalize` is finalized and becomes `completed`; `additional_practice_pending` with the additional practice not submitted is finalized as declined and becomes `completed` with `not_confirmed`; `in_progress` and `practice_pending` become `expired`, with the result reason `expired` or `practice_incomplete`; and when the latest submission of a practice ended `failed`, the attempt becomes `expired` with the reason `sandbox_unavailable`, which is not the candidate\'s fault. `completed`, `expired`, and `insufficient_bank` are terminal and accept no command except the repeat of finalize described on FinalizeMyAssessmentAttempt. Adding a value is a contract change.'),
|
||||
"versions": zod.object({
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version whose assessment rules apply: thresholds, stop rules, item limits, time and session limits, and retry intervals.'),
|
||||
"bank_version": zod.string().min(1).max(assessmentAttemptVersionsBankVersionMax).regex(assessmentAttemptVersionsBankVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.'),
|
||||
"algorithm_version": zod.string().min(1).max(assessmentAttemptVersionsAlgorithmVersionMax).regex(assessmentAttemptVersionsAlgorithmVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.')
|
||||
}).describe('Versions fixed when the attempt was created. They never change during the attempt, and a result is always reproduced from the stored answers with these versions; a later policy, bank, or algorithm version does not rewrite it.'),
|
||||
"started_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"expires_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"sessions": zod.union([zod.object({
|
||||
"used": zod.int().min(1).max(assessmentAttemptSessionsOneUsedMax).describe('Sessions started so far, including the current one.'),
|
||||
"max": zod.int().min(1).max(assessmentAttemptSessionsOneMaxMax),
|
||||
"idle_timeout_seconds": zod.int().min(assessmentAttemptSessionsOneIdleTimeoutSecondsMin).max(assessmentAttemptSessionsOneIdleTimeoutSecondsMax).describe('Inactivity after which the current session ends.')
|
||||
}).describe('Work sessions of the attempt, as the policy version limits them, for example two sessions within the time limit.\n\nA session starts with the creation of the attempt or, after the previous session ended, with the next GetMyAssessmentAttempt or command on the active attempt. It ends after `idle_timeout_seconds` without such a request. A request that would start a session beyond `max_sessions` starts none: the server moves the attempt to `expired` and answers with it (a read) or with 409 state_conflict (a command). Reading a terminal attempt or a result never starts a session.'),zod.null()]).describe('Session limit of the attempt, or null when its policy version defines none.'),
|
||||
"finished_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the attempt reached a terminal state, or null while it is active.'),
|
||||
"progress": zod.object({
|
||||
"answered_items": zod.int().min(assessmentAttemptProgressAnsweredItemsMin).max(assessmentAttemptProgressAnsweredItemsMax),
|
||||
"max_items": zod.int().min(1).max(assessmentAttemptProgressMaxItemsMax).describe('Item limit of the attempt: the form size in demo_basic, or the policy limit of scored and seed items together in adaptive.')
|
||||
}).describe('Progress of the item part. It counts seed items like scored ones, so it does not reveal which items are scored. An adaptive attempt may end its item part before `max_items` by its stop rule. A finalize refused as premature does not list the unfinished parts; the client reads them here, in `current_item`, and in `practices`.'),
|
||||
"current_item": zod.union([zod.object({
|
||||
"id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"sequence": zod.int().min(1).max(assessmentAttemptCurrentItemOneSequenceMax).describe('Position of the item in the attempt, from 1.'),
|
||||
"prompt": zod.string().min(1).max(assessmentAttemptCurrentItemOnePromptMax).describe('Statement in Russian. Plain text with line breaks; the client shows it as text, never as HTML.'),
|
||||
"content": zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"options": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentOneOptionsItemIdMax).regex(assessmentAttemptCurrentItemOneContentOneOptionsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentOneOptionsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(assessmentAttemptCurrentItemOneContentOneOptionsMin).max(assessmentAttemptCurrentItemOneContentOneOptionsMax).describe('Options in the order of this instance.'),
|
||||
"multiple": zod.boolean().describe('Whether more than one option may be selected. It is a property of the task family, fixed for every variant, and never derived from the key: a multiple-choice variant may have a single correct option.')
|
||||
}).describe('Choose one option, or several when `multiple` is true. The content never says which options are correct or how many are.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"unit": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentTwoUnitMax).nullable().describe('Unit of the expected value, for example `ms`, or null.')
|
||||
}).describe('Enter a number, optionally in the given unit.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"max_length": zod.int().min(1).max(assessmentAttemptCurrentItemOneContentThreeMaxLengthMax).describe('Maximum length of the answer in characters. It is an input limit of the task family, never derived from the key, so it does not reveal the length of the correct answer.')
|
||||
}).describe('Enter a short string, such as a command, a header name, or an address.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"elements": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentFourElementsItemIdMax).regex(assessmentAttemptCurrentItemOneContentFourElementsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentFourElementsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(assessmentAttemptCurrentItemOneContentFourElementsMin).max(assessmentAttemptCurrentItemOneContentFourElementsMax)
|
||||
}).describe('Put every element into the right order. The elements arrive in the order of this instance, which is never the answer.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"syntax": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentFiveSyntaxMax).regex(assessmentAttemptCurrentItemOneContentFiveSyntaxRegExp).nullable().describe('Highlighting hint such as `go`, `python`, or `cisco_ios`, or null.'),
|
||||
"lines": zod.array(zod.object({
|
||||
"number": zod.int().min(1).max(assessmentAttemptCurrentItemOneContentFiveLinesItemNumberMax),
|
||||
"text": zod.string().max(assessmentAttemptCurrentItemOneContentFiveLinesItemTextMax)
|
||||
}).describe('One numbered line of a code or configuration fragment. Plain text.')).min(1).max(assessmentAttemptCurrentItemOneContentFiveLinesMax).describe('Lines numbered from 1 in order.'),
|
||||
"max_selections": zod.int().min(1).max(assessmentAttemptCurrentItemOneContentFiveMaxSelectionsMax).describe('Maximum number of lines the answer may select. It is a limit of the task family, fixed for every variant and never derived from the key; it is not the number of wrong lines.')
|
||||
}).describe('Find the lines with the error in a code or configuration fragment and select up to `max_selections` line numbers.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"syntax": zod.string().min(1).max(assessmentAttemptCurrentItemOneContentSixSyntaxMax).regex(assessmentAttemptCurrentItemOneContentSixSyntaxRegExp).describe('Configuration syntax such as `cisco_ios`, `nginx`, or `yaml`.'),
|
||||
"initial_config": zod.string().max(assessmentAttemptCurrentItemOneContentSixInitialConfigMax).describe('Starting text to edit; empty when the candidate writes it from scratch.'),
|
||||
"max_length": zod.int().min(1).max(assessmentAttemptCurrentItemOneContentSixMaxLengthMax).describe('Maximum length of the submitted configuration in characters, an input limit of the task family that is never derived from the key.')
|
||||
}).describe('Write or fix a configuration. The server checks the submitted text with the computed key or reference check of the task family; it never executes it as code.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"languages": zod.array(zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.')).max(assessmentAttemptCurrentItemOneContentSevenLanguagesMax).describe('Languages the solution may use. Empty when the task does not offer a choice; the submission then sends a null language.'),
|
||||
"public_examples": zod.array(zod.object({
|
||||
"input": zod.string().max(assessmentAttemptCurrentItemOneContentSevenPublicExamplesItemInputMax),
|
||||
"expected_output": zod.string().max(assessmentAttemptCurrentItemOneContentSevenPublicExamplesItemExpectedOutputMax)
|
||||
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(assessmentAttemptCurrentItemOneContentSevenPublicExamplesMax),
|
||||
"max_source_length": zod.int().min(1).max(assessmentAttemptCurrentItemOneContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
|
||||
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
|
||||
}).describe('Item instance served to the candidate. The variant is fixed when it is first served: a reload, a retried request, or a resumed session returns the same instance with the same text and option order. The item never says whether an earlier answer was correct, and seed items, which are not scored, are indistinguishable from scored ones.'),zod.null()]).describe('Item to answer now: a test item in `in_progress`, the practice item to submit in `practice_pending` or `additional_practice_pending` while that practice is `not_started` or `failed`, and null otherwise.'),
|
||||
"practices": zod.array(zod.object({
|
||||
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
|
||||
"item_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"status": zod.enum(['not_started', 'pending', 'finished', 'failed']).describe('State of a practice.\n\n- not_started: no solution was submitted yet.\n- pending: the submitted solution is queued or running in the sandbox.\n- finished: the sandbox ran the solution and returned a verdict; `verdict` holds it. Every outcome caused by the solution itself, such as a compilation error, a runtime error, a time limit, or a memory limit, is `finished` with the affected groups not passed.\n- failed: the sandbox infrastructure could not run the solution, for example because its queue was full or an executor broke, independently of the solution. The failure is not the candidate\'s and consumes nothing; the practice can be submitted again.'),
|
||||
"submitted_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time of the latest submission, or null before the first one.'),
|
||||
"verdict": zod.union([zod.object({
|
||||
"score": zod.int().min(assessmentAttemptPracticesItemVerdictOneScoreMin).max(assessmentAttemptPracticesItemVerdictOneScoreMax),
|
||||
"max_score": zod.int().min(assessmentAttemptPracticesItemVerdictOneMaxScoreMin).max(assessmentAttemptPracticesItemVerdictOneMaxScoreMax),
|
||||
"groups": zod.array(zod.object({
|
||||
"group": zod.int().min(1).max(assessmentAttemptPracticesItemVerdictOneGroupsItemGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentAttemptPracticesItemVerdictOneGroupsMin).max(assessmentAttemptPracticesItemVerdictOneGroupsMax)
|
||||
}).describe('Verdict of a practice solution on the hidden checks: the score 0-3, one point for each passed group. The hidden checks, their inputs and outputs, error output, and seeds are never returned.'),zod.null()]).describe('The verdict when `status` is `finished`, otherwise null.'),
|
||||
"failure_reason": zod.union([zod.enum(['sandbox_busy', 'sandbox_error']).describe('Why the sandbox infrastructure returned no verdict: `sandbox_busy` when its queue was full, `sandbox_error` for an infrastructure failure such as a broken executor. Neither depends on the solution; a solution that fails to compile, crashes, or exceeds a limit gets a `finished` verdict instead, so a failure never acts as an oracle for hidden checks.'),zod.null()]).describe('The reason when `status` is `failed`, otherwise null.')
|
||||
}).describe('Practice of the attempt. Its verdict is shown only after the submission; the solution time is kept as a separate label and never enters the ability estimate or the grade decision.')).max(assessmentAttemptPracticesMax).describe('Practices in the order they were assigned: the `main` practice first, then an `additional` practice once finalize offers it. Empty only for a demo_basic attempt while code practice is disabled until the sandbox isolation is verified; its result then lists the `practice_not_included` limitation. A list rather than one field leaves room for more practices without a breaking change.')
|
||||
}).describe('Assessment attempt of the current candidate for one category, a specialization and a target grade. It shows the state, the fixed versions, the server deadline `expires_at` from the policy version, which the client clock never extends, the session limit, the progress, the item to answer now, and the practices. It never contains answer keys, the correctness of submitted answers, scores of single items, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.')
|
||||
|
||||
export type AssessmentAttempt = zod.input<typeof AssessmentAttempt>;
|
||||
export type AssessmentAttemptOutput = zod.output<typeof AssessmentAttempt>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentAttemptCreate = zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"target_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"task_language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('Task language of the attempt, one of the `task_languages` of the published bank, or null when the bank offers no choice of language. The questionnaire choice is the value the client offers first.')
|
||||
}).describe('Category to assess: a specialization and the target grade, with the task language. The candidate comes from the session. The mode and versions are chosen by the server; unknown fields such as `mode`, `seed`, or `score` are rejected.')
|
||||
|
||||
export type AssessmentAttemptCreate = zod.input<typeof AssessmentAttemptCreate>;
|
||||
export type AssessmentAttemptCreateOutput = zod.output<typeof AssessmentAttemptCreate>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentAttemptState = zod.enum(['in_progress', 'practice_pending', 'additional_practice_pending', 'ready_to_finalize', 'completed', 'expired', 'insufficient_bank']).describe('Lifecycle state of an attempt and the commands it accepts.\n\n- in_progress: items are being answered; `current_item` is the item to answer. Accepts SubmitMyAssessmentAnswer for that item.\n- practice_pending: the item part is finished, and the main practice has no finished verdict yet: it is not submitted, its verdict is pending in the sandbox, or the sandbox failed and the practice can be submitted again. Accepts SubmitMyAssessmentAnswer with the practice item while its status is `not_started` or `failed`. No grade is confirmed while the practice is unfinished, even when the adaptive stop rule has already ended the item part.\n- additional_practice_pending: adaptive only. Finalize found the probability of reaching the grade in the band below confirmation, so the attempt offers one additional practice without spending a new attempt; it keeps the time and session limits of the attempt. Accepts SubmitMyAssessmentAnswer with the additional practice item while its status is `not_started` or `failed`, and FinalizeMyAssessmentAttempt in the same statuses, which declines the offer and decides `not_confirmed` with the current evidence.\n- ready_to_finalize: every required part is done, including a submitted additional practice with a finished verdict. Accepts FinalizeMyAssessmentAttempt.\n- completed: a decision was made; the result is available.\n- expired: the time or session limit passed before the candidate finished the required parts. The result is available and confirms no grade.\n- insufficient_bank: the published bank could not supply the items required for coverage within the limit, and the attempt ended without a confirmed grade instead of repeating families. The result is available.\n\nWhen `expires_at` passes or the session limit is reached, a practice submitted before that and still `pending` is graded first. Then the server decides without another command: `ready_to_finalize` is finalized and becomes `completed`; `additional_practice_pending` with the additional practice not submitted is finalized as declined and becomes `completed` with `not_confirmed`; `in_progress` and `practice_pending` become `expired`, with the result reason `expired` or `practice_incomplete`; and when the latest submission of a practice ended `failed`, the attempt becomes `expired` with the reason `sandbox_unavailable`, which is not the candidate\'s fault. `completed`, `expired`, and `insufficient_bank` are terminal and accept no command except the repeat of finalize described on FinalizeMyAssessmentAttempt. Adding a value is a contract change.')
|
||||
|
||||
export type AssessmentAttemptState = zod.input<typeof AssessmentAttemptState>;
|
||||
export type AssessmentAttemptStateOutput = zod.output<typeof AssessmentAttemptState>;
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
|
||||
export const AssessmentAttemptVersion = zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.')
|
||||
|
||||
export type AssessmentAttemptVersion = zod.input<typeof AssessmentAttemptVersion>;
|
||||
export type AssessmentAttemptVersionOutput = zod.output<typeof AssessmentAttemptVersion>;
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentAvailabilitySpecializationsItemGradesItemMaxSessionsMax = 10;
|
||||
|
||||
export const assessmentAvailabilitySpecializationsItemGradesItemMaxItemsMax = 100;
|
||||
|
||||
export const assessmentAvailabilitySpecializationsItemGradesMax = 10;
|
||||
|
||||
export const assessmentAvailabilitySpecializationsMax = 2;
|
||||
|
||||
|
||||
export const AssessmentAvailability = zod.object({
|
||||
"specializations": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Currently confirmed grade of the specialization, or null.'),
|
||||
"active_attempt_id": zod.uuid().nullable().describe('Identifier of the active attempt of the specialization, or null.'),
|
||||
"grades": zod.array(zod.object({
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"status": zod.enum(['available', 'active_attempt', 'cooldown', 'insufficient_bank']).describe('Whether an attempt for the grade can start now.\n\n- available: CreateMyAssessmentAttempt can start it.\n- active_attempt: the specialization has an active attempt; resume it by `active_attempt_id`.\n- cooldown: a retry or promotion interval or the attempt limit of the policy blocks it until `available_at`. Attempts that ended as `insufficient_bank` or `sandbox_unavailable` never cause it.\n- insufficient_bank: no published bank of the category, or not enough unseen families to cover the blueprint for this candidate. The server never fills the gap by repeating families.'),
|
||||
"mode": zod.union([zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.'),zod.null()]).describe('Mode that an attempt would use, or null when the status is `insufficient_bank`.'),
|
||||
"available_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('When the status is `cooldown`, the first time the attempt can start; otherwise null.'),
|
||||
"time_limit_seconds": zod.int().min(1).nullable().describe('Time from the start to `expires_at`.'),
|
||||
"max_sessions": zod.int().min(1).max(assessmentAvailabilitySpecializationsItemGradesItemMaxSessionsMax).nullable().describe('Session limit within the time limit.'),
|
||||
"max_items": zod.int().min(1).max(assessmentAvailabilitySpecializationsItemGradesItemMaxItemsMax).nullable().describe('Item limit, as in `AssessmentProgress.max_items`.'),
|
||||
"practice_required": zod.boolean().nullable().describe('Whether the attempt would include a main code practice.')
|
||||
}).describe('Availability of an attempt for one grade of a specialization, with the limits that an attempt would have, so the client can show them before the start. The limit fields are null when the status is `insufficient_bank` or the policy defines no such limit.')).max(assessmentAvailabilitySpecializationsItemGradesMax).describe('Every grade of the scale in ascending order.')
|
||||
}).describe('Assessment state of one questionnaire specialization. Specializations are assessed independently, with independent retry intervals.')).max(assessmentAvailabilitySpecializationsMax).describe('Questionnaire specializations in questionnaire order.')
|
||||
}).describe('Assessment availability for the specializations of the current candidate\'s questionnaire, derived at the time of the request.')
|
||||
|
||||
export type AssessmentAvailability = zod.input<typeof AssessmentAvailability>;
|
||||
export type AssessmentAvailabilityOutput = zod.output<typeof AssessmentAvailability>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentDurationsItemsSecondsMin = 0;
|
||||
|
||||
export const assessmentDurationsPracticeSecondsMin = 0;
|
||||
|
||||
|
||||
export const AssessmentDurations = zod.object({
|
||||
"items_seconds": zod.int().min(assessmentDurationsItemsSecondsMin),
|
||||
"practice_seconds": zod.int().min(assessmentDurationsPracticeSecondsMin).nullable().describe('Time on all practices with a verdict, or null when no practice has one.')
|
||||
}).describe('Working time recorded by the server. It is a separate label: it never enters the ability estimate or the grade decision.')
|
||||
|
||||
export type AssessmentDurations = zod.input<typeof AssessmentDurations>;
|
||||
export type AssessmentDurationsOutput = zod.output<typeof AssessmentDurations>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
|
||||
export const AssessmentFinalization = zod.object({
|
||||
"expected_version": zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.')
|
||||
}).describe('Command to finalize the attempt.')
|
||||
|
||||
export type AssessmentFinalization = zod.input<typeof AssessmentFinalization>;
|
||||
export type AssessmentFinalizationOutput = zod.output<typeof AssessmentFinalization>;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentGapDomainMax = 64;
|
||||
|
||||
|
||||
export const assessmentGapDomainRegExp = new RegExp('^[a-z0-9_]+$');
|
||||
export const assessmentGapTitleMax = 200;
|
||||
|
||||
|
||||
export const AssessmentGap = zod.object({
|
||||
"domain": zod.string().min(1).max(assessmentGapDomainMax).regex(assessmentGapDomainRegExp).describe('Stable domain code of the bank blueprint.'),
|
||||
"title": zod.string().min(1).max(assessmentGapTitleMax).describe('Display name in Russian. Plain text.')
|
||||
}).describe('Domain of the specialization where the evidence was weak.')
|
||||
|
||||
export type AssessmentGap = zod.input<typeof AssessmentGap>;
|
||||
export type AssessmentGapOutput = zod.output<typeof AssessmentGap>;
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentGradeAvailabilityMaxSessionsMax = 10;
|
||||
|
||||
export const assessmentGradeAvailabilityMaxItemsMax = 100;
|
||||
|
||||
|
||||
export const AssessmentGradeAvailability = zod.object({
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"status": zod.enum(['available', 'active_attempt', 'cooldown', 'insufficient_bank']).describe('Whether an attempt for the grade can start now.\n\n- available: CreateMyAssessmentAttempt can start it.\n- active_attempt: the specialization has an active attempt; resume it by `active_attempt_id`.\n- cooldown: a retry or promotion interval or the attempt limit of the policy blocks it until `available_at`. Attempts that ended as `insufficient_bank` or `sandbox_unavailable` never cause it.\n- insufficient_bank: no published bank of the category, or not enough unseen families to cover the blueprint for this candidate. The server never fills the gap by repeating families.'),
|
||||
"mode": zod.union([zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.'),zod.null()]).describe('Mode that an attempt would use, or null when the status is `insufficient_bank`.'),
|
||||
"available_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('When the status is `cooldown`, the first time the attempt can start; otherwise null.'),
|
||||
"time_limit_seconds": zod.int().min(1).nullable().describe('Time from the start to `expires_at`.'),
|
||||
"max_sessions": zod.int().min(1).max(assessmentGradeAvailabilityMaxSessionsMax).nullable().describe('Session limit within the time limit.'),
|
||||
"max_items": zod.int().min(1).max(assessmentGradeAvailabilityMaxItemsMax).nullable().describe('Item limit, as in `AssessmentProgress.max_items`.'),
|
||||
"practice_required": zod.boolean().nullable().describe('Whether the attempt would include a main code practice.')
|
||||
}).describe('Availability of an attempt for one grade of a specialization, with the limits that an attempt would have, so the client can show them before the start. The limit fields are null when the status is `insufficient_bank` or the policy defines no such limit.')
|
||||
|
||||
export type AssessmentGradeAvailability = zod.input<typeof AssessmentGradeAvailability>;
|
||||
export type AssessmentGradeAvailabilityOutput = zod.output<typeof AssessmentGradeAvailability>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentGradeAvailabilityStatus = zod.enum(['available', 'active_attempt', 'cooldown', 'insufficient_bank']).describe('Whether an attempt for the grade can start now.\n\n- available: CreateMyAssessmentAttempt can start it.\n- active_attempt: the specialization has an active attempt; resume it by `active_attempt_id`.\n- cooldown: a retry or promotion interval or the attempt limit of the policy blocks it until `available_at`. Attempts that ended as `insufficient_bank` or `sandbox_unavailable` never cause it.\n- insufficient_bank: no published bank of the category, or not enough unseen families to cover the blueprint for this candidate. The server never fills the gap by repeating families.')
|
||||
|
||||
export type AssessmentGradeAvailabilityStatus = zod.input<typeof AssessmentGradeAvailabilityStatus>;
|
||||
export type AssessmentGradeAvailabilityStatusOutput = zod.output<typeof AssessmentGradeAvailabilityStatus>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentInterval = zod.object({
|
||||
"low": zod.number(),
|
||||
"high": zod.number()
|
||||
}).describe('Interval on the ability scale.')
|
||||
|
||||
export type AssessmentInterval = zod.input<typeof AssessmentInterval>;
|
||||
export type AssessmentIntervalOutput = zod.output<typeof AssessmentInterval>;
|
||||
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentItemSequenceMax = 100;
|
||||
|
||||
export const assessmentItemPromptMax = 20000;
|
||||
|
||||
export const assessmentItemContentOneOptionsItemIdMax = 32;
|
||||
|
||||
|
||||
export const assessmentItemContentOneOptionsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentItemContentOneOptionsItemTextMax = 2000;
|
||||
|
||||
export const assessmentItemContentOneOptionsMin = 2;
|
||||
export const assessmentItemContentOneOptionsMax = 10;
|
||||
|
||||
export const assessmentItemContentTwoUnitMax = 32;
|
||||
|
||||
export const assessmentItemContentThreeMaxLengthMax = 500;
|
||||
|
||||
export const assessmentItemContentFourElementsItemIdMax = 32;
|
||||
|
||||
|
||||
export const assessmentItemContentFourElementsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentItemContentFourElementsItemTextMax = 2000;
|
||||
|
||||
export const assessmentItemContentFourElementsMin = 2;
|
||||
export const assessmentItemContentFourElementsMax = 20;
|
||||
|
||||
export const assessmentItemContentFiveSyntaxMax = 32;
|
||||
|
||||
|
||||
export const assessmentItemContentFiveSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const assessmentItemContentFiveLinesItemNumberMax = 500;
|
||||
|
||||
export const assessmentItemContentFiveLinesItemTextMax = 1000;
|
||||
|
||||
export const assessmentItemContentFiveLinesMax = 500;
|
||||
|
||||
export const assessmentItemContentFiveMaxSelectionsMax = 10;
|
||||
|
||||
export const assessmentItemContentSixSyntaxMax = 32;
|
||||
|
||||
|
||||
export const assessmentItemContentSixSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const assessmentItemContentSixInitialConfigMax = 20000;
|
||||
|
||||
export const assessmentItemContentSixMaxLengthMax = 20000;
|
||||
|
||||
export const assessmentItemContentSevenLanguagesMax = 2;
|
||||
|
||||
export const assessmentItemContentSevenPublicExamplesItemInputMax = 10000;
|
||||
|
||||
export const assessmentItemContentSevenPublicExamplesItemExpectedOutputMax = 10000;
|
||||
|
||||
export const assessmentItemContentSevenPublicExamplesMax = 10;
|
||||
|
||||
export const assessmentItemContentSevenMaxSourceLengthMax = 65536;
|
||||
|
||||
|
||||
export const AssessmentItem = zod.object({
|
||||
"id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"sequence": zod.int().min(1).max(assessmentItemSequenceMax).describe('Position of the item in the attempt, from 1.'),
|
||||
"prompt": zod.string().min(1).max(assessmentItemPromptMax).describe('Statement in Russian. Plain text with line breaks; the client shows it as text, never as HTML.'),
|
||||
"content": zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"options": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(assessmentItemContentOneOptionsItemIdMax).regex(assessmentItemContentOneOptionsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(assessmentItemContentOneOptionsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(assessmentItemContentOneOptionsMin).max(assessmentItemContentOneOptionsMax).describe('Options in the order of this instance.'),
|
||||
"multiple": zod.boolean().describe('Whether more than one option may be selected. It is a property of the task family, fixed for every variant, and never derived from the key: a multiple-choice variant may have a single correct option.')
|
||||
}).describe('Choose one option, or several when `multiple` is true. The content never says which options are correct or how many are.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"unit": zod.string().min(1).max(assessmentItemContentTwoUnitMax).nullable().describe('Unit of the expected value, for example `ms`, or null.')
|
||||
}).describe('Enter a number, optionally in the given unit.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"max_length": zod.int().min(1).max(assessmentItemContentThreeMaxLengthMax).describe('Maximum length of the answer in characters. It is an input limit of the task family, never derived from the key, so it does not reveal the length of the correct answer.')
|
||||
}).describe('Enter a short string, such as a command, a header name, or an address.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"elements": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(assessmentItemContentFourElementsItemIdMax).regex(assessmentItemContentFourElementsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(assessmentItemContentFourElementsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(assessmentItemContentFourElementsMin).max(assessmentItemContentFourElementsMax)
|
||||
}).describe('Put every element into the right order. The elements arrive in the order of this instance, which is never the answer.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"syntax": zod.string().min(1).max(assessmentItemContentFiveSyntaxMax).regex(assessmentItemContentFiveSyntaxRegExp).nullable().describe('Highlighting hint such as `go`, `python`, or `cisco_ios`, or null.'),
|
||||
"lines": zod.array(zod.object({
|
||||
"number": zod.int().min(1).max(assessmentItemContentFiveLinesItemNumberMax),
|
||||
"text": zod.string().max(assessmentItemContentFiveLinesItemTextMax)
|
||||
}).describe('One numbered line of a code or configuration fragment. Plain text.')).min(1).max(assessmentItemContentFiveLinesMax).describe('Lines numbered from 1 in order.'),
|
||||
"max_selections": zod.int().min(1).max(assessmentItemContentFiveMaxSelectionsMax).describe('Maximum number of lines the answer may select. It is a limit of the task family, fixed for every variant and never derived from the key; it is not the number of wrong lines.')
|
||||
}).describe('Find the lines with the error in a code or configuration fragment and select up to `max_selections` line numbers.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"syntax": zod.string().min(1).max(assessmentItemContentSixSyntaxMax).regex(assessmentItemContentSixSyntaxRegExp).describe('Configuration syntax such as `cisco_ios`, `nginx`, or `yaml`.'),
|
||||
"initial_config": zod.string().max(assessmentItemContentSixInitialConfigMax).describe('Starting text to edit; empty when the candidate writes it from scratch.'),
|
||||
"max_length": zod.int().min(1).max(assessmentItemContentSixMaxLengthMax).describe('Maximum length of the submitted configuration in characters, an input limit of the task family that is never derived from the key.')
|
||||
}).describe('Write or fix a configuration. The server checks the submitted text with the computed key or reference check of the task family; it never executes it as code.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"languages": zod.array(zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.')).max(assessmentItemContentSevenLanguagesMax).describe('Languages the solution may use. Empty when the task does not offer a choice; the submission then sends a null language.'),
|
||||
"public_examples": zod.array(zod.object({
|
||||
"input": zod.string().max(assessmentItemContentSevenPublicExamplesItemInputMax),
|
||||
"expected_output": zod.string().max(assessmentItemContentSevenPublicExamplesItemExpectedOutputMax)
|
||||
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(assessmentItemContentSevenPublicExamplesMax),
|
||||
"max_source_length": zod.int().min(1).max(assessmentItemContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
|
||||
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
|
||||
}).describe('Item instance served to the candidate. The variant is fixed when it is first served: a reload, a retried request, or a resumed session returns the same instance with the same text and option order. The item never says whether an earlier answer was correct, and seed items, which are not scored, are indistinguishable from scored ones.')
|
||||
|
||||
export type AssessmentItem = zod.input<typeof AssessmentItem>;
|
||||
export type AssessmentItemOutput = zod.output<typeof AssessmentItem>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentItemId = zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.')
|
||||
|
||||
export type AssessmentItemId = zod.input<typeof AssessmentItemId>;
|
||||
export type AssessmentItemIdOutput = zod.output<typeof AssessmentItemId>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentLimitation = zod.enum(['uncalibrated_thresholds', 'demo_bank', 'practice_not_included', 'unproctored']).describe('Known limitation of the method behind a result, shown with the result.\n\n- uncalibrated_thresholds: the thresholds are not yet validated on a pilot.\n- demo_bank: the result comes from the small reviewed demo bank.\n- practice_not_included: the attempt had no code practice because the sandbox was not enabled.\n- unproctored: the attempt was taken online without supervision.\n\nAdding a value is a contract change.')
|
||||
|
||||
export type AssessmentLimitation = zod.input<typeof AssessmentLimitation>;
|
||||
export type AssessmentLimitationOutput = zod.output<typeof AssessmentLimitation>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentMode = zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.')
|
||||
|
||||
export type AssessmentMode = zod.input<typeof AssessmentMode>;
|
||||
export type AssessmentModeOutput = zod.output<typeof AssessmentMode>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentNextAction = zod.enum(['retake_same_grade', 'take_lower_grade', 'accept_lower_grade', 'take_higher_grade']).describe('Step that the candidate may take next.\n\n- retake_same_grade: test the same grade again from `available_at`.\n- take_lower_grade: test the lower `grade`. After a failure, including the first test, it is allowed at once, outside the same-grade retry interval.\n- accept_lower_grade: accept the lower `grade` on the evidence of this attempt, when the data are sufficient (the command is planned).\n- take_higher_grade: test the higher `grade` from `available_at`. A first confirmation is not a promotion, so after it `available_at` is null; after a promotion the next one waits for the promotion interval of the policy.')
|
||||
|
||||
export type AssessmentNextAction = zod.input<typeof AssessmentNextAction>;
|
||||
export type AssessmentNextActionOutput = zod.output<typeof AssessmentNextAction>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentNextStep = zod.object({
|
||||
"action": zod.enum(['retake_same_grade', 'take_lower_grade', 'accept_lower_grade', 'take_higher_grade']).describe('Step that the candidate may take next.\n\n- retake_same_grade: test the same grade again from `available_at`.\n- take_lower_grade: test the lower `grade`. After a failure, including the first test, it is allowed at once, outside the same-grade retry interval.\n- accept_lower_grade: accept the lower `grade` on the evidence of this attempt, when the data are sufficient (the command is planned).\n- take_higher_grade: test the higher `grade` from `available_at`. A first confirmation is not a promotion, so after it `available_at` is null; after a promotion the next one waits for the promotion interval of the policy.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"available_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('First time the step is allowed, or null when it is allowed now.')
|
||||
}).describe('Step that the server allows after this result, computed when it was decided.')
|
||||
|
||||
export type AssessmentNextStep = zod.input<typeof AssessmentNextStep>;
|
||||
export type AssessmentNextStepOutput = zod.output<typeof AssessmentNextStep>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentNotDeterminedReason = zod.enum(['expired', 'practice_incomplete', 'insufficient_bank', 'sandbox_unavailable']).describe('Why an attempt gives no decision, and whether it counts against the retry rules.\n\n- expired: the time or session limit passed before the candidate finished the item part. It is the candidate\'s attempt: it counts toward the attempt limit and starts the same-grade retry interval.\n- practice_incomplete: the item part was done, but the candidate did not submit the main practice before the limit. It counts like `expired`.\n- insufficient_bank: the bank could not supply the required coverage within the limit. It is a platform limitation: it never counts toward the attempt limit and starts no retry interval.\n- sandbox_unavailable: the latest submission of a required or additional practice ended `failed` because of the sandbox infrastructure, and the limit passed before a verdict. It is a platform fault: it never counts toward the attempt limit and starts no retry interval.')
|
||||
|
||||
export type AssessmentNotDeterminedReason = zod.input<typeof AssessmentNotDeterminedReason>;
|
||||
export type AssessmentNotDeterminedReasonOutput = zod.output<typeof AssessmentNotDeterminedReason>;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentOptionIdMax = 32;
|
||||
|
||||
|
||||
export const assessmentOptionIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const assessmentOptionTextMax = 2000;
|
||||
|
||||
|
||||
export const AssessmentOption = zod.object({
|
||||
"id": zod.string().min(1).max(assessmentOptionIdMax).regex(assessmentOptionIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(assessmentOptionTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')
|
||||
|
||||
export type AssessmentOption = zod.input<typeof AssessmentOption>;
|
||||
export type AssessmentOptionOutput = zod.output<typeof AssessmentOption>;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentOptionIdMax = 32;
|
||||
|
||||
|
||||
export const AssessmentOptionIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const AssessmentOptionId = zod.string().min(1).max(AssessmentOptionIdMax).regex(AssessmentOptionIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')
|
||||
|
||||
export type AssessmentOptionId = zod.input<typeof AssessmentOptionId>;
|
||||
export type AssessmentOptionIdOutput = zod.output<typeof AssessmentOptionId>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentOutcome = zod.enum(['confirmed', 'not_confirmed', 'not_determined']).describe('Grade decision of the attempt.\n\n- confirmed: the target grade is confirmed by the rule of the recorded policy version.\n- not_confirmed: the evidence is below the rule, including an adaptive attempt whose probability stayed below confirmation after the additional practice, or whose additional practice was declined or not submitted in time. The previously confirmed grade, if any, stays in force.\n- not_determined: the attempt gives no decision; `not_determined_reason` says why. The previously confirmed grade stays in force.\n\nA failed, expired, or flagged attempt never lowers a confirmed grade.')
|
||||
|
||||
export type AssessmentOutcome = zod.input<typeof AssessmentOutcome>;
|
||||
export type AssessmentOutcomeOutput = zod.output<typeof AssessmentOutcome>;
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentPracticeVerdictOneScoreMin = 0;
|
||||
export const assessmentPracticeVerdictOneScoreMax = 3;
|
||||
|
||||
export const assessmentPracticeVerdictOneMaxScoreMin = 3;
|
||||
export const assessmentPracticeVerdictOneMaxScoreMax = 3;
|
||||
|
||||
export const assessmentPracticeVerdictOneGroupsItemGroupMax = 3;
|
||||
|
||||
export const assessmentPracticeVerdictOneGroupsMin = 3;
|
||||
export const assessmentPracticeVerdictOneGroupsMax = 3;
|
||||
|
||||
|
||||
export const AssessmentPractice = zod.object({
|
||||
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
|
||||
"item_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"status": zod.enum(['not_started', 'pending', 'finished', 'failed']).describe('State of a practice.\n\n- not_started: no solution was submitted yet.\n- pending: the submitted solution is queued or running in the sandbox.\n- finished: the sandbox ran the solution and returned a verdict; `verdict` holds it. Every outcome caused by the solution itself, such as a compilation error, a runtime error, a time limit, or a memory limit, is `finished` with the affected groups not passed.\n- failed: the sandbox infrastructure could not run the solution, for example because its queue was full or an executor broke, independently of the solution. The failure is not the candidate\'s and consumes nothing; the practice can be submitted again.'),
|
||||
"submitted_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time of the latest submission, or null before the first one.'),
|
||||
"verdict": zod.union([zod.object({
|
||||
"score": zod.int().min(assessmentPracticeVerdictOneScoreMin).max(assessmentPracticeVerdictOneScoreMax),
|
||||
"max_score": zod.int().min(assessmentPracticeVerdictOneMaxScoreMin).max(assessmentPracticeVerdictOneMaxScoreMax),
|
||||
"groups": zod.array(zod.object({
|
||||
"group": zod.int().min(1).max(assessmentPracticeVerdictOneGroupsItemGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentPracticeVerdictOneGroupsMin).max(assessmentPracticeVerdictOneGroupsMax)
|
||||
}).describe('Verdict of a practice solution on the hidden checks: the score 0-3, one point for each passed group. The hidden checks, their inputs and outputs, error output, and seeds are never returned.'),zod.null()]).describe('The verdict when `status` is `finished`, otherwise null.'),
|
||||
"failure_reason": zod.union([zod.enum(['sandbox_busy', 'sandbox_error']).describe('Why the sandbox infrastructure returned no verdict: `sandbox_busy` when its queue was full, `sandbox_error` for an infrastructure failure such as a broken executor. Neither depends on the solution; a solution that fails to compile, crashes, or exceeds a limit gets a `finished` verdict instead, so a failure never acts as an oracle for hidden checks.'),zod.null()]).describe('The reason when `status` is `failed`, otherwise null.')
|
||||
}).describe('Practice of the attempt. Its verdict is shown only after the submission; the solution time is kept as a separate label and never enters the ability estimate or the grade decision.')
|
||||
|
||||
export type AssessmentPractice = zod.input<typeof AssessmentPractice>;
|
||||
export type AssessmentPracticeOutput = zod.output<typeof AssessmentPractice>;
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentPracticeResultVerdictScoreMin = 0;
|
||||
export const assessmentPracticeResultVerdictScoreMax = 3;
|
||||
|
||||
export const assessmentPracticeResultVerdictMaxScoreMin = 3;
|
||||
export const assessmentPracticeResultVerdictMaxScoreMax = 3;
|
||||
|
||||
export const assessmentPracticeResultVerdictGroupsItemGroupMax = 3;
|
||||
|
||||
export const assessmentPracticeResultVerdictGroupsMin = 3;
|
||||
export const assessmentPracticeResultVerdictGroupsMax = 3;
|
||||
|
||||
|
||||
export const AssessmentPracticeResult = zod.object({
|
||||
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
|
||||
"verdict": zod.object({
|
||||
"score": zod.int().min(assessmentPracticeResultVerdictScoreMin).max(assessmentPracticeResultVerdictScoreMax),
|
||||
"max_score": zod.int().min(assessmentPracticeResultVerdictMaxScoreMin).max(assessmentPracticeResultVerdictMaxScoreMax),
|
||||
"groups": zod.array(zod.object({
|
||||
"group": zod.int().min(1).max(assessmentPracticeResultVerdictGroupsItemGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentPracticeResultVerdictGroupsMin).max(assessmentPracticeResultVerdictGroupsMax)
|
||||
}).describe('Verdict of a practice solution on the hidden checks: the score 0-3, one point for each passed group. The hidden checks, their inputs and outputs, error output, and seeds are never returned.')
|
||||
}).describe('Verdict of one practice of the attempt.')
|
||||
|
||||
export type AssessmentPracticeResult = zod.input<typeof AssessmentPracticeResult>;
|
||||
export type AssessmentPracticeResultOutput = zod.output<typeof AssessmentPracticeResult>;
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentProgressAnsweredItemsMin = 0;
|
||||
export const assessmentProgressAnsweredItemsMax = 100;
|
||||
|
||||
export const assessmentProgressMaxItemsMax = 100;
|
||||
|
||||
|
||||
export const AssessmentProgress = zod.object({
|
||||
"answered_items": zod.int().min(assessmentProgressAnsweredItemsMin).max(assessmentProgressAnsweredItemsMax),
|
||||
"max_items": zod.int().min(1).max(assessmentProgressMaxItemsMax).describe('Item limit of the attempt: the form size in demo_basic, or the policy limit of scored and seed items together in adaptive.')
|
||||
}).describe('Progress of the item part. It counts seed items like scored ones, so it does not reveal which items are scored. An adaptive attempt may end its item part before `max_items` by its stop rule. A finalize refused as premature does not list the unfinished parts; the client reads them here, in `current_item`, and in `practices`.')
|
||||
|
||||
export type AssessmentProgress = zod.input<typeof AssessmentProgress>;
|
||||
export type AssessmentProgressOutput = zod.output<typeof AssessmentProgress>;
|
||||
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentResultVersionsBankVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentResultVersionsBankVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentResultVersionsAlgorithmVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentResultVersionsAlgorithmVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentResultLimitationsMax = 10;
|
||||
|
||||
export const assessmentResultUncertaintyOneStandardErrorMin = 0;
|
||||
|
||||
export const assessmentResultUncertaintyOnePGradeMin = 0;
|
||||
export const assessmentResultUncertaintyOnePGradeMax = 1;
|
||||
|
||||
export const assessmentResultBasicScoreOnePointsMin = 0;
|
||||
|
||||
|
||||
|
||||
export const assessmentResultPracticesItemVerdictScoreMin = 0;
|
||||
export const assessmentResultPracticesItemVerdictScoreMax = 3;
|
||||
|
||||
export const assessmentResultPracticesItemVerdictMaxScoreMin = 3;
|
||||
export const assessmentResultPracticesItemVerdictMaxScoreMax = 3;
|
||||
|
||||
export const assessmentResultPracticesItemVerdictGroupsItemGroupMax = 3;
|
||||
|
||||
export const assessmentResultPracticesItemVerdictGroupsMin = 3;
|
||||
export const assessmentResultPracticesItemVerdictGroupsMax = 3;
|
||||
|
||||
export const assessmentResultPracticesMax = 5;
|
||||
|
||||
export const assessmentResultGapsItemDomainMax = 64;
|
||||
|
||||
|
||||
export const assessmentResultGapsItemDomainRegExp = new RegExp('^[a-z0-9_]+$');
|
||||
export const assessmentResultGapsItemTitleMax = 200;
|
||||
|
||||
export const assessmentResultGapsMax = 20;
|
||||
|
||||
export const assessmentResultDurationsItemsSecondsMin = 0;
|
||||
|
||||
export const assessmentResultDurationsPracticeSecondsMin = 0;
|
||||
|
||||
export const assessmentResultNextStepsMax = 5;
|
||||
|
||||
|
||||
export const AssessmentResult = zod.object({
|
||||
"attempt_id": zod.uuid(),
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"target_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"task_language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]),
|
||||
"mode": zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.'),
|
||||
"versions": zod.object({
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version whose assessment rules apply: thresholds, stop rules, item limits, time and session limits, and retry intervals.'),
|
||||
"bank_version": zod.string().min(1).max(assessmentResultVersionsBankVersionMax).regex(assessmentResultVersionsBankVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.'),
|
||||
"algorithm_version": zod.string().min(1).max(assessmentResultVersionsAlgorithmVersionMax).regex(assessmentResultVersionsAlgorithmVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.')
|
||||
}).describe('Versions fixed when the attempt was created. They never change during the attempt, and a result is always reproduced from the stored answers with these versions; a later policy, bank, or algorithm version does not rewrite it.'),
|
||||
"outcome": zod.enum(['confirmed', 'not_confirmed', 'not_determined']).describe('Grade decision of the attempt.\n\n- confirmed: the target grade is confirmed by the rule of the recorded policy version.\n- not_confirmed: the evidence is below the rule, including an adaptive attempt whose probability stayed below confirmation after the additional practice, or whose additional practice was declined or not submitted in time. The previously confirmed grade, if any, stays in force.\n- not_determined: the attempt gives no decision; `not_determined_reason` says why. The previously confirmed grade stays in force.\n\nA failed, expired, or flagged attempt never lowers a confirmed grade.'),
|
||||
"not_determined_reason": zod.union([zod.enum(['expired', 'practice_incomplete', 'insufficient_bank', 'sandbox_unavailable']).describe('Why an attempt gives no decision, and whether it counts against the retry rules.\n\n- expired: the time or session limit passed before the candidate finished the item part. It is the candidate\'s attempt: it counts toward the attempt limit and starts the same-grade retry interval.\n- practice_incomplete: the item part was done, but the candidate did not submit the main practice before the limit. It counts like `expired`.\n- insufficient_bank: the bank could not supply the required coverage within the limit. It is a platform limitation: it never counts toward the attempt limit and starts no retry interval.\n- sandbox_unavailable: the latest submission of a required or additional practice ended `failed` because of the sandbox infrastructure, and the limit passed before a verdict. It is a platform fault: it never counts toward the attempt limit and starts no retry interval.'),zod.null()]).describe('The reason when `outcome` is `not_determined`, otherwise null.'),
|
||||
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Grade that this attempt confirmed, the target grade, or null when it confirmed none. Together with the specialization it forms the category.'),
|
||||
"previous_confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Confirmed grade of the specialization before this attempt, or null. When the attempt confirmed nothing, this grade stays in force.'),
|
||||
"strength": zod.union([zod.enum(['high', 'medium']).describe('Strength of an adaptive confirmation: `high` or `medium`, by the probability bands of the recorded policy version.'),zod.null()]).describe('Strength of an adaptive confirmation, otherwise null.'),
|
||||
"calibration_status": zod.enum(['uncalibrated', 'calibrated']).describe('Whether the thresholds of the recorded policy version are empirically calibrated. `uncalibrated` results are provisional: their thresholds come from expert judgement, and their probabilities are not claimed to be calibrated.'),
|
||||
"limitations": zod.array(zod.enum(['uncalibrated_thresholds', 'demo_bank', 'practice_not_included', 'unproctored']).describe('Known limitation of the method behind a result, shown with the result.\n\n- uncalibrated_thresholds: the thresholds are not yet validated on a pilot.\n- demo_bank: the result comes from the small reviewed demo bank.\n- practice_not_included: the attempt had no code practice because the sandbox was not enabled.\n- unproctored: the attempt was taken online without supervision.\n\nAdding a value is a contract change.')).max(assessmentResultLimitationsMax),
|
||||
"uncertainty": zod.union([zod.object({
|
||||
"theta": zod.number(),
|
||||
"standard_error": zod.number().min(assessmentResultUncertaintyOneStandardErrorMin),
|
||||
"interval_95": zod.object({
|
||||
"low": zod.number(),
|
||||
"high": zod.number()
|
||||
}).describe('Interval on the ability scale.'),
|
||||
"p_grade": zod.number().min(assessmentResultUncertaintyOnePGradeMin).max(assessmentResultUncertaintyOnePGradeMax).describe('Probability of reaching the threshold of the target grade.')
|
||||
}).describe('Ability estimate of an adaptive attempt and its uncertainty: the EAP estimate on the specialization scale, its standard error, the 95% interval, and the probability of reaching the target grade threshold. The interval is reported but is not a separate stop condition.'),zod.null()]).describe('Ability estimate and uncertainty of an adaptive attempt with a decision; null for demo_basic, which computes none, and for an attempt without a decision.'),
|
||||
"basic_score": zod.union([zod.object({
|
||||
"points": zod.int().min(assessmentResultBasicScoreOnePointsMin),
|
||||
"max_points": zod.int().min(1),
|
||||
"pass_points": zod.int().min(1)
|
||||
}).describe('Raw score of a demo_basic attempt and the pass mark of the recorded basic grading policy. The pass mark comes from that policy version and never from the handler.'),zod.null()]).describe('Raw score of a demo_basic attempt with a decision, otherwise null.'),
|
||||
"practices": zod.array(zod.object({
|
||||
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
|
||||
"verdict": zod.object({
|
||||
"score": zod.int().min(assessmentResultPracticesItemVerdictScoreMin).max(assessmentResultPracticesItemVerdictScoreMax),
|
||||
"max_score": zod.int().min(assessmentResultPracticesItemVerdictMaxScoreMin).max(assessmentResultPracticesItemVerdictMaxScoreMax),
|
||||
"groups": zod.array(zod.object({
|
||||
"group": zod.int().min(1).max(assessmentResultPracticesItemVerdictGroupsItemGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentResultPracticesItemVerdictGroupsMin).max(assessmentResultPracticesItemVerdictGroupsMax)
|
||||
}).describe('Verdict of a practice solution on the hidden checks: the score 0-3, one point for each passed group. The hidden checks, their inputs and outputs, error output, and seeds are never returned.')
|
||||
}).describe('Verdict of one practice of the attempt.')).max(assessmentResultPracticesMax).describe('Verdicts of the practices that have one, main first.'),
|
||||
"gaps": zod.array(zod.object({
|
||||
"domain": zod.string().min(1).max(assessmentResultGapsItemDomainMax).regex(assessmentResultGapsItemDomainRegExp).describe('Stable domain code of the bank blueprint.'),
|
||||
"title": zod.string().min(1).max(assessmentResultGapsItemTitleMax).describe('Display name in Russian. Plain text.')
|
||||
}).describe('Domain of the specialization where the evidence was weak.')).max(assessmentResultGapsMax).describe('Domains with weak evidence; empty when none were found or the method finds none.'),
|
||||
"durations": zod.object({
|
||||
"items_seconds": zod.int().min(assessmentResultDurationsItemsSecondsMin),
|
||||
"practice_seconds": zod.int().min(assessmentResultDurationsPracticeSecondsMin).nullable().describe('Time on all practices with a verdict, or null when no practice has one.')
|
||||
}).describe('Working time recorded by the server. It is a separate label: it never enters the ability estimate or the grade decision.'),
|
||||
"next_steps": zod.array(zod.object({
|
||||
"action": zod.enum(['retake_same_grade', 'take_lower_grade', 'accept_lower_grade', 'take_higher_grade']).describe('Step that the candidate may take next.\n\n- retake_same_grade: test the same grade again from `available_at`.\n- take_lower_grade: test the lower `grade`. After a failure, including the first test, it is allowed at once, outside the same-grade retry interval.\n- accept_lower_grade: accept the lower `grade` on the evidence of this attempt, when the data are sufficient (the command is planned).\n- take_higher_grade: test the higher `grade` from `available_at`. A first confirmation is not a promotion, so after it `available_at` is null; after a promotion the next one waits for the promotion interval of the policy.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"available_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('First time the step is allowed, or null when it is allowed now.')
|
||||
}).describe('Step that the server allows after this result, computed when it was decided.')).max(assessmentResultNextStepsMax),
|
||||
"decided_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Immutable result of a terminal attempt, visible only to its candidate. It records the method, the versions, the decision, its uncertainty, and its limitations; a later policy, bank, or algorithm version never changes it. It never contains answers, per-item correctness, answer keys, seeds, hidden checks, or anti-cheat signals. Fields that the method does not compute are null, never zero: demo_basic has null `uncertainty` and `strength`, and adaptive has null `basic_score`.')
|
||||
|
||||
export type AssessmentResult = zod.input<typeof AssessmentResult>;
|
||||
export type AssessmentResultOutput = zod.output<typeof AssessmentResult>;
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentSessionsUsedMax = 10;
|
||||
|
||||
export const assessmentSessionsMaxMax = 10;
|
||||
|
||||
export const assessmentSessionsIdleTimeoutSecondsMin = 60;
|
||||
export const assessmentSessionsIdleTimeoutSecondsMax = 86400;
|
||||
|
||||
|
||||
export const AssessmentSessions = zod.object({
|
||||
"used": zod.int().min(1).max(assessmentSessionsUsedMax).describe('Sessions started so far, including the current one.'),
|
||||
"max": zod.int().min(1).max(assessmentSessionsMaxMax),
|
||||
"idle_timeout_seconds": zod.int().min(assessmentSessionsIdleTimeoutSecondsMin).max(assessmentSessionsIdleTimeoutSecondsMax).describe('Inactivity after which the current session ends.')
|
||||
}).describe('Work sessions of the attempt, as the policy version limits them, for example two sessions within the time limit.\n\nA session starts with the creation of the attempt or, after the previous session ended, with the next GetMyAssessmentAttempt or command on the active attempt. It ends after `idle_timeout_seconds` without such a request. A request that would start a session beyond `max_sessions` starts none: the server moves the attempt to `expired` and answers with it (a read) or with 409 state_conflict (a command). Reading a terminal attempt or a result never starts a session.')
|
||||
|
||||
export type AssessmentSessions = zod.input<typeof AssessmentSessions>;
|
||||
export type AssessmentSessionsOutput = zod.output<typeof AssessmentSessions>;
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentSpecializationAvailabilityGradesItemMaxSessionsMax = 10;
|
||||
|
||||
export const assessmentSpecializationAvailabilityGradesItemMaxItemsMax = 100;
|
||||
|
||||
export const assessmentSpecializationAvailabilityGradesMax = 10;
|
||||
|
||||
|
||||
export const AssessmentSpecializationAvailability = zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Currently confirmed grade of the specialization, or null.'),
|
||||
"active_attempt_id": zod.uuid().nullable().describe('Identifier of the active attempt of the specialization, or null.'),
|
||||
"grades": zod.array(zod.object({
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"status": zod.enum(['available', 'active_attempt', 'cooldown', 'insufficient_bank']).describe('Whether an attempt for the grade can start now.\n\n- available: CreateMyAssessmentAttempt can start it.\n- active_attempt: the specialization has an active attempt; resume it by `active_attempt_id`.\n- cooldown: a retry or promotion interval or the attempt limit of the policy blocks it until `available_at`. Attempts that ended as `insufficient_bank` or `sandbox_unavailable` never cause it.\n- insufficient_bank: no published bank of the category, or not enough unseen families to cover the blueprint for this candidate. The server never fills the gap by repeating families.'),
|
||||
"mode": zod.union([zod.enum(['demo_basic', 'adaptive']).describe('Measurement method of an attempt. The server selects it from the published task bank of the category; the client never chooses it.\n\n- demo_basic: a fixed form of reviewed demo items scored by their keys against the pass mark of the versioned basic grading policy. It computes no ability estimate, standard error, or probability, so every uncertainty field of its result is null, its thresholds are uncalibrated, and its decision is binary: it never offers an additional practice.\n- adaptive: the adaptive test on task families with an ability estimate, its standard error, and the probability of reaching the grade threshold, as the versioned assessment policy defines them. A probability in the band below confirmation offers one additional practice in the same attempt.\n\nAdding a value is a contract change.'),zod.null()]).describe('Mode that an attempt would use, or null when the status is `insufficient_bank`.'),
|
||||
"available_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('When the status is `cooldown`, the first time the attempt can start; otherwise null.'),
|
||||
"time_limit_seconds": zod.int().min(1).nullable().describe('Time from the start to `expires_at`.'),
|
||||
"max_sessions": zod.int().min(1).max(assessmentSpecializationAvailabilityGradesItemMaxSessionsMax).nullable().describe('Session limit within the time limit.'),
|
||||
"max_items": zod.int().min(1).max(assessmentSpecializationAvailabilityGradesItemMaxItemsMax).nullable().describe('Item limit, as in `AssessmentProgress.max_items`.'),
|
||||
"practice_required": zod.boolean().nullable().describe('Whether the attempt would include a main code practice.')
|
||||
}).describe('Availability of an attempt for one grade of a specialization, with the limits that an attempt would have, so the client can show them before the start. The limit fields are null when the status is `insufficient_bank` or the policy defines no such limit.')).max(assessmentSpecializationAvailabilityGradesMax).describe('Every grade of the scale in ascending order.')
|
||||
}).describe('Assessment state of one questionnaire specialization. Specializations are assessed independently, with independent retry intervals.')
|
||||
|
||||
export type AssessmentSpecializationAvailability = zod.input<typeof AssessmentSpecializationAvailability>;
|
||||
export type AssessmentSpecializationAvailabilityOutput = zod.output<typeof AssessmentSpecializationAvailability>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentStrength = zod.enum(['high', 'medium']).describe('Strength of an adaptive confirmation: `high` or `medium`, by the probability bands of the recorded policy version.')
|
||||
|
||||
export type AssessmentStrength = zod.input<typeof AssessmentStrength>;
|
||||
export type AssessmentStrengthOutput = zod.output<typeof AssessmentStrength>;
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentUncertaintyStandardErrorMin = 0;
|
||||
|
||||
export const assessmentUncertaintyPGradeMin = 0;
|
||||
export const assessmentUncertaintyPGradeMax = 1;
|
||||
|
||||
|
||||
export const AssessmentUncertainty = zod.object({
|
||||
"theta": zod.number(),
|
||||
"standard_error": zod.number().min(assessmentUncertaintyStandardErrorMin),
|
||||
"interval_95": zod.object({
|
||||
"low": zod.number(),
|
||||
"high": zod.number()
|
||||
}).describe('Interval on the ability scale.'),
|
||||
"p_grade": zod.number().min(assessmentUncertaintyPGradeMin).max(assessmentUncertaintyPGradeMax).describe('Probability of reaching the threshold of the target grade.')
|
||||
}).describe('Ability estimate of an adaptive attempt and its uncertainty: the EAP estimate on the specialization scale, its standard error, the 95% interval, and the probability of reaching the target grade threshold. The interval is reported but is not a separate stop condition.')
|
||||
|
||||
export type AssessmentUncertainty = zod.input<typeof AssessmentUncertainty>;
|
||||
export type AssessmentUncertaintyOutput = zod.output<typeof AssessmentUncertainty>;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentVersionLabelMax = 64;
|
||||
|
||||
|
||||
export const AssessmentVersionLabelRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
|
||||
export const AssessmentVersionLabel = zod.string().min(1).max(AssessmentVersionLabelMax).regex(AssessmentVersionLabelRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.')
|
||||
|
||||
export type AssessmentVersionLabel = zod.input<typeof AssessmentVersionLabel>;
|
||||
export type AssessmentVersionLabelOutput = zod.output<typeof AssessmentVersionLabel>;
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const assessmentVersionsBankVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentVersionsBankVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
export const assessmentVersionsAlgorithmVersionMax = 64;
|
||||
|
||||
|
||||
export const assessmentVersionsAlgorithmVersionRegExp = new RegExp('^[A-Za-z0-9._-]+$');
|
||||
|
||||
export const AssessmentVersions = zod.object({
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version whose assessment rules apply: thresholds, stop rules, item limits, time and session limits, and retry intervals.'),
|
||||
"bank_version": zod.string().min(1).max(assessmentVersionsBankVersionMax).regex(assessmentVersionsBankVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.'),
|
||||
"algorithm_version": zod.string().min(1).max(assessmentVersionsAlgorithmVersionMax).regex(assessmentVersionsAlgorithmVersionRegExp).describe('Opaque identifier of a published version, for example `backend-demo.2026-10.1`. Clients show it as text and never parse it.')
|
||||
}).describe('Versions fixed when the attempt was created. They never change during the attempt, and a result is always reproduced from the stored answers with these versions; a later policy, bank, or algorithm version does not rewrite it.')
|
||||
|
||||
export type AssessmentVersions = zod.input<typeof AssessmentVersions>;
|
||||
export type AssessmentVersionsOutput = zod.output<typeof AssessmentVersions>;
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const basicScorePointsMin = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
export const BasicScore = zod.object({
|
||||
"points": zod.int().min(basicScorePointsMin),
|
||||
"max_points": zod.int().min(1),
|
||||
"pass_points": zod.int().min(1)
|
||||
}).describe('Raw score of a demo_basic attempt and the pass mark of the recorded basic grading policy. The pass mark comes from that policy version and never from the handler.')
|
||||
|
||||
export type BasicScore = zod.input<typeof BasicScore>;
|
||||
export type BasicScoreOutput = zod.output<typeof BasicScore>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CalibrationStatus = zod.enum(['uncalibrated', 'calibrated']).describe('Whether the thresholds of the recorded policy version are empirically calibrated. `uncalibrated` results are provisional: their thresholds come from expert judgement, and their probabilities are not claimed to be calibrated.')
|
||||
|
||||
export type CalibrationStatus = zod.input<typeof CalibrationStatus>;
|
||||
export type CalibrationStatusOutput = zod.output<typeof CalibrationStatus>;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const choiceAnswerOptionIdsItemMax = 32;
|
||||
|
||||
|
||||
export const choiceAnswerOptionIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const choiceAnswerOptionIdsMax = 10;
|
||||
|
||||
|
||||
export const ChoiceAnswer = zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"option_ids": zod.array(zod.string().min(1).max(choiceAnswerOptionIdsItemMax).regex(choiceAnswerOptionIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(1).max(choiceAnswerOptionIdsMax)
|
||||
}).describe('Selected options of a choice item: exactly one unless the item allows several. Two answers are equal when they select the same set of options, in any order.')
|
||||
|
||||
export type ChoiceAnswer = zod.input<typeof ChoiceAnswer>;
|
||||
export type ChoiceAnswerOutput = zod.output<typeof ChoiceAnswer>;
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const choiceItemContentOptionsItemIdMax = 32;
|
||||
|
||||
|
||||
export const choiceItemContentOptionsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const choiceItemContentOptionsItemTextMax = 2000;
|
||||
|
||||
export const choiceItemContentOptionsMin = 2;
|
||||
export const choiceItemContentOptionsMax = 10;
|
||||
|
||||
|
||||
export const ChoiceItemContent = zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"options": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(choiceItemContentOptionsItemIdMax).regex(choiceItemContentOptionsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(choiceItemContentOptionsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(choiceItemContentOptionsMin).max(choiceItemContentOptionsMax).describe('Options in the order of this instance.'),
|
||||
"multiple": zod.boolean().describe('Whether more than one option may be selected. It is a property of the task family, fixed for every variant, and never derived from the key: a multiple-choice variant may have a single correct option.')
|
||||
}).describe('Choose one option, or several when `multiple` is true. The content never says which options are correct or how many are.')
|
||||
|
||||
export type ChoiceItemContent = zod.input<typeof ChoiceItemContent>;
|
||||
export type ChoiceItemContentOutput = zod.output<typeof ChoiceItemContent>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const codeLineNumberMax = 500;
|
||||
|
||||
export const codeLineTextMax = 1000;
|
||||
|
||||
|
||||
export const CodeLine = zod.object({
|
||||
"number": zod.int().min(1).max(codeLineNumberMax),
|
||||
"text": zod.string().max(codeLineTextMax)
|
||||
}).describe('One numbered line of a code or configuration fragment. Plain text.')
|
||||
|
||||
export type CodeLine = zod.input<typeof CodeLine>;
|
||||
export type CodeLineOutput = zod.output<typeof CodeLine>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const configurationAnswerConfigMax = 20000;
|
||||
|
||||
|
||||
export const ConfigurationAnswer = zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"config": zod.string().min(1).max(configurationAnswerConfigMax)
|
||||
}).describe('Submitted configuration text, at most the `max_length` of the item. Two answers are equal only when their texts are identical, including whitespace and line breaks.')
|
||||
|
||||
export type ConfigurationAnswer = zod.input<typeof ConfigurationAnswer>;
|
||||
export type ConfigurationAnswerOutput = zod.output<typeof ConfigurationAnswer>;
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const configurationItemContentSyntaxMax = 32;
|
||||
|
||||
|
||||
export const configurationItemContentSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const configurationItemContentInitialConfigMax = 20000;
|
||||
|
||||
export const configurationItemContentMaxLengthMax = 20000;
|
||||
|
||||
|
||||
export const ConfigurationItemContent = zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"syntax": zod.string().min(1).max(configurationItemContentSyntaxMax).regex(configurationItemContentSyntaxRegExp).describe('Configuration syntax such as `cisco_ios`, `nginx`, or `yaml`.'),
|
||||
"initial_config": zod.string().max(configurationItemContentInitialConfigMax).describe('Starting text to edit; empty when the candidate writes it from scratch.'),
|
||||
"max_length": zod.int().min(1).max(configurationItemContentMaxLengthMax).describe('Maximum length of the submitted configuration in characters, an input limit of the task family that is never derived from the key.')
|
||||
}).describe('Write or fix a configuration. The server checks the submitted text with the computed key or reference check of the task family; it never executes it as code.')
|
||||
|
||||
export type ConfigurationItemContent = zod.input<typeof ConfigurationItemContent>;
|
||||
export type ConfigurationItemContentOutput = zod.output<typeof ConfigurationItemContent>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const CreateMyAssessmentAttemptBody = zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"target_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"task_language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('Task language of the attempt, one of the `task_languages` of the published bank, or null when the bank offers no choice of language. The questionnaire choice is the value the client offers first.')
|
||||
}).describe('Category to assess: a specialization and the target grade, with the task language. The candidate comes from the session. The mode and versions are chosen by the server; unknown fields such as `mode`, `seed`, or `score` are rejected.')
|
||||
|
||||
export type CreateMyAssessmentAttemptBody = zod.input<typeof CreateMyAssessmentAttemptBody>;
|
||||
export type CreateMyAssessmentAttemptBodyOutput = zod.output<typeof CreateMyAssessmentAttemptBody>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const createMyAssessmentAttemptHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const createMyAssessmentAttemptHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
|
||||
export const CreateMyAssessmentAttemptHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(createMyAssessmentAttemptHeadersIdempotencyKeyMax).regex(createMyAssessmentAttemptHeadersIdempotencyKeyRegExp)
|
||||
})
|
||||
|
||||
export type CreateMyAssessmentAttemptHeaders = zod.input<typeof CreateMyAssessmentAttemptHeaders>;
|
||||
export type CreateMyAssessmentAttemptHeadersOutput = zod.output<typeof CreateMyAssessmentAttemptHeaders>;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
|
||||
export const FinalizeMyAssessmentAttemptBody = zod.object({
|
||||
"expected_version": zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.')
|
||||
}).describe('Command to finalize the attempt.')
|
||||
|
||||
export type FinalizeMyAssessmentAttemptBody = zod.input<typeof FinalizeMyAssessmentAttemptBody>;
|
||||
export type FinalizeMyAssessmentAttemptBodyOutput = zod.output<typeof FinalizeMyAssessmentAttemptBody>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const finalizeMyAssessmentAttemptHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const finalizeMyAssessmentAttemptHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
|
||||
export const FinalizeMyAssessmentAttemptHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(finalizeMyAssessmentAttemptHeadersIdempotencyKeyMax).regex(finalizeMyAssessmentAttemptHeadersIdempotencyKeyRegExp)
|
||||
})
|
||||
|
||||
export type FinalizeMyAssessmentAttemptHeaders = zod.input<typeof FinalizeMyAssessmentAttemptHeaders>;
|
||||
export type FinalizeMyAssessmentAttemptHeadersOutput = zod.output<typeof FinalizeMyAssessmentAttemptHeaders>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const findErrorAnswerLineNumbersItemMax = 500;
|
||||
|
||||
export const findErrorAnswerLineNumbersMax = 10;
|
||||
|
||||
|
||||
export const FindErrorAnswer = zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"line_numbers": zod.array(zod.int().min(1).max(findErrorAnswerLineNumbersItemMax)).min(1).max(findErrorAnswerLineNumbersMax)
|
||||
}).describe('Selected line numbers, at most the `max_selections` of the item. Two answers are equal when they select the same set of lines, in any order.')
|
||||
|
||||
export type FindErrorAnswer = zod.input<typeof FindErrorAnswer>;
|
||||
export type FindErrorAnswerOutput = zod.output<typeof FindErrorAnswer>;
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const findErrorItemContentSyntaxMax = 32;
|
||||
|
||||
|
||||
export const findErrorItemContentSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const findErrorItemContentLinesItemNumberMax = 500;
|
||||
|
||||
export const findErrorItemContentLinesItemTextMax = 1000;
|
||||
|
||||
export const findErrorItemContentLinesMax = 500;
|
||||
|
||||
export const findErrorItemContentMaxSelectionsMax = 10;
|
||||
|
||||
|
||||
export const FindErrorItemContent = zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"syntax": zod.string().min(1).max(findErrorItemContentSyntaxMax).regex(findErrorItemContentSyntaxRegExp).nullable().describe('Highlighting hint such as `go`, `python`, or `cisco_ios`, or null.'),
|
||||
"lines": zod.array(zod.object({
|
||||
"number": zod.int().min(1).max(findErrorItemContentLinesItemNumberMax),
|
||||
"text": zod.string().max(findErrorItemContentLinesItemTextMax)
|
||||
}).describe('One numbered line of a code or configuration fragment. Plain text.')).min(1).max(findErrorItemContentLinesMax).describe('Lines numbered from 1 in order.'),
|
||||
"max_selections": zod.int().min(1).max(findErrorItemContentMaxSelectionsMax).describe('Maximum number of lines the answer may select. It is a limit of the task family, fixed for every variant and never derived from the key; it is not the number of wrong lines.')
|
||||
}).describe('Find the lines with the error in a code or configuration fragment and select up to `max_selections` line numbers.')
|
||||
|
||||
export type FindErrorItemContent = zod.input<typeof FindErrorItemContent>;
|
||||
export type FindErrorItemContentOutput = zod.output<typeof FindErrorItemContent>;
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export * from './assessmentAnswer.zod';
|
||||
export * from './assessmentAnswerSubmission.zod';
|
||||
export * from './assessmentAttempt.zod';
|
||||
export * from './assessmentAttemptCreate.zod';
|
||||
export * from './assessmentAttemptState.zod';
|
||||
export * from './assessmentAttemptVersion.zod';
|
||||
export * from './assessmentAvailability.zod';
|
||||
export * from './assessmentDurations.zod';
|
||||
export * from './assessmentFinalization.zod';
|
||||
export * from './assessmentGap.zod';
|
||||
export * from './assessmentGradeAvailability.zod';
|
||||
export * from './assessmentGradeAvailabilityStatus.zod';
|
||||
export * from './assessmentInterval.zod';
|
||||
export * from './assessmentItem.zod';
|
||||
export * from './assessmentItemId.zod';
|
||||
export * from './assessmentLimitation.zod';
|
||||
export * from './assessmentMode.zod';
|
||||
export * from './assessmentNextAction.zod';
|
||||
export * from './assessmentNextStep.zod';
|
||||
export * from './assessmentNotDeterminedReason.zod';
|
||||
export * from './assessmentOption.zod';
|
||||
export * from './assessmentOptionId.zod';
|
||||
export * from './assessmentOutcome.zod';
|
||||
export * from './assessmentPractice.zod';
|
||||
export * from './assessmentPracticeResult.zod';
|
||||
export * from './assessmentProgress.zod';
|
||||
export * from './assessmentResult.zod';
|
||||
export * from './assessmentSessions.zod';
|
||||
export * from './assessmentSpecializationAvailability.zod';
|
||||
export * from './assessmentStrength.zod';
|
||||
export * from './assessmentUncertainty.zod';
|
||||
export * from './assessmentVersionLabel.zod';
|
||||
export * from './assessmentVersions.zod';
|
||||
export * from './basicScore.zod';
|
||||
export * from './calibrationStatus.zod';
|
||||
export * from './choiceAnswer.zod';
|
||||
export * from './choiceItemContent.zod';
|
||||
export * from './codeLine.zod';
|
||||
export * from './configurationAnswer.zod';
|
||||
export * from './configurationItemContent.zod';
|
||||
export * from './createMyAssessmentAttemptBody.zod';
|
||||
export * from './createMyAssessmentAttemptHeaders.zod';
|
||||
export * from './finalizeMyAssessmentAttemptBody.zod';
|
||||
export * from './finalizeMyAssessmentAttemptHeaders.zod';
|
||||
export * from './findErrorAnswer.zod';
|
||||
export * from './findErrorItemContent.zod';
|
||||
export * from './itemContent.zod';
|
||||
export * from './numberAnswer.zod';
|
||||
export * from './numberItemContent.zod';
|
||||
export * from './orderAnswer.zod';
|
||||
export * from './orderItemContent.zod';
|
||||
export * from './practiceAnswer.zod';
|
||||
export * from './practiceExample.zod';
|
||||
export * from './practiceFailureReason.zod';
|
||||
export * from './practiceGroupResult.zod';
|
||||
export * from './practiceItemContent.zod';
|
||||
export * from './practiceKind.zod';
|
||||
export * from './practiceStatus.zod';
|
||||
export * from './practiceVerdict.zod';
|
||||
export * from './stringAnswer.zod';
|
||||
export * from './stringItemContent.zod';
|
||||
export * from './submitMyAssessmentAnswerBody.zod';
|
||||
export * from './submitMyAssessmentAnswerHeaders.zod';
|
||||
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const itemContentOneOptionsItemIdMax = 32;
|
||||
|
||||
|
||||
export const itemContentOneOptionsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const itemContentOneOptionsItemTextMax = 2000;
|
||||
|
||||
export const itemContentOneOptionsMin = 2;
|
||||
export const itemContentOneOptionsMax = 10;
|
||||
|
||||
export const itemContentTwoUnitMax = 32;
|
||||
|
||||
export const itemContentThreeMaxLengthMax = 500;
|
||||
|
||||
export const itemContentFourElementsItemIdMax = 32;
|
||||
|
||||
|
||||
export const itemContentFourElementsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const itemContentFourElementsItemTextMax = 2000;
|
||||
|
||||
export const itemContentFourElementsMin = 2;
|
||||
export const itemContentFourElementsMax = 20;
|
||||
|
||||
export const itemContentFiveSyntaxMax = 32;
|
||||
|
||||
|
||||
export const itemContentFiveSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const itemContentFiveLinesItemNumberMax = 500;
|
||||
|
||||
export const itemContentFiveLinesItemTextMax = 1000;
|
||||
|
||||
export const itemContentFiveLinesMax = 500;
|
||||
|
||||
export const itemContentFiveMaxSelectionsMax = 10;
|
||||
|
||||
export const itemContentSixSyntaxMax = 32;
|
||||
|
||||
|
||||
export const itemContentSixSyntaxRegExp = new RegExp('^[a-z0-9_+-]+$');
|
||||
export const itemContentSixInitialConfigMax = 20000;
|
||||
|
||||
export const itemContentSixMaxLengthMax = 20000;
|
||||
|
||||
export const itemContentSevenLanguagesMax = 2;
|
||||
|
||||
export const itemContentSevenPublicExamplesItemInputMax = 10000;
|
||||
|
||||
export const itemContentSevenPublicExamplesItemExpectedOutputMax = 10000;
|
||||
|
||||
export const itemContentSevenPublicExamplesMax = 10;
|
||||
|
||||
export const itemContentSevenMaxSourceLengthMax = 65536;
|
||||
|
||||
|
||||
export const ItemContent = zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"options": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(itemContentOneOptionsItemIdMax).regex(itemContentOneOptionsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(itemContentOneOptionsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(itemContentOneOptionsMin).max(itemContentOneOptionsMax).describe('Options in the order of this instance.'),
|
||||
"multiple": zod.boolean().describe('Whether more than one option may be selected. It is a property of the task family, fixed for every variant, and never derived from the key: a multiple-choice variant may have a single correct option.')
|
||||
}).describe('Choose one option, or several when `multiple` is true. The content never says which options are correct or how many are.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"unit": zod.string().min(1).max(itemContentTwoUnitMax).nullable().describe('Unit of the expected value, for example `ms`, or null.')
|
||||
}).describe('Enter a number, optionally in the given unit.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"max_length": zod.int().min(1).max(itemContentThreeMaxLengthMax).describe('Maximum length of the answer in characters. It is an input limit of the task family, never derived from the key, so it does not reveal the length of the correct answer.')
|
||||
}).describe('Enter a short string, such as a command, a header name, or an address.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"elements": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(itemContentFourElementsItemIdMax).regex(itemContentFourElementsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(itemContentFourElementsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(itemContentFourElementsMin).max(itemContentFourElementsMax)
|
||||
}).describe('Put every element into the right order. The elements arrive in the order of this instance, which is never the answer.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"syntax": zod.string().min(1).max(itemContentFiveSyntaxMax).regex(itemContentFiveSyntaxRegExp).nullable().describe('Highlighting hint such as `go`, `python`, or `cisco_ios`, or null.'),
|
||||
"lines": zod.array(zod.object({
|
||||
"number": zod.int().min(1).max(itemContentFiveLinesItemNumberMax),
|
||||
"text": zod.string().max(itemContentFiveLinesItemTextMax)
|
||||
}).describe('One numbered line of a code or configuration fragment. Plain text.')).min(1).max(itemContentFiveLinesMax).describe('Lines numbered from 1 in order.'),
|
||||
"max_selections": zod.int().min(1).max(itemContentFiveMaxSelectionsMax).describe('Maximum number of lines the answer may select. It is a limit of the task family, fixed for every variant and never derived from the key; it is not the number of wrong lines.')
|
||||
}).describe('Find the lines with the error in a code or configuration fragment and select up to `max_selections` line numbers.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"syntax": zod.string().min(1).max(itemContentSixSyntaxMax).regex(itemContentSixSyntaxRegExp).describe('Configuration syntax such as `cisco_ios`, `nginx`, or `yaml`.'),
|
||||
"initial_config": zod.string().max(itemContentSixInitialConfigMax).describe('Starting text to edit; empty when the candidate writes it from scratch.'),
|
||||
"max_length": zod.int().min(1).max(itemContentSixMaxLengthMax).describe('Maximum length of the submitted configuration in characters, an input limit of the task family that is never derived from the key.')
|
||||
}).describe('Write or fix a configuration. The server checks the submitted text with the computed key or reference check of the task family; it never executes it as code.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"languages": zod.array(zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.')).max(itemContentSevenLanguagesMax).describe('Languages the solution may use. Empty when the task does not offer a choice; the submission then sends a null language.'),
|
||||
"public_examples": zod.array(zod.object({
|
||||
"input": zod.string().max(itemContentSevenPublicExamplesItemInputMax),
|
||||
"expected_output": zod.string().max(itemContentSevenPublicExamplesItemExpectedOutputMax)
|
||||
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(itemContentSevenPublicExamplesMax),
|
||||
"max_source_length": zod.int().min(1).max(itemContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
|
||||
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
|
||||
|
||||
export type ItemContent = zod.input<typeof ItemContent>;
|
||||
export type ItemContentOutput = zod.output<typeof ItemContent>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const NumberAnswer = zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"number": zod.number()
|
||||
}).describe('Numeric answer in the unit of the item. Two answers are equal when their decoded values are numerically equal, so 254 and 254.0 are the same answer.')
|
||||
|
||||
export type NumberAnswer = zod.input<typeof NumberAnswer>;
|
||||
export type NumberAnswerOutput = zod.output<typeof NumberAnswer>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const numberItemContentUnitMax = 32;
|
||||
|
||||
|
||||
export const NumberItemContent = zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"unit": zod.string().min(1).max(numberItemContentUnitMax).nullable().describe('Unit of the expected value, for example `ms`, or null.')
|
||||
}).describe('Enter a number, optionally in the given unit.')
|
||||
|
||||
export type NumberItemContent = zod.input<typeof NumberItemContent>;
|
||||
export type NumberItemContentOutput = zod.output<typeof NumberItemContent>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const orderAnswerElementIdsItemMax = 32;
|
||||
|
||||
|
||||
export const orderAnswerElementIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const orderAnswerElementIdsMin = 2;
|
||||
export const orderAnswerElementIdsMax = 20;
|
||||
|
||||
|
||||
export const OrderAnswer = zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"element_ids": zod.array(zod.string().min(1).max(orderAnswerElementIdsItemMax).regex(orderAnswerElementIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(orderAnswerElementIdsMin).max(orderAnswerElementIdsMax)
|
||||
}).describe('Every element of the item exactly once, in the chosen order. Two answers are equal only when the sequences are identical.')
|
||||
|
||||
export type OrderAnswer = zod.input<typeof OrderAnswer>;
|
||||
export type OrderAnswerOutput = zod.output<typeof OrderAnswer>;
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const orderItemContentElementsItemIdMax = 32;
|
||||
|
||||
|
||||
export const orderItemContentElementsItemIdRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const orderItemContentElementsItemTextMax = 2000;
|
||||
|
||||
export const orderItemContentElementsMin = 2;
|
||||
export const orderItemContentElementsMax = 20;
|
||||
|
||||
|
||||
export const OrderItemContent = zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"elements": zod.array(zod.object({
|
||||
"id": zod.string().min(1).max(orderItemContentElementsItemIdMax).regex(orderItemContentElementsItemIdRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.'),
|
||||
"text": zod.string().min(1).max(orderItemContentElementsItemTextMax).describe('Text of the option; the client shows it as text, never as HTML.')
|
||||
}).describe('Choice option or order element. Plain text.')).min(orderItemContentElementsMin).max(orderItemContentElementsMax)
|
||||
}).describe('Put every element into the right order. The elements arrive in the order of this instance, which is never the answer.')
|
||||
|
||||
export type OrderItemContent = zod.input<typeof OrderItemContent>;
|
||||
export type OrderItemContentOutput = zod.output<typeof OrderItemContent>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const practiceAnswerSourceCodeMax = 65536;
|
||||
|
||||
|
||||
export const PracticeAnswer = zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('One of the `languages` of the practice item, or null when the item offers none.'),
|
||||
"source_code": zod.string().min(1).max(practiceAnswerSourceCodeMax)
|
||||
}).describe('Practice solution. It runs in the isolated sandbox without network access, secrets, or business data. Two submissions are equal only when the language is the same and the source texts are identical. The source is never echoed in a response or a problem.')
|
||||
|
||||
export type PracticeAnswer = zod.input<typeof PracticeAnswer>;
|
||||
export type PracticeAnswerOutput = zod.output<typeof PracticeAnswer>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const practiceExampleInputMax = 10000;
|
||||
|
||||
export const practiceExampleExpectedOutputMax = 10000;
|
||||
|
||||
|
||||
export const PracticeExample = zod.object({
|
||||
"input": zod.string().max(practiceExampleInputMax),
|
||||
"expected_output": zod.string().max(practiceExampleExpectedOutputMax)
|
||||
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')
|
||||
|
||||
export type PracticeExample = zod.input<typeof PracticeExample>;
|
||||
export type PracticeExampleOutput = zod.output<typeof PracticeExample>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PracticeFailureReason = zod.enum(['sandbox_busy', 'sandbox_error']).describe('Why the sandbox infrastructure returned no verdict: `sandbox_busy` when its queue was full, `sandbox_error` for an infrastructure failure such as a broken executor. Neither depends on the solution; a solution that fails to compile, crashes, or exceeds a limit gets a `finished` verdict instead, so a failure never acts as an oracle for hidden checks.')
|
||||
|
||||
export type PracticeFailureReason = zod.input<typeof PracticeFailureReason>;
|
||||
export type PracticeFailureReasonOutput = zod.output<typeof PracticeFailureReason>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const practiceGroupResultGroupMax = 3;
|
||||
|
||||
|
||||
export const PracticeGroupResult = zod.object({
|
||||
"group": zod.int().min(1).max(practiceGroupResultGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')
|
||||
|
||||
export type PracticeGroupResult = zod.input<typeof PracticeGroupResult>;
|
||||
export type PracticeGroupResultOutput = zod.output<typeof PracticeGroupResult>;
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const practiceItemContentLanguagesMax = 2;
|
||||
|
||||
export const practiceItemContentPublicExamplesItemInputMax = 10000;
|
||||
|
||||
export const practiceItemContentPublicExamplesItemExpectedOutputMax = 10000;
|
||||
|
||||
export const practiceItemContentPublicExamplesMax = 10;
|
||||
|
||||
export const practiceItemContentMaxSourceLengthMax = 65536;
|
||||
|
||||
|
||||
export const PracticeItemContent = zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"languages": zod.array(zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.')).max(practiceItemContentLanguagesMax).describe('Languages the solution may use. Empty when the task does not offer a choice; the submission then sends a null language.'),
|
||||
"public_examples": zod.array(zod.object({
|
||||
"input": zod.string().max(practiceItemContentPublicExamplesItemInputMax),
|
||||
"expected_output": zod.string().max(practiceItemContentPublicExamplesItemExpectedOutputMax)
|
||||
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(practiceItemContentPublicExamplesMax),
|
||||
"max_source_length": zod.int().min(1).max(practiceItemContentMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
|
||||
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')
|
||||
|
||||
export type PracticeItemContent = zod.input<typeof PracticeItemContent>;
|
||||
export type PracticeItemContentOutput = zod.output<typeof PracticeItemContent>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PracticeKind = zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.')
|
||||
|
||||
export type PracticeKind = zod.input<typeof PracticeKind>;
|
||||
export type PracticeKindOutput = zod.output<typeof PracticeKind>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const PracticeStatus = zod.enum(['not_started', 'pending', 'finished', 'failed']).describe('State of a practice.\n\n- not_started: no solution was submitted yet.\n- pending: the submitted solution is queued or running in the sandbox.\n- finished: the sandbox ran the solution and returned a verdict; `verdict` holds it. Every outcome caused by the solution itself, such as a compilation error, a runtime error, a time limit, or a memory limit, is `finished` with the affected groups not passed.\n- failed: the sandbox infrastructure could not run the solution, for example because its queue was full or an executor broke, independently of the solution. The failure is not the candidate\'s and consumes nothing; the practice can be submitted again.')
|
||||
|
||||
export type PracticeStatus = zod.input<typeof PracticeStatus>;
|
||||
export type PracticeStatusOutput = zod.output<typeof PracticeStatus>;
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const practiceVerdictScoreMin = 0;
|
||||
export const practiceVerdictScoreMax = 3;
|
||||
|
||||
export const practiceVerdictMaxScoreMin = 3;
|
||||
export const practiceVerdictMaxScoreMax = 3;
|
||||
|
||||
export const practiceVerdictGroupsItemGroupMax = 3;
|
||||
|
||||
export const practiceVerdictGroupsMin = 3;
|
||||
export const practiceVerdictGroupsMax = 3;
|
||||
|
||||
|
||||
export const PracticeVerdict = zod.object({
|
||||
"score": zod.int().min(practiceVerdictScoreMin).max(practiceVerdictScoreMax),
|
||||
"max_score": zod.int().min(practiceVerdictMaxScoreMin).max(practiceVerdictMaxScoreMax),
|
||||
"groups": zod.array(zod.object({
|
||||
"group": zod.int().min(1).max(practiceVerdictGroupsItemGroupMax),
|
||||
"passed": zod.boolean()
|
||||
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(practiceVerdictGroupsMin).max(practiceVerdictGroupsMax)
|
||||
}).describe('Verdict of a practice solution on the hidden checks: the score 0-3, one point for each passed group. The hidden checks, their inputs and outputs, error output, and seeds are never returned.')
|
||||
|
||||
export type PracticeVerdict = zod.input<typeof PracticeVerdict>;
|
||||
export type PracticeVerdictOutput = zod.output<typeof PracticeVerdict>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const stringAnswerTextMax = 500;
|
||||
|
||||
|
||||
export const StringAnswer = zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"text": zod.string().min(1).max(stringAnswerTextMax)
|
||||
}).describe('String answer, at most the `max_length` of the item. Two answers are equal only when their texts are identical; no trimming, case folding, or Unicode normalization applies to that comparison.')
|
||||
|
||||
export type StringAnswer = zod.input<typeof StringAnswer>;
|
||||
export type StringAnswerOutput = zod.output<typeof StringAnswer>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const stringItemContentMaxLengthMax = 500;
|
||||
|
||||
|
||||
export const StringItemContent = zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"max_length": zod.int().min(1).max(stringItemContentMaxLengthMax).describe('Maximum length of the answer in characters. It is an input limit of the task family, never derived from the key, so it does not reveal the length of the correct answer.')
|
||||
}).describe('Enter a short string, such as a command, a header name, or an address.')
|
||||
|
||||
export type StringItemContent = zod.input<typeof StringItemContent>;
|
||||
export type StringItemContentOutput = zod.output<typeof StringItemContent>;
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerOneOptionIdsItemMax = 32;
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerOneOptionIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const submitMyAssessmentAnswerBodyAnswerOneOptionIdsMax = 10;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerThreeTextMax = 500;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerFourElementIdsItemMax = 32;
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerFourElementIdsItemRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
export const submitMyAssessmentAnswerBodyAnswerFourElementIdsMin = 2;
|
||||
export const submitMyAssessmentAnswerBodyAnswerFourElementIdsMax = 20;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerFiveLineNumbersItemMax = 500;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerFiveLineNumbersMax = 10;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerSixConfigMax = 20000;
|
||||
|
||||
export const submitMyAssessmentAnswerBodyAnswerSevenSourceCodeMax = 65536;
|
||||
|
||||
|
||||
export const SubmitMyAssessmentAnswerBody = zod.object({
|
||||
"expected_version": zod.int().min(1).describe('Version of an assessment attempt. A new attempt has version 1, and each committed change advances it by exactly one: an accepted answer, a practice submission or resubmission, a verdict, a decision of finalize, a session start, and a server-side transition such as expiry or automatic finalization. A transition that the server applies when the attempt is read is committed before the response and also advances it. A rejected command and a repeat that stores nothing leave it unchanged. Commands send the version they read as `expected_version`.'),
|
||||
"item_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"answer": zod.union([zod.object({
|
||||
"format": zod.enum(['choice']),
|
||||
"option_ids": zod.array(zod.string().min(1).max(submitMyAssessmentAnswerBodyAnswerOneOptionIdsItemMax).regex(submitMyAssessmentAnswerBodyAnswerOneOptionIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(1).max(submitMyAssessmentAnswerBodyAnswerOneOptionIdsMax)
|
||||
}).describe('Selected options of a choice item: exactly one unless the item allows several. Two answers are equal when they select the same set of options, in any order.'),zod.object({
|
||||
"format": zod.enum(['number']),
|
||||
"number": zod.number()
|
||||
}).describe('Numeric answer in the unit of the item. Two answers are equal when their decoded values are numerically equal, so 254 and 254.0 are the same answer.'),zod.object({
|
||||
"format": zod.enum(['string']),
|
||||
"text": zod.string().min(1).max(submitMyAssessmentAnswerBodyAnswerThreeTextMax)
|
||||
}).describe('String answer, at most the `max_length` of the item. Two answers are equal only when their texts are identical; no trimming, case folding, or Unicode normalization applies to that comparison.'),zod.object({
|
||||
"format": zod.enum(['order']),
|
||||
"element_ids": zod.array(zod.string().min(1).max(submitMyAssessmentAnswerBodyAnswerFourElementIdsItemMax).regex(submitMyAssessmentAnswerBodyAnswerFourElementIdsItemRegExp).describe('Opaque identifier of a choice option or an order element within one item instance. It is unrelated to the position or correctness of the option.')).min(submitMyAssessmentAnswerBodyAnswerFourElementIdsMin).max(submitMyAssessmentAnswerBodyAnswerFourElementIdsMax)
|
||||
}).describe('Every element of the item exactly once, in the chosen order. Two answers are equal only when the sequences are identical.'),zod.object({
|
||||
"format": zod.enum(['find_error']),
|
||||
"line_numbers": zod.array(zod.int().min(1).max(submitMyAssessmentAnswerBodyAnswerFiveLineNumbersItemMax)).min(1).max(submitMyAssessmentAnswerBodyAnswerFiveLineNumbersMax)
|
||||
}).describe('Selected line numbers, at most the `max_selections` of the item. Two answers are equal when they select the same set of lines, in any order.'),zod.object({
|
||||
"format": zod.enum(['configuration']),
|
||||
"config": zod.string().min(1).max(submitMyAssessmentAnswerBodyAnswerSixConfigMax)
|
||||
}).describe('Submitted configuration text, at most the `max_length` of the item. Two answers are equal only when their texts are identical, including whitespace and line breaks.'),zod.object({
|
||||
"format": zod.enum(['practice']),
|
||||
"language": zod.union([zod.enum(['python', 'go']).describe('Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate\'s platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.'),zod.null()]).describe('One of the `languages` of the practice item, or null when the item offers none.'),
|
||||
"source_code": zod.string().min(1).max(submitMyAssessmentAnswerBodyAnswerSevenSourceCodeMax)
|
||||
}).describe('Practice solution. It runs in the isolated sandbox without network access, secrets, or business data. Two submissions are equal only when the language is the same and the source texts are identical. The source is never echoed in a response or a problem.')]).describe('Candidate answer, selected by `format`, which must equal the format of the answered item. It carries only the answer: no score, duration, correctness flag, or seed. The server records the times itself and scores the answer with the key of the fixed item instance. Each format defines when two answers are equal, which decides whether a repeated submission is the same answer.')
|
||||
}).describe('Answer to one item of the attempt. Unknown fields are rejected, so a request cannot send a score, a duration, or a correctness flag.')
|
||||
|
||||
export type SubmitMyAssessmentAnswerBody = zod.input<typeof SubmitMyAssessmentAnswerBody>;
|
||||
export type SubmitMyAssessmentAnswerBodyOutput = zod.output<typeof SubmitMyAssessmentAnswerBody>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const submitMyAssessmentAnswerHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
|
||||
export const SubmitMyAssessmentAnswerHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(submitMyAssessmentAnswerHeadersIdempotencyKeyMax).regex(submitMyAssessmentAnswerHeadersIdempotencyKeyRegExp)
|
||||
})
|
||||
|
||||
export type SubmitMyAssessmentAnswerHeaders = zod.input<typeof SubmitMyAssessmentAnswerHeaders>;
|
||||
export type SubmitMyAssessmentAnswerHeadersOutput = zod.output<typeof SubmitMyAssessmentAnswerHeaders>;
|
||||
@@ -14,6 +14,7 @@ export * from './problemFieldLocation.zod';
|
||||
export * from './specializationCode.zod';
|
||||
export * from './taskLanguage.zod';
|
||||
export * from './timestamp.zod';
|
||||
export * from './assessment';
|
||||
export * from './candidate';
|
||||
export * from './catalog';
|
||||
export * from './health';
|
||||
|
||||
Reference in new issue
Block a user