Skip to content

Commit ccdfd32

Browse files
Adds custom question class to represent each question
1 parent 71311c7 commit ccdfd32

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export class Question {
2+
title: string;
3+
descMd: string;
4+
displayedQuestion: string;
5+
categories: string[];
6+
difficulty: number;
7+
id: number;
8+
9+
constructor(
10+
id: number,
11+
title: string,
12+
descMd: string,
13+
categories: string[],
14+
difficulty: number
15+
) {
16+
this.title = title;
17+
this.descMd = descMd;
18+
this.categories = categories;
19+
this.difficulty = difficulty;
20+
this.id = id;
21+
this.displayedQuestion = `${id}. ${title}`;
22+
}
23+
}
24+
25+
export type QnFilter = {
26+
qnFilter?: string;
27+
tagFilter?: Set<string>;
28+
difficultyFilter?: [number, number];
29+
titleAscd?: boolean;
30+
};

0 commit comments

Comments
 (0)