import type { Exception, GraderMap } from '../ExamGrader'; import { GradingResult, QuestionGrader } from '../graders/QuestionGrader'; import { ResponseKind } from '../response/common'; import { ValidSubmission } from '../response/responses'; import { AppliedCurve, ExamCurve } from './ExamCurve'; import { Exam, Question, Section } from './exam_components'; import { StudentInfo } from './exam_specification'; import { Randomizer } from './randomization'; import { ExamComponentSkin } from './skins'; import { TransparentExamManifest, TransparentQuestionManifest, TransparentQuestionSubmission, TransparentSectionManifest, TransparentSectionSubmission, TrustedExamSubmission } from './submissions'; export type UUID_Strategy = "plain" | "uuidv4" | "uuidv5"; export type UUID_Options = { strategy: "uuidv5"; v5_namespace: string; } | { strategy: Exclude; }; /** * Takes an ID for an exam, section, or question and creates a uuid * for a particular student's instance of that entity. The uuid is * created based on the policy specified in the `ExamGenerator`'s * options when it is created, which may depend on the provided * student uniqname. * @param uniqname * @param id * @returns */ export declare function createStudentUuid(options: UUID_Options, uniqname: string, id: string): string; export declare function createStudentExamUuid(options: UUID_Options, uniqname: string, exam_id: string): string; export declare function createStudentSectionUuid(options: UUID_Options, uniqname: string, exam_id: string, section_id: string): string; export declare function createStudentQuestionUuid(options: UUID_Options, uniqname: string, exam_id: string, question_id: string): string; export declare class AssignedQuestion { readonly uuid: string; readonly student: StudentInfo; readonly question: Question; readonly skin: ExamComponentSkin; readonly displayIndex: string; readonly rawSubmission: string | undefined; readonly gradedBy?: QuestionGrader; readonly gradingResult?: GradingResult; readonly exception?: Exception; readonly submission: ValidSubmission; readonly html_description: string; readonly html_postscript: string; constructor(uuid: string, student: StudentInfo, question: Question, skin: ExamComponentSkin, displayIndex: string, rawSubmission: string | undefined); static createFromSubmission(question: Question, student: StudentInfo, question_submission: TransparentQuestionManifest | TransparentQuestionSubmission, section_skin?: ExamComponentSkin): AssignedQuestion; static createFromSubmissionWithSkinOverride(question: Question, student: StudentInfo, question_submission: TransparentQuestionManifest | TransparentQuestionSubmission, skin: ExamComponentSkin): AssignedQuestion; setRawSubmission(raw_submission: string): void; getFullAnswers(): TransparentQuestionSubmission; grade(grader: QuestionGrader): void; addException(exception: Exception): void; get pointsEarned(): number | undefined; get pointsEarnedWithoutExceptions(): number | undefined; isGraded(): this is GradedQuestion; wasGradedBy(grader: QuestionGrader): this is GradedQuestion; isKind(kind: RK): this is AssignedQuestion; } export declare function wereGradedBy(questions: readonly AssignedQuestion[], grader: QuestionGrader): questions is readonly GradedQuestion[]; export interface GradedQuestion extends AssignedQuestion { readonly pointsEarned: number; readonly pointsEarnedWithoutExceptions: number; readonly gradedBy: QuestionGrader; readonly gradingResult: GR; } export declare function areAllGradedQuestions(exams: AssignedQuestion[]): exams is GradedQuestion[]; export declare function areAllGradedQuestions(exams: readonly AssignedQuestion[]): exams is readonly GradedQuestion[]; export declare function isGradedQuestion(aq: AssignedQuestion): aq is GradedQuestion; export declare class AssignedSection { readonly uuid: string; readonly student: StudentInfo; readonly section: Section; readonly sectionIndex: number; readonly skin: ExamComponentSkin; readonly assignedQuestions: readonly AssignedQuestion[]; readonly displayIndex: string; readonly pointsPossible: number; readonly pointsEarned?: number; private _isFullyGraded; readonly html_description: string; readonly html_reference?: string; constructor(uuid: string, student: StudentInfo, section: Section, sectionIndex: number, skin: ExamComponentSkin, assignedQuestions: readonly AssignedQuestion[]); static createFromSubmission(section: Section, section_index: number, student: StudentInfo, section_submission: TransparentSectionManifest | TransparentSectionSubmission): AssignedSection; gradeAllQuestions(ex: AssignedExam, graders: GraderMap): void; isGraded(): this is GradedSection; } export interface GradedSection extends AssignedSection { readonly pointsEarned: number; } export declare function areAllGradedSections(sections: AssignedSection[]): sections is GradedSection[]; export declare function areAllGradedSections(sections: readonly AssignedSection[]): sections is readonly GradedSection[]; export declare class AssignedExam { readonly uuid: string; readonly exam: Exam; readonly student: StudentInfo; readonly pointsPossible: number; readonly pointsEarned?: number; private _isFullyGraded; readonly curve?: AppliedCurve; private assignedQuestionById; readonly assignedSections: readonly AssignedSection[]; readonly assignedQuestions: readonly AssignedQuestion[]; constructor(uuid: string, exam: Exam, student: StudentInfo, assignedSections: readonly AssignedSection[], allowDuplicates: boolean); static createFromManifest(exam: Exam, manifest: TransparentExamManifest): AssignedExam; static createFromSubmission(exam: Exam, submission: TrustedExamSubmission): AssignedExam; private static createFromSubmission_impl; static createRandomized(exam: Exam, student: StudentInfo, uuid_options: UUID_Options, seed: string, allow_duplicates?: boolean, rand?: Randomizer): AssignedExam; private static createRandomizedSection; private static createRandomizedQuestion; getAssignedQuestionById(question_id: string): AssignedQuestion | undefined; gradeAll(graders: GraderMap): void; isGraded(): this is GradedExam; applyCurve(this: GradedExam, curve: ExamCurve): void; renderGrade(): string; createManifest(): TransparentExamManifest; } export declare function areAllGradedExams(exams: AssignedExam[]): exams is GradedExam[]; export declare function areAllGradedExams(exams: readonly AssignedExam[]): exams is readonly GradedExam[]; export interface GradedExam extends AssignedExam { readonly pointsEarned: number; }