In Synap, the term, quiz, is referenced as the Test class.
Tests store information on the questions they contain, and point
to a number of other related objects. When querying for a specific test,
we will return a 'data transfer object', shortened to DTO. This object
only contains fields that are relevant to the task at hand.
interface TestDTO {
objectId: string;
createdAt: Date;
updatedAt: Date;
title: string;
slug: string;
description: string;
isSpacedRepetition: boolean;
isGenerated: boolean;
tags: string[];
totalQuestions: number;
questions: TestDTO.Question[];
author: TestDTO.User;
}
namespace TestDTO {
export interface Question {
objectId: string;
createdAt: Date;
updatedAt: Date;
stem: string;
options: Option[];
optionType: OptionType;
feedback: string;
tags?: string[];
image?: File;
feedbackImage?: File;
bank?: QuestionBank;
emqGroup?: EmqGroup;
emqGroupOrder?: number;
}
interface Option {
phrase: string;
isCorrect: boolean;
rank?: number;
}
type OptionType = 'phrase' | 'phrase:multipleCorrect' | 'phrase:ranked'
interface EmqGroup {
objectId: string;
createdAt: Date;
updatedAt: Date;
instructions: string;
title?: string;
feedback?: string;
image?: File;
}
export interface User {
objectId: string;
createdAt: Date;
updatedAt: Date;
name: string;
slug: string;
email: string;
bio?: string;
attr?: { [key: string]: any };
emailVerified?: boolean;
profilePicture?: File;
}
export interface File {
__type: 'Pointer';
_name: string;
_url: string;
}
export interface QuestionBank {
objectId: string;
createdAt: Date;
updatedAt: Date;
name: string;
}
}