First version with CCNA 2 questions and answers
This commit is contained in:
47
src/data.ts
Normal file
47
src/data.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export enum QuestionTypes {
|
||||
SelectOne,
|
||||
SelectMultiple,
|
||||
AssignValues,
|
||||
TextInput
|
||||
}
|
||||
|
||||
export interface BaseQuestion {
|
||||
/**
|
||||
* Unique ID
|
||||
*/
|
||||
id: string;
|
||||
title: string;
|
||||
images: string[];
|
||||
type: QuestionTypes;
|
||||
}
|
||||
|
||||
export interface SelectOneQuestion extends BaseQuestion {
|
||||
type: QuestionTypes.SelectOne;
|
||||
options: { [key: string]: string };
|
||||
correct: string;
|
||||
}
|
||||
|
||||
export interface SelectMultipleQuestion extends BaseQuestion {
|
||||
type: QuestionTypes.SelectMultiple;
|
||||
options: { [key: string]: string };
|
||||
correct: string[];
|
||||
}
|
||||
|
||||
export interface AssignValuesQuestion extends BaseQuestion {
|
||||
type: QuestionTypes.AssignValues;
|
||||
fields: { [key: string]: string };
|
||||
values: { [key: string]: string };
|
||||
correct: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface TextInputQuestion extends BaseQuestion {
|
||||
type: QuestionTypes.TextInput;
|
||||
correct: string;
|
||||
}
|
||||
|
||||
export type Question = SelectOneQuestion | SelectMultipleQuestion | AssignValuesQuestion | TextInputQuestion;
|
||||
|
||||
export interface Exam {
|
||||
title: string;
|
||||
questions: Question[];
|
||||
}
|
Reference in New Issue
Block a user