feat(assessment): watermark the task text of real attempts

This commit is contained in:
shira committed 2026-10-11 10:44:30 +03:00
1 parent 24b64d698a
commit c975a0d506
57 files changed
+2429 -92

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ The attempt screen focuses on the item: a strip above it names the attempt and s
The `Idempotency-Key` of the express start is kept in the tab's sessionStorage per account until the run is finished or expired, and for 24 hours at most. When a new start gets 409 `state_conflict`, the page repeats the start with the key of the active run, and the server returns the stored 201 with that attempt: an unfinished demonstration continues after a reload. The key of a start with an unknown outcome (no response, 5xx) is kept and repeated as well. Without a key (another browser, a closed tab, blocked storage), the screen explains that the demonstration ends by itself within 5 minutes of its start.
Before a real attempt starts, the screen shows a dialog that lists the signals. The browser records tab or window switches, copy, paste and cut, and fullscreen exits; the server measures the answer time per item, a change of network address during the attempt, parallel sessions, and the match of answer digests with other candidates' answers. The dialog states that image, sound, and clipboard contents are not collected, that addresses and session tokens are not stored (only one-way keyed digests), and that browser events are stored only while the C3 consent is current. The attempt cannot start without confirmation: closing the dialog or pressing Escape starts nothing. The dialog also lists the measures the page applies during the attempt (fullscreen, covering the task when the candidate leaves, blocks on copying, selecting, and printing the task text, the paste rule, and a watermark that is announced as planned and not used yet). This is notice text version 2; an acknowledgement of version 1 does not count for it. The confirmation is stored on the server (`/me/assessment-signal-notice`) for the text version, so a reload or a new browser does not ask again; the same dialog opens when an older attempt that was created without the confirmation is resumed. It is a record of being informed, not a consent: C3 stays separate.
Before a real attempt starts, the screen shows a dialog that lists the signals. The browser records tab or window switches, copy, paste and cut, and fullscreen exits; the server measures the answer time per item, a change of network address during the attempt, parallel sessions, and the match of answer digests with other candidates' answers. The dialog states that image, sound, and clipboard contents are not collected, that addresses and session tokens are not stored (only one-way keyed digests), and that browser events are stored only while the C3 consent is current. The attempt cannot start without confirmation: closing the dialog or pressing Escape starts nothing. The dialog also lists the measures the page applies during the attempt (fullscreen, covering the task when the candidate leaves, blocks on copying, selecting, and printing the task text, the paste rule, and the watermark: a faint tile with the attempt code and the time and an invisible mark in the task text). This is notice text version 3; an acknowledgement of an earlier version does not count for it. The confirmation is stored on the server (`/me/assessment-signal-notice`) for the text version, so a reload or a new browser does not ask again; the same dialog opens when an older attempt that was created without the confirmation is resumed. It is a record of being informed, not a consent: C3 stays separate.
During a real attempt, `features/assessment-signals` collects the disclosed signals: focus loss with its duration, copy, paste and cut with a size only, and fullscreen exit. The collector's listeners are passive, block nothing, and show nothing (the measures of the next paragraph are a separate feature and do not depend on it). Events go in batches (every 10 seconds, when the tab is hidden, or at 20 queued events), and each batch keeps one `Idempotency-Key` across retries. When the page is closed (`pagehide`) or the collector unmounts, what remains is sent in one last request with `keepalive`, so closing the tab does not lose the last seconds of events; the result of that request is not awaited and not retried. A network failure never affects answer submission: a failed batch is sent again with the same key and body after a growing pause and is dropped after the attempt limit. A server refusal (no C3, finished attempt) stops collection. The demonstration run collects no signals.
+1 -1
View File
@@ -69,7 +69,7 @@ SPA на React и TypeScript со сборкой Vite и структурой FS
`Idempotency-Key` начала экспресс-запуска хранится в sessionStorage вкладки отдельно для каждого аккаунта, пока запуск не завершен или не истек, и не дольше 24 часов. Если новое начало получает 409 `state_conflict`, страница повторяет начало с ключом активного запуска, и сервер возвращает сохраненный ответ 201 с этой попыткой: незавершенная демонстрация продолжается после перезагрузки. Ключ начала с неизвестным исходом (нет ответа, 5xx) тоже сохраняется и повторяется. Если ключа нет (другой браузер, закрытая вкладка, заблокированное хранилище), экран объясняет, что демонстрация закончится сама не позже чем через 5 минут после начала.
Перед началом реальной попытки экран показывает окно с перечнем сигналов. Браузер фиксирует смену вкладки или окна, копирование, вставку и вырезание, выход из полноэкранного режима; сервер измеряет время ответа на задание, смену сетевого адреса во время попытки, параллельные сессии и совпадение отпечатков ответов с ответами других кандидатов. Окно прямо говорит, что изображение, звук и содержимое буфера обмена не собираются, что адреса и токены сессий не хранятся (только односторонние ключевые отпечатки) и что события браузера сохраняются, только пока действует согласие C3. Начало без подтверждения невозможно: закрытие окна или Escape ничего не запускает. Окно также перечисляет меры, которые страница применяет во время попытки (полноэкранный режим, скрытие задания при уходе, запрет копирования, выделения и печати текста задания, правило вставки и водяной знак, который объявлен как планируемый и пока не используется). Это версия 2 текста уведомления; подтверждение версии 1 для нее не засчитывается. Подтверждение сохраняется на сервере (`/me/assessment-signal-notice`) для версии текста, поэтому перезагрузка и новый браузер не спрашивают повторно; такое же окно открывается при продолжении старой попытки, начатой без подтверждения. Это запись об ознакомлении, а не согласие: C3 остается отдельным.
Перед началом реальной попытки экран показывает окно с перечнем сигналов. Браузер фиксирует смену вкладки или окна, копирование, вставку и вырезание, выход из полноэкранного режима; сервер измеряет время ответа на задание, смену сетевого адреса во время попытки, параллельные сессии и совпадение отпечатков ответов с ответами других кандидатов. Окно прямо говорит, что изображение, звук и содержимое буфера обмена не собираются, что адреса и токены сессий не хранятся (только односторонние ключевые отпечатки) и что события браузера сохраняются, только пока действует согласие C3. Начало без подтверждения невозможно: закрытие окна или Escape ничего не запускает. Окно также перечисляет меры, которые страница применяет во время попытки (полноэкранный режим, скрытие задания при уходе, запрет копирования, выделения и печати текста задания, правило вставки и водяной знак: бледная плитка с кодом попытки и временем и невидимая метка в тексте задания). Это версия 3 текста уведомления; подтверждение более ранней версии для нее не засчитывается. Подтверждение сохраняется на сервере (`/me/assessment-signal-notice`) для версии текста, поэтому перезагрузка и новый браузер не спрашивают повторно; такое же окно открывается при продолжении старой попытки, начатой без подтверждения. Это запись об ознакомлении, а не согласие: C3 остается отдельным.
Во время реальной попытки `features/assessment-signals` собирает отправляемые сигналы: потерю фокуса с длительностью, копирование, вставку и вырезание только с размером, выход из полноэкранного режима. Слушатели сборщика пассивные, ничего не блокируют и не показывают (меры из следующего абзаца - отдельная функция и от сборщика не зависят); события уходят пакетами (по таймеру в 10 секунд, при скрытии вкладки или накоплении 20 событий), у каждого пакета свой `Idempotency-Key`, который сохраняется при повторах. При закрытии страницы (`pagehide`) и при размонтировании оставшиеся события отправляются последним запросом с `keepalive`, поэтому закрытие вкладки не теряет накопленное за последние секунды; результат такого запроса не ожидается и не повторяется. Сбой сети никогда не мешает отправке ответа: неудачный пакет повторяется с тем же ключом и телом с нарастающей паузой, а после лимита попыток отбрасывается. Ответ сервера об отказе (нет C3, попытка завершена) останавливает сбор. Демонстрационный запуск сигналы не собирает.
+16 -6
View File
@@ -44,17 +44,26 @@ export type MockedAttempt = {
acknowledgements: unknown[];
};
export const watermarkCode = "7K3QD-9XM2T";
/** The notice text version the page knows; the mock server requires the same one. */
export const noticeVersion = 3;
type Options = {
content: MockItemContent;
/** The candidate already acknowledged the notice, so the start asks nothing. */
noticeAcknowledged?: boolean;
/** The task text the server sends, with its invisible mark when it has one. */
prompt?: string;
/** The visible code of the attempt, or null for an attempt without one. */
watermark?: string | null;
};
function isoSeconds(ms: number): string {
return `${new Date(ms).toISOString().slice(0, 19)}Z`;
}
function attemptBody(version: number, content: MockItemContent) {
function attemptBody(version: number, options: Options) {
const { content, prompt = taskPrompt, watermark = watermarkCode } = options;
return {
id: attemptId,
version,
@@ -76,8 +85,9 @@ function attemptBody(version: number, content: MockItemContent) {
sessions: { used: 1, max: 2, idle_timeout_seconds: 1800 },
finished_at: null,
progress: { answered_items: 0, max_items: 5 },
current_item: { id: itemId, sequence: 1, prompt: taskPrompt, content },
current_item: { id: itemId, sequence: 1, prompt, content },
practices: [],
...(watermark ? { watermark: { code: watermark } } : {}),
};
}
@@ -118,16 +128,16 @@ export async function mockAttemptApi(page: Page, options: Options): Promise<Mock
recorded.acknowledgements.push(JSON.parse(request.postData() ?? "{}"));
}
return reply({
notice_version: 2,
notice_version: noticeVersion,
acknowledged,
acknowledged_at: acknowledged ? "2026-10-10T10:00:00Z" : null,
});
}
if (path === base && method === "GET") return reply(attemptBody(1, options.content));
if (path === `${base}/sessions`) return reply(attemptBody(2, options.content));
if (path === base && method === "GET") return reply(attemptBody(1, options));
if (path === `${base}/sessions`) return reply(attemptBody(2, options));
if (path === `${base}/answers`) {
recorded.answers.push(JSON.parse(request.postData() ?? "{}"));
return reply(attemptBody(3, options.content));
return reply(attemptBody(3, options));
}
if (path === `${base}/signals`) {
const body = JSON.parse(request.postData() ?? "{}") as { events: SignalEvent[] };
+2 -1
View File
@@ -3,6 +3,7 @@ import {
attemptId,
isFullscreen,
mockAttemptApi,
noticeVersion,
numberContent,
setTabHidden,
startAttempt,
@@ -156,5 +157,5 @@ test("closing the notice without confirming leaves fullscreen and starts nothing
await page.getByRole("button", { name: "Подтверждаю ознакомление и начинаю" }).click();
await expect(page.getByRole("heading", { name: "Задание 1" })).toBeVisible();
await expect.poll(() => isFullscreen(page)).toBe(true);
expect(recorded.acknowledgements).toEqual([{ notice_version: 2 }]);
expect(recorded.acknowledgements).toEqual([{ notice_version: noticeVersion }]);
});
+82
View File
@@ -0,0 +1,82 @@
import { expect, test } from "@playwright/test";
import {
mockAttemptApi,
numberContent,
startAttempt,
watermarkCode,
} from "./assessment-attempt-mock";
// The watermark of a real attempt: a faint visible tile with the attempt code and
// the time, and an invisible mark in the task text that assistive technology
// never meets. The API is mocked: these specs check what the page does with the
// mark the server sends, not how the server makes it.
const mark = "\u200b\u200c\u200d\u2060\u200b\u200c";
const markedPrompt = `SECRET-PROMPT: which HTTP status ${mark}code means that a resource ${mark}was created?`;
const readablePrompt = "SECRET-PROMPT: which HTTP status code means that a resource was created?";
test.use({ actionTimeout: 10_000, trace: "off", screenshot: "off", video: "off" });
test("the task screen shows a faint tile with the attempt code and the time, and nothing personal", async ({
page,
}) => {
await mockAttemptApi(page, { content: numberContent });
await startAttempt(page);
await expect(page.getByRole("heading", { name: "Задание 1" })).toBeVisible();
const tile = page.getByTestId("watermark-tile");
await expect(tile).toHaveAttribute("data-code", watermarkCode);
await expect(tile).toHaveAttribute("aria-hidden", "true");
const text = (await tile.textContent()) ?? "";
expect(text).toMatch(new RegExp(`${watermarkCode} \\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}Z`));
// The tile carries no name or contact of the candidate: the mocked account has an e-mail.
expect(text).not.toContain("candidate@example.test");
expect(text).not.toContain("@");
// It is faint, it covers the screen, and it takes no click.
const style = await tile.evaluate((element) => {
const mark = element.firstElementChild as HTMLElement;
return {
opacity: Number(getComputedStyle(mark).opacity),
pointerEvents: getComputedStyle(element).pointerEvents,
position: getComputedStyle(element).position,
};
});
expect(style.opacity).toBeGreaterThan(0.02);
expect(style.opacity).toBeLessThan(0.15);
expect(style.pointerEvents).toBe("none");
expect(style.position).toBe("fixed");
await page.getByRole("textbox", { name: /^Числовой ответ/ }).fill("201");
await expect(page.getByRole("textbox", { name: /^Числовой ответ/ })).toHaveValue("201");
});
test("an attempt without a watermark shows no tile", async ({ page }) => {
await mockAttemptApi(page, { content: numberContent, watermark: null });
await startAttempt(page);
await expect(page.getByRole("heading", { name: "Задание 1" })).toBeVisible();
await expect(page.getByTestId("watermark-tile")).toHaveCount(0);
});
test("the invisible mark stays in the page but out of the accessibility tree", async ({ page }) => {
await mockAttemptApi(page, { content: numberContent, prompt: markedPrompt });
await startAttempt(page);
await expect(page.getByRole("heading", { name: "Задание 1" })).toBeVisible();
const prompt = page.locator("article p").first();
// The page keeps the mark, so that anything taken out of the page carries it.
expect(await prompt.evaluate((element) => element.textContent)).toBe(markedPrompt);
// Every run of invisible characters sits in an element hidden from assistive technology.
const hidden = await prompt.evaluate((element) => {
const runs = [...element.querySelectorAll("[data-watermark-mark]")];
return {
count: runs.length,
allHidden: runs.every((run) => run.getAttribute("aria-hidden") === "true"),
};
});
expect(hidden).toEqual({ count: 2, allHidden: true });
// The accessibility tree holds the words and no format character.
const snapshot = await prompt.ariaSnapshot();
expect(snapshot).toContain(readablePrompt);
expect(snapshot).not.toMatch(/[\u200b-\u200d\u2060]/u);
});
+1 -1
View File
@@ -806,7 +806,7 @@ test("closing the notice does not start the attempt and a confirmation is rememb
await page.getByRole("button", { name: "Закрыть без подтверждения" }).click();
await expect(dialog).toBeHidden();
expect(creates).toHaveLength(0);
expect(await readNotice(page)).toMatchObject({ acknowledged: false, notice_version: 2 });
expect(await readNotice(page)).toMatchObject({ acknowledged: false, notice_version: 3 });
await start.click();
await expect(dialog).toBeVisible();
@@ -3,7 +3,7 @@
* candidate acknowledged; change this number together with the text and with
* the version the server requires, so that everyone acknowledges the new text.
*/
export const knownSignalNoticeVersion = 2;
export const knownSignalNoticeVersion = 3;
export type DisclosedSignal = { code: string; title: string; detail: string };
@@ -57,7 +57,8 @@ export const attemptMeasures: readonly DisclosedSignal[] = [
{
code: "watermark",
title: "Водяной знак на странице задания",
detail: "Планируется. Пока не используется.",
detail:
"Бледная плитка с кодом попытки и временем поверх экрана задания и невидимая метка в тексте задания. В них нет имени и контактов. Они не мешают чтению с экрана и ничего не запрещают: по снимку экрана или скопированному тексту можно проверить, из какой попытки они взяты.",
},
];
@@ -4,8 +4,8 @@ import { knownSignalNoticeVersion } from "../model/notice-content";
import { SignalNoticeContent, SignalNoticeDialog, SignalNoticeSummary } from "./signal-notice";
describe("signal notice", () => {
it("is version 2, the text that added the attempt measures", () => {
expect(knownSignalNoticeVersion).toBe(2);
it("is version 3, the text that describes the watermark", () => {
expect(knownSignalNoticeVersion).toBe(3);
});
it("lists every measure the page applies during a real attempt", () => {
@@ -19,7 +19,9 @@ describe("signal notice", () => {
expect(markup).toContain("Вставка в поля ответа");
expect(markup).toContain("В редакторе кода вставка разрешена");
expect(markup).toContain("Водяной знак на странице задания");
expect(markup).toContain("Планируется");
expect(markup).toContain("Бледная плитка с кодом попытки и временем");
expect(markup).toContain("невидимая метка в тексте задания");
expect(markup).not.toContain("Планируется");
});
it("says that keyboard input and screen readers keep working", () => {
@@ -0,0 +1,4 @@
export { accessibleText, splitWatermarkedText } from "./model/watermark-text";
export { formatWatermarkTime } from "./model/watermark-time";
export { WatermarkedText } from "./ui/watermarked-text";
export { WatermarkTile } from "./ui/watermark-tile";
@@ -0,0 +1,17 @@
import { useEffect, useState } from "react";
import { formatWatermarkTime } from "./watermark-time";
const refreshMilliseconds = 15_000;
/** The tile time, refreshed so that it is never more than a minute behind. */
export function useWatermarkTime(): string {
const [time, setTime] = useState(() => formatWatermarkTime(new Date()));
useEffect(() => {
const timer = window.setInterval(() => {
// The same string keeps the state, so the tile re-renders once a minute.
setTime(formatWatermarkTime(new Date()));
}, refreshMilliseconds);
return () => window.clearInterval(timer);
}, []);
return time;
}
@@ -0,0 +1,43 @@
import { describe, expect, it } from "vitest";
import { accessibleText, splitWatermarkedText } from "./watermark-text";
const ZWSP = "\u200b";
const ZWNJ = "\u200c";
const ZWJ = "\u200d";
const WORD_JOINER = "\u2060";
const run = `${ZWSP}${ZWNJ}${ZWJ}${WORD_JOINER}${ZWSP}${ZWSP}`;
const statement = "A cache holds at most 3 entries. A read of a missing key is not a hit.";
const marked = `A cache ${run}holds at most 3 entries. ${run}A read of a missing key is not a hit.`;
describe("watermarked task text", () => {
it("separates the readable words from the invisible runs without losing either", () => {
const segments = splitWatermarkedText(marked);
expect(segments.filter((segment) => segment.kind === "mark")).toHaveLength(2);
expect(segments.map((segment) => segment.value).join("")).toBe(marked);
for (const segment of segments) {
if (segment.kind === "mark") expect(segment.value).toBe(run);
}
});
it("reads exactly the words of the task for assistive technology", () => {
expect(accessibleText(marked)).toBe(statement);
// No format character is left for a screen reader to announce.
expect(accessibleText(marked)).not.toMatch(/\p{Cf}/u);
});
it("handles runs at the edges and a text without a mark", () => {
expect(accessibleText(`${run}text${run}`)).toBe("text");
expect(splitWatermarkedText(`${run}text${run}`).map((segment) => segment.kind)).toEqual([
"mark",
"text",
"mark",
]);
expect(splitWatermarkedText("plain")).toEqual([{ kind: "text", value: "plain" }]);
expect(splitWatermarkedText("")).toEqual([]);
});
it("keeps Cyrillic text and ordinary punctuation as they are", () => {
const text = `Сколько запросов отклонено? ${run}Ответ: число.`;
expect(accessibleText(text)).toBe("Сколько запросов отклонено? Ответ: число.");
});
});
@@ -0,0 +1,41 @@
/**
* The server marks the task text of a real attempt with invisible characters
* (the zero width space, the non-joiner, the joiner, the word joiner) and picks
* interchangeable wordings. The wordings read like any other text. The
* invisible characters are format characters of Unicode; the client keeps them
* out of the accessibility tree, so a screen reader or a braille display never
* meets them, and leaves them in the text so that a copy of the page keeps the
* mark.
*/
export type TextSegment = { kind: "text" | "mark"; value: string };
/** The mark characters. The client treats every Unicode format character alike. */
const markRun = /[\p{Cf}]+/gu;
/** Splits a text into the readable stretches and the runs of invisible characters. */
export function splitWatermarkedText(text: string): TextSegment[] {
const segments: TextSegment[] = [];
let position = 0;
for (const match of text.matchAll(markRun)) {
if (match.index > position) {
segments.push({ kind: "text", value: text.slice(position, match.index) });
}
segments.push({ kind: "mark", value: match[0] });
position = match.index + match[0].length;
}
if (position < text.length) segments.push({ kind: "text", value: text.slice(position) });
return segments;
}
/**
* The text that assistive technology reads: the segments that are not marks.
* The page renders marks in elements hidden from the accessibility tree, so
* this is the accessible name content of the task text.
*/
export function accessibleText(text: string): string {
return splitWatermarkedText(text)
.filter((segment) => segment.kind === "text")
.map((segment) => segment.value)
.join("");
}
@@ -0,0 +1,9 @@
/**
* The time on the tile, to the minute and in UTC with an explicit `Z`, so that
* a screenshot taken in any time zone reads the same way against the server
* clock. It is the clock of the device: an operator treats it as a hint next to
* the code, never as proof.
*/
export function formatWatermarkTime(moment: Date): string {
return `${moment.toISOString().slice(0, 16).replace("T", " ")}Z`;
}
@@ -0,0 +1,24 @@
/* The tile covers the viewport and lets every click through. Its marks are
* faint enough not to disturb reading and dark enough to survive a screenshot. */
.tile {
position: fixed;
z-index: 25;
inset: 0;
overflow: hidden;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 1fr;
place-items: center;
transform: rotate(-18deg) scale(1.4);
pointer-events: none;
user-select: none;
}
.mark {
color: var(--color-text-strong);
font-family: var(--font-mono);
font-size: var(--font-size-s);
letter-spacing: 0.04em;
white-space: nowrap;
opacity: 0.07;
}
@@ -0,0 +1,24 @@
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { formatWatermarkTime } from "../model/watermark-time";
import { WatermarkTile } from "./watermark-tile";
describe("watermark tile", () => {
it("shows the pseudonymous code with the time and nothing about the candidate", () => {
const markup = renderToStaticMarkup(<WatermarkTile code="7K3QD-9XM2T" />);
expect(markup).toContain("7K3QD-9XM2T");
expect(markup).toMatch(/7K3QD-9XM2T \d{4}-\d{2}-\d{2} \d{2}:\d{2}Z/);
expect(markup).not.toMatch(/@|\+\d{6,}|candidate|email/i);
});
it("is hidden from assistive technology and marked for the page checks", () => {
const markup = renderToStaticMarkup(<WatermarkTile code="7K3QD-9XM2T" />);
expect(markup).toContain('aria-hidden="true"');
expect(markup).toContain('data-testid="watermark-tile"');
expect(markup).toContain('data-code="7K3QD-9XM2T"');
});
it("writes the time to the minute in UTC", () => {
expect(formatWatermarkTime(new Date("2026-10-11T07:42:59.900Z"))).toBe("2026-10-11 07:42Z");
});
});
@@ -0,0 +1,30 @@
import { useWatermarkTime } from "../model/use-watermark-time";
import styles from "./watermark-tile.module.css";
type WatermarkTileProps = {
/** The pseudonymous attempt code from the server. */
code: string;
};
const rows = 8;
const columns = 3;
/**
* A faint tile over the task screen: the attempt code and the time, repeated.
* A screenshot or a photo of the screen carries it, and an operator can trace
* the image to the attempt. It holds no name, e-mail, or other contact, it is
* hidden from assistive technology, and it never takes a click.
*/
export function WatermarkTile({ code }: WatermarkTileProps) {
const time = useWatermarkTime();
const label = `${code} ${time}`;
return (
<div className={styles.tile} aria-hidden="true" data-testid="watermark-tile" data-code={code}>
{Array.from({ length: rows * columns }, (_, index) => (
<span key={index} className={styles.mark}>
{label}
</span>
))}
</div>
);
}
@@ -0,0 +1,43 @@
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { accessibleText } from "../model/watermark-text";
import { WatermarkedText } from "./watermarked-text";
const run = "\u200b\u200c\u200d\u2060";
const marked = `The gateway ${run}rejects requests. ${run}How many?`;
/**
* The accessible text of the markup: what is left after the elements hidden
* from the accessibility tree and the tags themselves are removed, which is
* what a screen reader would read from this fragment.
*/
function readByAssistiveTechnology(markup: string): string {
return markup.replace(/<span aria-hidden="true"[^>]*>[^<]*<\/span>/g, "").replace(/<[^>]+>/g, "");
}
describe("watermarked text", () => {
it("puts every invisible run in an element hidden from assistive technology", () => {
const markup = renderToStaticMarkup(
<p>
<WatermarkedText text={marked} />
</p>,
);
expect(markup.match(/aria-hidden="true"/g)).toHaveLength(2);
expect(markup).toContain(run);
});
it("leaves a screen reader exactly the words of the task", () => {
const markup = renderToStaticMarkup(
<p>
<WatermarkedText text={marked} />
</p>,
);
expect(readByAssistiveTechnology(markup)).toBe("The gateway rejects requests. How many?");
expect(readByAssistiveTechnology(markup)).toBe(accessibleText(marked));
expect(readByAssistiveTechnology(markup)).not.toMatch(/\p{Cf}/u);
});
it("renders a text without a mark as it is", () => {
expect(renderToStaticMarkup(<WatermarkedText text="No mark here." />)).toBe("No mark here.");
});
});
@@ -0,0 +1,28 @@
import { splitWatermarkedText } from "../model/watermark-text";
type WatermarkedTextProps = {
/** The task text as the server sent it, with the invisible mark in it. */
text: string;
};
/**
* Shows the task text. The runs of invisible characters go into elements that
* are hidden from assistive technology, so the accessible text is exactly the
* words of the task. The characters stay in the document, which keeps the mark
* in anything copied from the page.
*/
export function WatermarkedText({ text }: WatermarkedTextProps) {
return (
<>
{splitWatermarkedText(text).map((segment, index) =>
segment.kind === "mark" ? (
<span key={index} aria-hidden="true" data-watermark-mark="">
{segment.value}
</span>
) : (
segment.value
),
)}
</>
);
}
@@ -64,6 +64,7 @@ import {
useAssessmentSignals,
useSignalNoticeGate,
} from "../../../features/assessment-signals";
import { WatermarkedText, WatermarkTile } from "../../../features/assessment-watermark";
import { forgetExpressStart } from "../model/express-start";
import { AttemptFocusBar, type AnswerSaveState } from "./attempt-focus-bar";
import attemptStyles from "./assessment-attempt-page.module.css";
@@ -704,7 +705,9 @@ function AssessmentAttemptContent({ attemptId }: { attemptId: string }) {
{`${currentItem.sequence} из ${attempt.progress.max_items}`}
</VisuallyHidden>
</div>
<p className={attemptStyles.prompt}>{currentItem.prompt}</p>
<p className={attemptStyles.prompt}>
<WatermarkedText text={currentItem.prompt} />
</p>
</>
}
>
@@ -794,6 +797,9 @@ function AssessmentAttemptContent({ attemptId }: { attemptId: string }) {
</ButtonLink>
</div>
</div>
{attempt.watermark && workReady && !terminal ? (
<WatermarkTile code={attempt.watermark.code} />
) : null}
<SignalNoticeDialog {...signalNotice.dialog} />
</Page>
);
@@ -84,11 +84,11 @@ export const getCreateMyAssessmentAttemptResponseAssessmentItemMock = (overrideR
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 getCreateMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getCreateMyAssessmentAttemptResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getCreateMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock()},{...getCreateMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock()},{...getCreateMyAssessmentAttemptResponseAssessmentExpressAttemptMock()},]))
@@ -112,11 +112,11 @@ export const getGetMyAssessmentAttemptResponseAssessmentItemMock = (overrideResp
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 getGetMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getGetMyAssessmentAttemptResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getGetMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock()},{...getGetMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock()},{...getGetMyAssessmentAttemptResponseAssessmentExpressAttemptMock()},]))
@@ -140,11 +140,11 @@ export const getStartMyAssessmentAttemptSessionResponseAssessmentItemMock = (ove
export const getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock = (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 getStartMyAssessmentAttemptSessionResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, started_at: faker.date.past().toISOString().slice(0, 19) + 'Z', expires_at: faker.date.past().toISOString().slice(0, 19) + 'Z', sessions: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentSessionsMock()},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([{...getStartMyAssessmentAttemptSessionResponseAssessmentItemMock()},null,]), practices: Array.from({ length: faker.number.int({min: 1, max: 5}) }, (_, i) => i + 1).map(() => ({kind: faker.helpers.arrayElement(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), submitted_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), verdict: faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponsePracticeVerdictMock()},null,]), failure_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getStartMyAssessmentAttemptSessionResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getStartMyAssessmentAttemptSessionResponseAssessmentQualifiedAttemptMock()},{...getStartMyAssessmentAttemptSessionResponseAssessmentCorrectiveAttemptMock()},{...getStartMyAssessmentAttemptSessionResponseAssessmentExpressAttemptMock()},]))
@@ -170,11 +170,11 @@ export const getSubmitMyAssessmentAnswerResponseAssessmentItemMock = (overrideRe
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 getSubmitMyAssessmentAnswerResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getSubmitMyAssessmentAnswerResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getSubmitMyAssessmentAnswerResponseAssessmentQualifiedAttemptMock()},{...getSubmitMyAssessmentAnswerResponseAssessmentCorrectiveAttemptMock()},{...getSubmitMyAssessmentAnswerResponseAssessmentExpressAttemptMock()},]))
@@ -198,11 +198,11 @@ export const getFinalizeMyAssessmentAttemptResponseAssessmentItemMock = (overrid
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 getFinalizeMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock = (overrideResponse: Partial<AssessmentQualifiedAttempt> = {}): AssessmentQualifiedAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['root'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['root'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock = (overrideResponse: Partial<AssessmentCorrectiveAttempt> = {}): AssessmentCorrectiveAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['corrective'] as const), mode: faker.helpers.arrayElement(['demo_basic','adaptive'] as const), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), target_grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), root_attempt_id: faker.string.uuid(), chain_deadline: faker.date.past().toISOString().slice(0, 19) + 'Z'},}, kind: faker.helpers.arrayElement(['corrective'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])}))},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseAssessmentExpressAttemptMock = (overrideResponse: Partial<AssessmentExpressAttempt> = {}): AssessmentExpressAttempt => ({...{...{...{id: faker.string.uuid(), version: faker.number.int({min: 1}), specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), target_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), task_language: faker.helpers.arrayElement([faker.helpers.arrayElement(['python','go'] as const),null,]), kind: faker.helpers.arrayElement(['root','corrective','demo_express'] as const), root_attempt_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), chain_deadline: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), mode: faker.helpers.arrayElement(['demo_basic','demo_express','adaptive'] as const), state: faker.helpers.arrayElement(['in_progress','practice_pending','additional_practice_pending','ready_to_finalize','completed','expired','insufficient_bank'] as const), versions: {policy_version: faker.number.int({min: 1}), bank_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), algorithm_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64})}, 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(['main','additional'] as const), item_id: faker.string.uuid(), status: faker.helpers.arrayElement(['not_started','pending','finished','failed'] as const), 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(['sandbox_busy','sandbox_error'] as const),null,])})), ...(faker.datatype.boolean() ? {watermark: {code: fakeFromPattern("^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$", {minLength: 10, maxLength: 11})}} : {})},...{kind: faker.helpers.arrayElement(['demo_express'] as const), mode: faker.helpers.arrayElement(['demo_express'] as const), specialization: null, target_grade: null, task_language: null, root_attempt_id: null, chain_deadline: null},}, kind: faker.helpers.arrayElement(['demo_express'] as const)}, ...overrideResponse});
export const getFinalizeMyAssessmentAttemptResponseMock = (): AssessmentAttempt => (faker.helpers.arrayElement([{...getFinalizeMyAssessmentAttemptResponseAssessmentQualifiedAttemptMock()},{...getFinalizeMyAssessmentAttemptResponseAssessmentCorrectiveAttemptMock()},{...getFinalizeMyAssessmentAttemptResponseAssessmentExpressAttemptMock()},]))
@@ -97,6 +97,11 @@ export const assessmentAttemptOneOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentAttemptOneOnePracticesMax = 5;
export const assessmentAttemptOneOneWatermarkCodeMin = 10;
export const assessmentAttemptOneOneWatermarkCodeMax = 11;
export const assessmentAttemptOneOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const assessmentAttemptTwoOneVersionsBankVersionMax = 64;
@@ -188,6 +193,11 @@ export const assessmentAttemptTwoOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentAttemptTwoOnePracticesMax = 5;
export const assessmentAttemptTwoOneWatermarkCodeMin = 10;
export const assessmentAttemptTwoOneWatermarkCodeMax = 11;
export const assessmentAttemptTwoOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const assessmentAttemptThreeOneVersionsBankVersionMax = 64;
@@ -279,6 +289,11 @@ export const assessmentAttemptThreeOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentAttemptThreeOnePracticesMax = 5;
export const assessmentAttemptThreeOneWatermarkCodeMin = 10;
export const assessmentAttemptThreeOneWatermarkCodeMax = 11;
export const assessmentAttemptThreeOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentAttempt = zod.union([zod.object({
"id": zod.uuid().describe('Attempt identifier.'),
@@ -368,7 +383,10 @@ export const AssessmentAttempt = zod.union([zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentAttemptOneOnePracticesItemVerdictOneGroupsMin).max(assessmentAttemptOneOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentAttemptOneOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentAttemptOneOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentAttemptOneOneWatermarkCodeMin).max(assessmentAttemptOneOneWatermarkCodeMax).regex(assessmentAttemptOneOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['root']),
"mode": zod.enum(['demo_basic', 'adaptive']),
@@ -466,7 +484,10 @@ export const AssessmentAttempt = zod.union([zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentAttemptTwoOnePracticesItemVerdictOneGroupsMin).max(assessmentAttemptTwoOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentAttemptTwoOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentAttemptTwoOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentAttemptTwoOneWatermarkCodeMin).max(assessmentAttemptTwoOneWatermarkCodeMax).regex(assessmentAttemptTwoOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['corrective']),
"mode": zod.enum(['demo_basic', 'adaptive']),
@@ -564,7 +585,10 @@ export const AssessmentAttempt = zod.union([zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentAttemptThreeOnePracticesItemVerdictOneGroupsMin).max(assessmentAttemptThreeOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentAttemptThreeOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentAttemptThreeOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentAttemptThreeOneWatermarkCodeMin).max(assessmentAttemptThreeOneWatermarkCodeMax).regex(assessmentAttemptThreeOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['demo_express']),
"mode": zod.enum(['demo_express']),
@@ -97,6 +97,11 @@ export const assessmentAttemptCommonPracticesItemVerdictOneGroupsMax = 3;
export const assessmentAttemptCommonPracticesMax = 5;
export const assessmentAttemptCommonWatermarkCodeMin = 10;
export const assessmentAttemptCommonWatermarkCodeMax = 11;
export const assessmentAttemptCommonWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentAttemptCommon = zod.object({
"id": zod.uuid().describe('Attempt identifier.'),
@@ -186,7 +191,10 @@ export const AssessmentAttemptCommon = zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentAttemptCommonPracticesItemVerdictOneGroupsMin).max(assessmentAttemptCommonPracticesItemVerdictOneGroupsMax)
}).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(assessmentAttemptCommonPracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentAttemptCommonPracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentAttemptCommonWatermarkCodeMin).max(assessmentAttemptCommonWatermarkCodeMax).regex(assessmentAttemptCommonWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.')
export type AssessmentAttemptCommon = zod.input<typeof AssessmentAttemptCommon>;
@@ -97,6 +97,11 @@ export const assessmentCorrectiveAttemptOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentCorrectiveAttemptOnePracticesMax = 5;
export const assessmentCorrectiveAttemptOneWatermarkCodeMin = 10;
export const assessmentCorrectiveAttemptOneWatermarkCodeMax = 11;
export const assessmentCorrectiveAttemptOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentCorrectiveAttempt = zod.object({
"id": zod.uuid().describe('Attempt identifier.'),
@@ -186,7 +191,10 @@ export const AssessmentCorrectiveAttempt = zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentCorrectiveAttemptOnePracticesItemVerdictOneGroupsMin).max(assessmentCorrectiveAttemptOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentCorrectiveAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentCorrectiveAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentCorrectiveAttemptOneWatermarkCodeMin).max(assessmentCorrectiveAttemptOneWatermarkCodeMax).regex(assessmentCorrectiveAttemptOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['corrective']),
"mode": zod.enum(['demo_basic', 'adaptive']),
@@ -97,6 +97,11 @@ export const assessmentExpressAttemptOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentExpressAttemptOnePracticesMax = 5;
export const assessmentExpressAttemptOneWatermarkCodeMin = 10;
export const assessmentExpressAttemptOneWatermarkCodeMax = 11;
export const assessmentExpressAttemptOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentExpressAttempt = zod.object({
"id": zod.uuid().describe('Attempt identifier.'),
@@ -186,7 +191,10 @@ export const AssessmentExpressAttempt = zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentExpressAttemptOnePracticesItemVerdictOneGroupsMin).max(assessmentExpressAttemptOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentExpressAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentExpressAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentExpressAttemptOneWatermarkCodeMin).max(assessmentExpressAttemptOneWatermarkCodeMax).regex(assessmentExpressAttemptOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['demo_express']),
"mode": zod.enum(['demo_express']),
@@ -97,6 +97,11 @@ export const assessmentQualifiedAttemptOnePracticesItemVerdictOneGroupsMax = 3;
export const assessmentQualifiedAttemptOnePracticesMax = 5;
export const assessmentQualifiedAttemptOneWatermarkCodeMin = 10;
export const assessmentQualifiedAttemptOneWatermarkCodeMax = 11;
export const assessmentQualifiedAttemptOneWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentQualifiedAttempt = zod.object({
"id": zod.uuid().describe('Attempt identifier.'),
@@ -186,7 +191,10 @@ export const AssessmentQualifiedAttempt = zod.object({
}).describe('Outcome of one hidden check group. It never contains the checks themselves.')).min(assessmentQualifiedAttemptOnePracticesItemVerdictOneGroupsMin).max(assessmentQualifiedAttemptOnePracticesItemVerdictOneGroupsMax)
}).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(assessmentQualifiedAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.')
}).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(assessmentQualifiedAttemptOnePracticesMax).describe('Practices in the order assigned by the mode policy. The list exposes verdicts only after submission.'),
"watermark": zod.object({
"code": zod.string().min(assessmentQualifiedAttemptOneWatermarkCodeMin).max(assessmentQualifiedAttemptOneWatermarkCodeMax).regex(assessmentQualifiedAttemptOneWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).exactOptional().describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
}).describe('Common state of an assessment attempt. Real assessments have a specialization and target grade; demo_express has neither. The attempt shows its fixed versions, server deadlines, session limit, progress, current item, and practices. It never contains answer keys, answer correctness, item scores, family or variant identifiers, seeds, hidden checks, or anti-cheat signals.').and(zod.object({
"kind": zod.enum(['root']),
"mode": zod.enum(['demo_basic', 'adaptive']),
@@ -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 assessmentWatermarkCodeMin = 10;
export const assessmentWatermarkCodeMax = 11;
export const assessmentWatermarkCodeRegExp = new RegExp('^[0-9A-HJKMNP-TV-Z]{5}-?[0-9A-HJKMNP-TV-Z]{5}$');
export const AssessmentWatermark = zod.object({
"code": zod.string().min(assessmentWatermarkCodeMin).max(assessmentWatermarkCodeMax).regex(assessmentWatermarkCodeRegExp).describe('Two groups of five symbols of Crockford base32, such as `7K3QD-9XM2T`.')
}).describe('Visible mark of a real attempt. The client shows `code` with the current time as a faint tile over the task screen, so that a screenshot or a photo of the screen can be traced back to the attempt by an operator. The code is a keyed pseudonym derived on the server: it carries no name, contact, or identifier of the account, and it cannot be computed without the server secret. The task text of such an attempt also carries an invisible mark and interchangeable wordings chosen by the same secret; they change neither the meaning of a task nor its reference answer, and the client keeps the invisible characters out of the accessibility tree. Training runs (`demo_express`) carry no watermark. It is evidence for a manual review and an appeal, never an automatic decision.')
export type AssessmentWatermark = zod.input<typeof AssessmentWatermark>;
export type AssessmentWatermarkOutput = zod.output<typeof AssessmentWatermark>;
@@ -66,6 +66,7 @@ export * from './assessmentStrength.zod';
export * from './assessmentUncertainty.zod';
export * from './assessmentVersionLabel.zod';
export * from './assessmentVersions.zod';
export * from './assessmentWatermark.zod';
export * from './basicScore.zod';
export * from './calibrationStatus.zod';
export * from './choiceAnswer.zod';