Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | 1x 134x 1x 1x 1x 1x 1x 1x 1x 1x 1110x 12x | import { TestSessionChange } from 'testcenter-common/interfaces/test-session-change.interface'; // eslint-disable-next-line import/extensions import { BookletConfig } from '../shared/shared.module'; export interface GroupMonitorConfig { checkForIdleInterval: number; } export type TestSessionData = Readonly<TestSessionChange>; export interface TestSession { readonly data: TestSessionData; readonly state: TestSessionSuperState; readonly current: UnitContext | null; readonly booklet: Booklet | BookletError; readonly clearedCodes: Record<string, unknown> | null; readonly timeLeft: Record<string, string> | null; } export const TestSessionsSuperStates = ['monitor_group', 'demo', 'pending', 'locked', 'error', 'controller_terminated', 'connection_lost', 'paused', 'focus_lost', 'idle', 'connection_websocket', 'connection_polling', 'ok'] as const; export type TestSessionSuperState = typeof TestSessionsSuperStates[number]; export interface Booklet { metadata: BookletMetadata; config: BookletConfig; restrictions?: Restrictions; units: Testlet; species: string; } export interface BookletError { error: 'xml' | 'missing-id' | 'missing-file' | 'general'; species: null; } export function isBooklet(bookletOrError: Booklet | BookletError): bookletOrError is Booklet { return bookletOrError && !('error' in bookletOrError); } export interface BookletMetadata { id: string; label: string; description: string; owner?: string; lastchange?: string; status?: string; project?: string; } export interface Testlet { id: string; label: string; restrictions?: Restrictions; children: (Unit | Testlet)[]; descendantCount: number; blockId?: string; nextBlockId?: string; } export interface Unit { id: string; label: string; labelShort: string; } export interface Restrictions { codeToEnter?: { code: string; message: string; }; timeMax?: { minutes: number }; } export type TestViewDisplayOptionKey = keyof TestViewDisplayOptions; // analogous to GroupMonitorProfileFilterField in Testtakers.xsd export const testSessionFilterTargetLists = { advanced: [ 'groupName', 'bookletId', 'blockId', 'testState', 'mode', 'bookletSpecies', 'unitId' ], basic: [ 'bookletLabel', 'personLabel', 'state', 'blockLabel', 'unitLabel' ] } as const; export const testSessionFilterTargets = [ ...testSessionFilterTargetLists.basic, ...testSessionFilterTargetLists.advanced ] as const; export const testSessionFilterTypeLists = { basic: ['substring', 'equal'], advanced: ['regex'] } as const; export const testSessionFilterTypes = [ ...testSessionFilterTypeLists.basic, ...testSessionFilterTypeLists.advanced ] as const; export type TestSessionFilterType = (typeof testSessionFilterTypes)[number]; export type TestSessionFilterTarget = (typeof testSessionFilterTargets)[number]; export interface TestSessionFilter { target: TestSessionFilterTarget; value: string | string[]; id: string; label: string; subValue?: string; type: TestSessionFilterType; not: boolean; } export const isTestSessionFilter = (obj: object): obj is TestSessionFilter => ('target' in obj) && ('value' in obj) && ('id' in obj) && ('label' in obj) && ('type' in obj) && ('not' in obj) && (typeof obj.type === 'string') && (typeof obj.target === 'string') && (typeof obj.label === 'string') && (typeof obj.not === 'boolean') && (testSessionFilterTypes as readonly string[]).includes(obj.type) && (testSessionFilterTargets as readonly string[]).includes(obj.target); export interface MonitorProfileTestViewDisplayOptions { blockColumn: ColumnOption; unitColumn: ColumnOption; view: ViewOption; groupColumn: ColumnOption; bookletColumn: ColumnOption; } export type ColumnOption = 'show' | 'hide'; export type ViewOption = 'full' | 'medium' | 'small'; export const isColumnOption = (v: string): v is ColumnOption => ['show', 'hide'].includes(v); export const isViewOption = (v: string): v is ViewOption => ['full', 'medium', 'small'].includes(v); export interface TestViewDisplayOptions extends MonitorProfileTestViewDisplayOptions { highlightSpecies: boolean; manualChecking: boolean; } export interface Profile { id: string; label: string; settings: { [key: string]: string }; filtersEnabled: { [key: string]: string }; filters: TestSessionFilter[]; } export const testSessionFilterListEntrySources = ['base', 'quick', 'profile', 'custom'] as const; export type TestSessionFilterListEntrySource = typeof testSessionFilterListEntrySources[number]; export interface TestSessionFilterListEntry { filter: TestSessionFilter, selected: boolean, source: TestSessionFilterListEntrySource } export interface TestSessionFilterList { [filterId: string]: TestSessionFilterListEntry } export interface CheckingOptions { enableAutoCheckAll: boolean; autoCheckAll: boolean; } export function isUnit(testletOrUnit: Testlet | Unit): testletOrUnit is Unit { return !('children' in testletOrUnit); } export function isTestlet(testletOrUnit: Testlet | Unit): testletOrUnit is Testlet { return !isUnit(testletOrUnit); } export interface UnitContext { unit?: Unit; parent?: Testlet; ancestor?: Testlet; indexGlobal: number; indexLocal: number; indexAncestor: number; } export interface Selected { element: Testlet | null; originSession: TestSession; spreading: boolean; inversion: boolean; } export interface TestSessionSetStats { all: boolean; number: number; differentBooklets: number; differentBookletSpecies: number; paused: number; locked: number; } export interface UIMessage { level: 'error' | 'warning' | 'info' | 'success'; text: string; customtext: string; replacements?: string[] } export interface CommandResponse { commandType: string; testIds: number[]; } export interface GotoCommandData { [bookletName: string]: { testIds: number[], firstUnitId: string } } |