19 lines
391 B
TypeScript
Executable file
19 lines
391 B
TypeScript
Executable file
export namespace main {
|
|
|
|
export class Quiz {
|
|
Question: string;
|
|
Answers: string[];
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Quiz(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.Question = source["Question"];
|
|
this.Answers = source["Answers"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|