Compare commits

..
Author SHA1 Message Date
kcar fbdd45b177 chore: preserve app workspace t_a1f25994 2026-08-09 20:24:45 +01:00
3 changed files with 67 additions and 68 deletions
+8 -8
View File
@@ -315,20 +315,20 @@ const ExamDashboardPage: React.FC = () => {
{t.exam_code && ( {t.exam_code && (
<Typography variant="caption" color="text.secondary">{t.exam_code}</Typography> <Typography variant="caption" color="text.secondary">{t.exam_code}</Typography>
)} )}
<Box sx={{ mt: 'auto', pt: 1, display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> <Stack spacing={1} sx={{ mt: 'auto', pt: 1 }}>
<Chip size="small" label={t.status} color={STATUS_COLOR[t.status] ?? 'default'} variant="outlined" /> <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<Typography variant="caption" color="text.secondary"> <Chip size="small" label={t.status} color={STATUS_COLOR[t.status] ?? 'default'} variant="outlined" />
Updated {new Date(t.updated_at).toLocaleDateString()} <Typography variant="caption" color="text.secondary">
</Typography> Updated {new Date(t.updated_at).toLocaleDateString()}
</Box> </Typography>
<Stack direction="row" spacing={1} sx={{ pt: 0.5 }}> </Box>
<Button <Button
size="small" size="small"
variant="outlined" variant="outlined"
onClick={(e) => { e.stopPropagation(); navigate(`/exam-marker/${t.id}/marks`); }} onClick={(e) => { e.stopPropagation(); navigate(`/exam-marker/${t.id}/marks`); }}
startIcon={<GradingIcon fontSize="small" />} startIcon={<GradingIcon fontSize="small" />}
> >
Edit marks Mark scheme
</Button> </Button>
</Stack> </Stack>
</Paper> </Paper>
+3 -3
View File
@@ -1,3 +1,3 @@
export { default as ExamDashboardPage } from './ExamDashboardPage'; export { default as ExamDashboardPage } from ./ExamDashboardPage;
export { default as ExamTemplateSetupPage } from './setup/ExamTemplateSetupPage'; export { default as ExamTemplateSetupPage } from ./setup/ExamTemplateSetupPage;
export { default as MarkSchemePage } from './MarkSchemePage'; export { default as MarkSchemePage } from ./MarkSchemePage;
+56 -57
View File
@@ -4,7 +4,7 @@
* the shared UUIDs (template/question/region ids, exam_code). * the shared UUIDs (template/question/region ids, exam_code).
*/ */
export type ExamTemplateStatus = 'draft' | 'ready' | 'archived'; export type ExamTemplateStatus = draft | ready | archived;
export interface ExamTemplate { export interface ExamTemplate {
id: string; id: string;
@@ -31,7 +31,7 @@ export interface CreateTemplatePayload {
institute_id?: string; institute_id?: string;
} }
export type MarkSchemeType = 'points' | 'levels' | 'parts' | 'checklist' | 'free'; export type MarkSchemeType = points | levels | parts | checklist | free;
export interface MarkSchemePoint { export interface MarkSchemePoint {
mark: number; mark: number;
@@ -92,12 +92,12 @@ export interface ExamQuestion {
} }
export type ExamResponseAreaKind = export type ExamResponseAreaKind =
| 'response' | response
| 'context' | context
| 'question_number' | question_number
| 'mark_area' | mark_area
| 'reference' | reference
| 'furniture'; | furniture;
export interface ExamResponseArea { export interface ExamResponseArea {
id: string; id: string;
@@ -108,7 +108,7 @@ export interface ExamResponseArea {
kind: ExamResponseAreaKind; kind: ExamResponseAreaKind;
response_form: string | null; response_form: string | null;
context_type?: string | null; context_type?: string | null;
source: 'manual' | 'ai'; source: manual | ai;
confirmed: boolean; confirmed: boolean;
confidence: number | null; confidence: number | null;
} }
@@ -121,7 +121,7 @@ export interface ExamBoundary {
page_index: number; page_index: number;
y: number; y: number;
bounds: Record<string, number> | null; bounds: Record<string, number> | null;
source: 'manual' | 'ai'; source: manual | ai;
confirmed: boolean; confirmed: boolean;
} }
@@ -131,57 +131,11 @@ export interface ExamTemplateDetail extends ExamTemplate {
boundaries: ExamBoundary[]; boundaries: ExamBoundary[];
} }
export interface TemplateReplacePayload {
meta?: {
title?: string;
subject?: string;
page_count?: number;
status?: ExamTemplateStatus;
};
questions: Array<{
id?: string;
parent_id?: string | null;
label: string;
order?: number;
max_marks?: number;
answer_type?: 'written' | 'mcq' | 'short' | 'diagram' | null;
mcq_options?: unknown | null;
mark_scheme?: Record<string, unknown>;
is_container?: boolean;
spec_ref?: string | null;
bounds?: Record<string, number> | null;
page?: number | null;
}>;
response_areas: Array<{
id?: string;
question_id: string;
page: number;
bounds: Record<string, number>;
kind: ExamResponseArea['kind'];
response_form?: string | null;
context_type?: string | null;
source?: 'manual' | 'ai';
confirmed?: boolean;
confidence?: number | null;
}>;
boundaries: Array<{
id?: string;
question_id?: string | null;
label?: string | null;
page_index: number;
y: number;
bounds?: Record<string, number> | null;
source?: 'manual' | 'ai';
confirmed?: boolean;
}>;
}
export interface PatchQuestionPayload { export interface PatchQuestionPayload {
label?: string; label?: string;
order?: number; order?: number;
max_marks?: number; max_marks?: number;
answer_type?: 'written' | 'mcq' | 'short' | 'diagram' | null; answer_type?: written | mcq | short | diagram | null;
mcq_options?: unknown; mcq_options?: unknown;
mark_scheme?: MarkScheme; mark_scheme?: MarkScheme;
is_container?: boolean; is_container?: boolean;
@@ -201,3 +155,48 @@ export interface Neo4jSyncResult {
status: string; status: string;
projection?: Record<string, unknown>; projection?: Record<string, unknown>;
} }
export interface TemplateReplacePayload {
meta?: {
title?: string;
subject?: string;
page_count?: number;
status?: ExamTemplateStatus;
};
questions: Array<{
id?: string;
parent_id?: string | null;
label: string;
order?: number;
max_marks?: number;
answer_type?: written | mcq | short | diagram | null;
mcq_options?: unknown | null;
mark_scheme?: MarkScheme;
is_container?: boolean;
spec_ref?: string | null;
bounds?: Record<string, number> | null;
page?: number | null;
}>;
response_areas: Array<{
id?: string;
question_id: string;
page: number;
bounds: Record<string, number>;
kind: ExamResponseAreaKind;
response_form?: string | null;
context_type?: string | null;
source?: manual | ai;
confirmed?: boolean;
confidence?: number | null;
}>;
boundaries: Array<{
id?: string;
question_id?: string | null;
label?: string | null;
page_index: number;
y: number;
bounds?: Record<string, number> | null;
source?: manual | ai;
confirmed?: boolean;
}>;
}