Files
lincodex/frontend/src/shared/api/schemas/assessment/assessmentItem.zod.ts
T

115 lines
9.0 KiB
TypeScript

/**
* 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>;