feat(assessment): record capture hints and keep one window per attempt
This commit is contained in:
1 parent
c975a0d506
commit
bb917bf62e
108 files changed
+6649
-139
No files matched your search
@@ -36,6 +36,7 @@ import type {
|
||||
AssessmentSignalNotice,
|
||||
AssessmentSignalReceipt,
|
||||
AssessmentUncertainty,
|
||||
AssessmentWorkSession,
|
||||
BasicScore,
|
||||
ChoiceItemContent,
|
||||
ConfigurationItemContent,
|
||||
@@ -150,6 +151,8 @@ export const getStartMyAssessmentAttemptSessionResponseMock = (): AssessmentAtte
|
||||
|
||||
export const getRecordMyAssessmentAttemptSignalsResponseMock = (overrideResponse: Partial<Extract<AssessmentSignalReceipt, object>> = {}): AssessmentSignalReceipt => ({status: faker.helpers.arrayElement(['accepted','saturated'] as const), accepted_events: faker.number.int({min: 0, max: 50}), received_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getHoldMyAssessmentWorkSessionResponseMock = (overrideResponse: Partial<Extract<AssessmentWorkSession, object>> = {}): AssessmentWorkSession => ({held_until: faker.date.past().toISOString().slice(0, 19) + 'Z', renew_after_seconds: faker.number.int({min: 1, max: 3600}), ...overrideResponse})
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseAssessmentSessionsMock = (overrideResponse: Partial<AssessmentSessions> = {}): AssessmentSessions => ({...{used: faker.number.int({min: 1, max: 10}), max: faker.number.int({min: 1, max: 10}), idle_timeout_seconds: faker.number.int({min: 60, max: 86400})}, ...overrideResponse});
|
||||
|
||||
export const getSubmitMyAssessmentAnswerResponseChoiceItemContentMock = (overrideResponse: Partial<ChoiceItemContent> = {}): ChoiceItemContent => ({...{format: faker.helpers.arrayElement(['choice'] as const), options: Array.from({ length: faker.number.int({min: 2, max: 10}) }, (_, i) => i + 1).map(() => ({id: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 32}), text: faker.string.alpha({length: {min: 1, max: 2000}})})), multiple: faker.datatype.boolean()}, ...overrideResponse});
|
||||
@@ -315,6 +318,28 @@ export const getRecordMyAssessmentAttemptSignalsMockHandler = (overrideResponse?
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getHoldMyAssessmentWorkSessionMockHandler = (overrideResponse?: AssessmentWorkSession | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<AssessmentWorkSession> | AssessmentWorkSession), options?: RequestHandlerOptions) => {
|
||||
return http.put('*/api/v1/me/assessment-attempts/:attemptId/work-session', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getHoldMyAssessmentWorkSessionResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getReleaseMyAssessmentWorkSessionMockHandler = (overrideResponse?: void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<void> | void), options?: RequestHandlerOptions) => {
|
||||
return http.delete('*/api/v1/me/assessment-attempts/:attemptId/work-session', async (info: Parameters<Parameters<typeof http.delete>[1]>[0]) => {
|
||||
if (typeof overrideResponse === 'function') {await overrideResponse(info); }
|
||||
|
||||
return new HttpResponse(null,
|
||||
{ status: 204
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSubmitMyAssessmentAnswerMockHandler = (overrideResponse?: AssessmentAttempt | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<AssessmentAttempt> | AssessmentAttempt), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/assessment-attempts/:attemptId/answers', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
@@ -359,6 +384,8 @@ export const getAssessmentMock = () => [
|
||||
getGetMyAssessmentAttemptMockHandler(),
|
||||
getStartMyAssessmentAttemptSessionMockHandler(),
|
||||
getRecordMyAssessmentAttemptSignalsMockHandler(),
|
||||
getHoldMyAssessmentWorkSessionMockHandler(),
|
||||
getReleaseMyAssessmentWorkSessionMockHandler(),
|
||||
getSubmitMyAssessmentAnswerMockHandler(),
|
||||
getFinalizeMyAssessmentAttemptMockHandler(),
|
||||
getGetMyAssessmentResultMockHandler()
|
||||
|
||||
@@ -37,11 +37,14 @@ import type {
|
||||
AssessmentSignalNotice,
|
||||
AssessmentSignalNoticeAcknowledgement,
|
||||
AssessmentSignalReceipt,
|
||||
AssessmentWorkSession,
|
||||
CreateMyAssessmentAttemptHeaders,
|
||||
FinalizeMyAssessmentAttemptHeaders,
|
||||
HoldMyAssessmentWorkSessionHeaders,
|
||||
ListMyAssessmentResultsParams,
|
||||
Problem,
|
||||
RecordMyAssessmentAttemptSignalsHeaders,
|
||||
ReleaseMyAssessmentWorkSessionHeaders,
|
||||
StartMyAssessmentAttemptSessionHeaders,
|
||||
SubmitMyAssessmentAnswerHeaders
|
||||
} from '../../schemas';
|
||||
@@ -700,6 +703,8 @@ export const getStartMyAssessmentAttemptSessionUrl = (attemptId: string,) => {
|
||||
*
|
||||
* If the attempt deadline or session budget has passed, this command commits the due terminal transition and returns the resulting attempt. A pending practice submitted before the limit is graded first. `GetMyAssessmentAttempt` and `GetMyAssessmentResult` remain read-only: they never start a session or commit a due transition. A background transition may persist a due outcome independently; after that, this command returns the stored terminal attempt without changing it.
|
||||
*
|
||||
* One page at a time. While another page holds the work session of this attempt (HoldMyAssessmentWorkSession), a request from a different `X-Attempt-Client`, or from none, answers 409 `state_conflict` and changes nothing; the client tells the candidate that the attempt is open in another window. That refusal is not stored under the Idempotency-Key, because it lasts only until the other page closes or stops renewing. A real attempt that nobody holds is not refused.
|
||||
*
|
||||
* The attempt must belong to the candidate of the session. An attempt of another candidate answers 404 not_found, the same as an unknown identifier. An employer account answers 403 forbidden; no operation gives an employer answers, qualification evidence, or attempt history.
|
||||
* @summary Start or resume a work session for the current candidate's attempt.
|
||||
*/
|
||||
@@ -875,6 +880,194 @@ export const useRecordMyAssessmentAttemptSignals = <TError = ErrorType<Problem>,
|
||||
> => {
|
||||
return useMutation(getRecordMyAssessmentAttemptSignalsMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getHoldMyAssessmentWorkSessionUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/work-session`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires a candidate session, its CSRF token in X-CSRF-Token, an allowed Origin, and the `X-Attempt-Client` header of the page. A real attempt (`root` or `corrective`) allows one open page at a time. The page that works on the attempt calls this operation when the candidate starts or resumes work and then repeats it every `renew_after_seconds`; each call holds the work session until `held_until`.
|
||||
*
|
||||
* - If nobody holds the work session, the previous holder released it, or its hold expired, the page becomes the holder and the answer is 200.
|
||||
* - If the same page holds it, the hold is renewed and the answer is 200.
|
||||
* - If another page holds it, the answer is 409 `state_conflict` and nothing changes: the second page is refused until the first one releases the session (ReleaseMyAssessmentWorkSession) or stops renewing and its hold expires. The client tells the candidate that the attempt is open in another window and does not show the task.
|
||||
*
|
||||
* The same 409 answers a terminal or expired attempt and a `demo_express` attempt, which has no protected work session. The hold is a one-page-at-a-time rule, not a lock on the candidate: a candidate who closes a page, reloads, or opens the attempt on another device can continue when the hold is released or has expired (at most two minutes after the last renewal). It is not a security boundary: a client that never calls this operation is refused only while another page holds the session. The server stores one-way keyed digests of the page identifier and of the User-Agent, bound to the attempt; it never stores or returns either value. A change of the User-Agent digest during an attempt is a weak server signal for a manual review, never an automatic decision.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden), the attempt (404 not_found for an unknown attempt or one of another candidate), then the hold (409 state_conflict).
|
||||
* @summary Hold the single active work session of a real assessment attempt for this page.
|
||||
*/
|
||||
export const holdMyAssessmentWorkSession = async (attemptId: string,
|
||||
headers: HoldMyAssessmentWorkSessionHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<AssessmentWorkSession> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<AssessmentWorkSession>(getHoldMyAssessmentWorkSessionUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'PUT',
|
||||
headers: { ...headers, ...getHeaders(options?.headers) }
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getHoldMyAssessmentWorkSessionMutationKey = () => ['holdMyAssessmentWorkSession'] as const;
|
||||
|
||||
export const getHoldMyAssessmentWorkSessionMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>, TError,HoldMyAssessmentWorkSessionMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>, TError,HoldMyAssessmentWorkSessionMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getHoldMyAssessmentWorkSessionMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>, HoldMyAssessmentWorkSessionMutationVariables> = (props) => {
|
||||
const {attemptId,headers} = props ?? {};
|
||||
|
||||
return holdMyAssessmentWorkSession(attemptId,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type HoldMyAssessmentWorkSessionMutationResult = NonNullable<Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>>
|
||||
|
||||
export type HoldMyAssessmentWorkSessionMutationError = ErrorType<Problem>
|
||||
export type HoldMyAssessmentWorkSessionMutationVariables = {attemptId: string;headers: HoldMyAssessmentWorkSessionHeaders}
|
||||
|
||||
/**
|
||||
* @summary Hold the single active work session of a real assessment attempt for this page.
|
||||
*/
|
||||
export const useHoldMyAssessmentWorkSession = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>, TError,HoldMyAssessmentWorkSessionMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof holdMyAssessmentWorkSession>>,
|
||||
TError,
|
||||
HoldMyAssessmentWorkSessionMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getHoldMyAssessmentWorkSessionMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getReleaseMyAssessmentWorkSessionUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/assessment-attempts/${attemptId}/work-session`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires a candidate session, its CSRF token in X-CSRF-Token, an allowed Origin, and the `X-Attempt-Client` header of the page. The page calls it when it closes, so that the candidate can open the attempt in another window at once instead of waiting for the hold to expire. The request is idempotent and reveals nothing: it answers 204 whether this page held the session, another page holds it (which stays held), nobody held it, or the attempt is not held at all, and a repeat after a lost response succeeds. A page that is killed without calling it loses the hold within two minutes.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden), the attempt (404 not_found for an unknown attempt or one of another candidate), then the release (204).
|
||||
* @summary Release the work session that this page holds.
|
||||
*/
|
||||
export const releaseMyAssessmentWorkSession = async (attemptId: string,
|
||||
headers: ReleaseMyAssessmentWorkSessionHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<void> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<void>(getReleaseMyAssessmentWorkSessionUrl(attemptId),
|
||||
{
|
||||
...options,
|
||||
method: 'DELETE',
|
||||
headers: { ...headers, ...getHeaders(options?.headers) }
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getReleaseMyAssessmentWorkSessionMutationKey = () => ['releaseMyAssessmentWorkSession'] as const;
|
||||
|
||||
export const getReleaseMyAssessmentWorkSessionMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>, TError,ReleaseMyAssessmentWorkSessionMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>, TError,ReleaseMyAssessmentWorkSessionMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getReleaseMyAssessmentWorkSessionMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>, ReleaseMyAssessmentWorkSessionMutationVariables> = (props) => {
|
||||
const {attemptId,headers} = props ?? {};
|
||||
|
||||
return releaseMyAssessmentWorkSession(attemptId,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type ReleaseMyAssessmentWorkSessionMutationResult = NonNullable<Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>>
|
||||
|
||||
export type ReleaseMyAssessmentWorkSessionMutationError = ErrorType<Problem>
|
||||
export type ReleaseMyAssessmentWorkSessionMutationVariables = {attemptId: string;headers: ReleaseMyAssessmentWorkSessionHeaders}
|
||||
|
||||
/**
|
||||
* @summary Release the work session that this page holds.
|
||||
*/
|
||||
export const useReleaseMyAssessmentWorkSession = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>, TError,ReleaseMyAssessmentWorkSessionMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof releaseMyAssessmentWorkSession>>,
|
||||
TError,
|
||||
ReleaseMyAssessmentWorkSessionMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getReleaseMyAssessmentWorkSessionMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getSubmitMyAssessmentAnswerUrl = (attemptId: string,) => {
|
||||
|
||||
|
||||
@@ -892,6 +1085,8 @@ export const useRecordMyAssessmentAttemptSignals = <TError = ErrorType<Problem>,
|
||||
*
|
||||
* Practice: an answer with format `practice` submits the solution of the main or the additional practice. It is stored, and the sandbox runs it asynchronously against the hidden check groups; the response shows the practice `pending`, and the client polls GetMyAssessmentAttempt for the verdict. Only the score 0-3 and the pass state of each group are shown, never the checks, error output, or seeds. Every outcome caused by the solution, such as a compilation error, a crash, or a time or memory limit, is a `finished` verdict. A `failed` verdict means only that the sandbox infrastructure could not run it; it consumes nothing. After `finished` the practice accepts no other solution, so hidden group results cannot be used to tune it. Debug runs of the candidate's own tests and the public examples are unlimited apart from the sandbox rate limit and never show hidden group results; they are planned as a separate operation.
|
||||
*
|
||||
* One page at a time. While another page holds the work session of this attempt (HoldMyAssessmentWorkSession), a request from a different `X-Attempt-Client`, or from none, answers 409 `state_conflict` and stores nothing, so a second window cannot answer. That refusal is not stored under the Idempotency-Key and is checked before the stored answer is replayed.
|
||||
*
|
||||
* Repeats and conflicts, per item:
|
||||
* - A retry with the same Idempotency-Key and body within 24 hours replays the stored response.
|
||||
* - Sending the answer already stored for the item again, even with a new key or an older `expected_version`, stores nothing, keeps the version, and answers 200 with the current attempt. Each answer format defines equality: sets for `option_ids` and `line_numbers`, the exact sequence for `element_ids`, numeric equality for `number`, identical text without normalization for `text` and `config`, and the same language with identical source for a practice.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const AssessmentCaptureSignal = zod.object({
|
||||
"kind": zod.enum(['screenshot_key', 'devtools_open']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('A hint that the screen may be captured or inspected. `screenshot_key` is a key or key combination that the browser saw and that usually takes a screenshot (PrintScreen, Cmd+Shift+3, 4, or 5 on macOS, Win+Shift+S); `devtools_open` is the result of a heuristic that guesses that the developer tools are open (a docked panel changes the window size, or the console reads an object). Both are weak: a browser does not see every screenshot, an operating system can take one without a key the page sees, a phone photo is invisible to the page, and the heuristic gives false positives. They lead to attention in a manual review at most, never to a score change, and they carry no measurement.')
|
||||
|
||||
export type AssessmentCaptureSignal = zod.input<typeof AssessmentCaptureSignal>;
|
||||
export type AssessmentCaptureSignalOutput = zod.output<typeof AssessmentCaptureSignal>;
|
||||
@@ -29,7 +29,11 @@ export const AssessmentSignalBatch = zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(assessmentSignalBatchEventsMax)
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['screenshot_key', 'devtools_open']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('A hint that the screen may be captured or inspected. `screenshot_key` is a key or key combination that the browser saw and that usually takes a screenshot (PrintScreen, Cmd+Shift+3, 4, or 5 on macOS, Win+Shift+S); `devtools_open` is the result of a heuristic that guesses that the developer tools are open (a docked panel changes the window size, or the console reads an object). Both are weak: a browser does not see every screenshot, an operating system can take one without a key the page sees, a phone photo is invisible to the page, and the heuristic gives false positives. They lead to attention in a manual review at most, never to a score change, and they carry no measurement.')]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(assessmentSignalBatchEventsMax)
|
||||
}).describe('A bounded batch of client event metadata. The raw request body is limited to 32 KiB before decoding and the batch contains at most 50 events.')
|
||||
|
||||
export type AssessmentSignalBatch = zod.input<typeof AssessmentSignalBatch>;
|
||||
|
||||
@@ -26,7 +26,11 @@ export const AssessmentSignalEvent = zod.union([zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['screenshot_key', 'devtools_open']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('A hint that the screen may be captured or inspected. `screenshot_key` is a key or key combination that the browser saw and that usually takes a screenshot (PrintScreen, Cmd+Shift+3, 4, or 5 on macOS, Win+Shift+S); `devtools_open` is the result of a heuristic that guesses that the developer tools are open (a docked panel changes the window size, or the console reads an object). Both are weak: a browser does not see every screenshot, an operating system can take one without a key the page sees, a phone photo is invisible to the page, and the heuristic gives false positives. They lead to attention in a manual review at most, never to a score change, and they carry no measurement.')]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')
|
||||
|
||||
export type AssessmentSignalEvent = zod.input<typeof AssessmentSignalEvent>;
|
||||
export type AssessmentSignalEventOutput = zod.output<typeof AssessmentSignalEvent>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const assessmentWorkSessionRenewAfterSecondsMax = 3600;
|
||||
|
||||
|
||||
export const AssessmentWorkSession = zod.object({
|
||||
"held_until": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"renew_after_seconds": zod.int().min(1).max(assessmentWorkSessionRenewAfterSecondsMax).describe('How often the page repeats the hold. It is well below the hold time, so a page whose timer is slowed down in the background still renews before its hold expires.')
|
||||
}).describe('The work session of a real attempt that the calling page holds. It is a one-page-at-a-time rule for the attempt, not a score or a signal, and it changes no result.')
|
||||
|
||||
export type AssessmentWorkSession = zod.input<typeof AssessmentWorkSession>;
|
||||
export type AssessmentWorkSessionOutput = zod.output<typeof AssessmentWorkSession>;
|
||||
@@ -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 holdMyAssessmentWorkSessionHeadersXAttemptClientMin = 16;
|
||||
export const holdMyAssessmentWorkSessionHeadersXAttemptClientMax = 64;
|
||||
|
||||
|
||||
export const holdMyAssessmentWorkSessionHeadersXAttemptClientRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const HoldMyAssessmentWorkSessionHeaders = zod.object({
|
||||
"X-Attempt-Client": zod.string().min(holdMyAssessmentWorkSessionHeadersXAttemptClientMin).max(holdMyAssessmentWorkSessionHeadersXAttemptClientMax).regex(holdMyAssessmentWorkSessionHeadersXAttemptClientRegExp)
|
||||
})
|
||||
|
||||
export type HoldMyAssessmentWorkSessionHeaders = zod.input<typeof HoldMyAssessmentWorkSessionHeaders>;
|
||||
export type HoldMyAssessmentWorkSessionHeadersOutput = zod.output<typeof HoldMyAssessmentWorkSessionHeaders>;
|
||||
@@ -16,6 +16,7 @@ export * from './assessmentAttemptSessionStart.zod';
|
||||
export * from './assessmentAttemptState.zod';
|
||||
export * from './assessmentAttemptVersion.zod';
|
||||
export * from './assessmentAvailability.zod';
|
||||
export * from './assessmentCaptureSignal.zod';
|
||||
export * from './assessmentCategoryDecisionView.zod';
|
||||
export * from './assessmentClipboardSignal.zod';
|
||||
export * from './assessmentCorrectiveAttempt.zod';
|
||||
@@ -67,6 +68,7 @@ export * from './assessmentUncertainty.zod';
|
||||
export * from './assessmentVersionLabel.zod';
|
||||
export * from './assessmentVersions.zod';
|
||||
export * from './assessmentWatermark.zod';
|
||||
export * from './assessmentWorkSession.zod';
|
||||
export * from './basicScore.zod';
|
||||
export * from './calibrationStatus.zod';
|
||||
export * from './choiceAnswer.zod';
|
||||
@@ -80,6 +82,7 @@ export * from './finalizeMyAssessmentAttemptBody.zod';
|
||||
export * from './finalizeMyAssessmentAttemptHeaders.zod';
|
||||
export * from './findErrorAnswer.zod';
|
||||
export * from './findErrorItemContent.zod';
|
||||
export * from './holdMyAssessmentWorkSessionHeaders.zod';
|
||||
export * from './itemContent.zod';
|
||||
export * from './listMyAssessmentResultsParams.zod';
|
||||
export * from './numberAnswer.zod';
|
||||
@@ -96,6 +99,7 @@ export * from './practiceStatus.zod';
|
||||
export * from './practiceVerdict.zod';
|
||||
export * from './recordMyAssessmentAttemptSignalsBody.zod';
|
||||
export * from './recordMyAssessmentAttemptSignalsHeaders.zod';
|
||||
export * from './releaseMyAssessmentWorkSessionHeaders.zod';
|
||||
export * from './startMyAssessmentAttemptSessionBody.zod';
|
||||
export * from './startMyAssessmentAttemptSessionHeaders.zod';
|
||||
export * from './stringAnswer.zod';
|
||||
|
||||
+5
-1
@@ -29,7 +29,11 @@ export const RecordMyAssessmentAttemptSignalsBody = zod.object({
|
||||
"kind": zod.enum(['fullscreen_exit']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
})]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(recordMyAssessmentAttemptSignalsBodyEventsMax)
|
||||
}),zod.object({
|
||||
"kind": zod.enum(['screenshot_key', 'devtools_open']),
|
||||
"item_instance_id": zod.uuid().describe('Identifier of an item instance in one attempt. It identifies the fixed variant served to this candidate and reveals neither the task family, its version, nor the variant seed.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('A hint that the screen may be captured or inspected. `screenshot_key` is a key or key combination that the browser saw and that usually takes a screenshot (PrintScreen, Cmd+Shift+3, 4, or 5 on macOS, Win+Shift+S); `devtools_open` is the result of a heuristic that guesses that the developer tools are open (a docked panel changes the window size, or the console reads an object). Both are weak: a browser does not see every screenshot, an operating system can take one without a key the page sees, a phone photo is invisible to the page, and the heuristic gives false positives. They lead to attention in a manual review at most, never to a score change, and they carry no measurement.')]).describe('One client-reported event bound to an item instance of the attempt. The timestamp is untrusted input and is used only as event metadata; server receipt time is authoritative for limits and retention.')).min(1).max(recordMyAssessmentAttemptSignalsBodyEventsMax)
|
||||
}).describe('A bounded batch of client event metadata. The raw request body is limited to 32 KiB before decoding and the batch contains at most 50 events.')
|
||||
|
||||
export type RecordMyAssessmentAttemptSignalsBody = zod.input<typeof RecordMyAssessmentAttemptSignalsBody>;
|
||||
|
||||
+20
@@ -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 releaseMyAssessmentWorkSessionHeadersXAttemptClientMin = 16;
|
||||
export const releaseMyAssessmentWorkSessionHeadersXAttemptClientMax = 64;
|
||||
|
||||
|
||||
export const releaseMyAssessmentWorkSessionHeadersXAttemptClientRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const ReleaseMyAssessmentWorkSessionHeaders = zod.object({
|
||||
"X-Attempt-Client": zod.string().min(releaseMyAssessmentWorkSessionHeadersXAttemptClientMin).max(releaseMyAssessmentWorkSessionHeadersXAttemptClientMax).regex(releaseMyAssessmentWorkSessionHeadersXAttemptClientRegExp)
|
||||
})
|
||||
|
||||
export type ReleaseMyAssessmentWorkSessionHeaders = zod.input<typeof ReleaseMyAssessmentWorkSessionHeaders>;
|
||||
export type ReleaseMyAssessmentWorkSessionHeadersOutput = zod.output<typeof ReleaseMyAssessmentWorkSessionHeaders>;
|
||||
+7
-1
@@ -10,9 +10,15 @@ export const startMyAssessmentAttemptSessionHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const startMyAssessmentAttemptSessionHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
export const startMyAssessmentAttemptSessionHeadersXAttemptClientMin = 16;
|
||||
export const startMyAssessmentAttemptSessionHeadersXAttemptClientMax = 64;
|
||||
|
||||
|
||||
export const startMyAssessmentAttemptSessionHeadersXAttemptClientRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const StartMyAssessmentAttemptSessionHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(startMyAssessmentAttemptSessionHeadersIdempotencyKeyMax).regex(startMyAssessmentAttemptSessionHeadersIdempotencyKeyRegExp)
|
||||
"Idempotency-Key": zod.string().min(1).max(startMyAssessmentAttemptSessionHeadersIdempotencyKeyMax).regex(startMyAssessmentAttemptSessionHeadersIdempotencyKeyRegExp),
|
||||
"X-Attempt-Client": zod.string().min(startMyAssessmentAttemptSessionHeadersXAttemptClientMin).max(startMyAssessmentAttemptSessionHeadersXAttemptClientMax).regex(startMyAssessmentAttemptSessionHeadersXAttemptClientRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type StartMyAssessmentAttemptSessionHeaders = zod.input<typeof StartMyAssessmentAttemptSessionHeaders>;
|
||||
|
||||
@@ -10,9 +10,15 @@ export const submitMyAssessmentAnswerHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
export const submitMyAssessmentAnswerHeadersXAttemptClientMin = 16;
|
||||
export const submitMyAssessmentAnswerHeadersXAttemptClientMax = 64;
|
||||
|
||||
|
||||
export const submitMyAssessmentAnswerHeadersXAttemptClientRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const SubmitMyAssessmentAnswerHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(submitMyAssessmentAnswerHeadersIdempotencyKeyMax).regex(submitMyAssessmentAnswerHeadersIdempotencyKeyRegExp)
|
||||
"Idempotency-Key": zod.string().min(1).max(submitMyAssessmentAnswerHeadersIdempotencyKeyMax).regex(submitMyAssessmentAnswerHeadersIdempotencyKeyRegExp),
|
||||
"X-Attempt-Client": zod.string().min(submitMyAssessmentAnswerHeadersXAttemptClientMin).max(submitMyAssessmentAnswerHeadersXAttemptClientMax).regex(submitMyAssessmentAnswerHeadersXAttemptClientRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type SubmitMyAssessmentAnswerHeaders = zod.input<typeof SubmitMyAssessmentAnswerHeaders>;
|
||||
|
||||
Reference in new issue
Block a user