import { GradingStructure } from '@digabi/exam-engine-core'; import { Document } from 'libxmljs2'; interface VideoMetadata { width: number; height: number; } interface ImageMetadata { width: number; height: number; } interface AudioMetadata { duration: number; } export type ExamType = 'normal' | 'visually-impaired' | 'hearing-impaired'; export type GenerateUuid = (metadata?: { examCode: string; date: string; language: string; type: ExamType; }) => Promise | string; export type GetMediaMetadata = (src: string, type: 'image' | 'video' | 'audio') => Promise; export interface MasteringOptions { /** * A secret salt-like value used in shuffling multi choice answers * deterministically. This value should be kept secret, otherwise an attacker * could reverse engineer the original order of ` or * `` elements. * * If set to `undefined`, multichoice answers will not be shuffled. */ multiChoiceShuffleSecret?: string; /** * Remove elements that reveal correct answers to the student. By default, this is set to true, but in some contexts * (such as when generating grading instructions) we want to preserve more content in the XML. */ removeCorrectAnswers?: boolean; /** * Remove meta attributes that might reveal information about question for the student. By default, this is set to true, but in some contexts * (answer analysis) we want to preserve more content in the XML. */ removeMetadata?: boolean; /** * Throws an error if encountering an invalid LaTeX formula in an * `…` element. */ throwOnLatexError?: boolean; /** * Group sibling choice-answer elements under one choicegroup question. * This enables minus point handling within a single choicegroup. */ groupChoiceAnswers?: boolean; /** * Master exams differently when supporting editable grading instructions */ editableGradingInstructions?: boolean; } /** * Parse an exam XML file. This should be the only function used for parsing * exam XML files, since it sets libxmljs2 options that are necessary for * security purposes. */ export declare function parseExam(xml: string, validate?: boolean): Document; export interface Attachment { filename: string; restricted: boolean; visibleInGradingInstructions: boolean; withinGradingInstruction: boolean; } export interface MasteringResult { /** The attachments used by this exam version. */ attachments: Attachment[]; /** The date of the exam. */ date: string | null; /** The optional day code of the exam. Only used in YO exams. */ dayCode: string | null; /** The optional exam code of the exam. Only used in YO exams. */ examCode: string | null; /** An UUID that uniquely identifies this exam version. */ examUuid: string; /** The data structure used by Abitti to grade this exam version. */ gradingStructure: GradingStructure; /** Strings in the exam to be sent to the translator. */ translation: string; /** The language of this exam version. Defined in the `` element of the XML. */ language: string; /** The optional title of this exam */ title: string | null; /** The type of the exam */ type: ExamType; /** The mastered XML. */ xml: string; } export type GenerateId = () => number; /** * Master an exam. */ export declare function masterExam(xml: string, generateUuid: GenerateUuid, getMediaMetadata: GetMediaMetadata, options?: MasteringOptions): Promise; export {}; //# sourceMappingURL=index.d.ts.map