Skip to content

Commit 045b84a

Browse files
committed
chore: revert quiz before submit
1 parent f4aaa36 commit 045b84a

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

lesson_05/quiz/src/lesson5.ts

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ import {
22
AnswerChoice,
33
MultipleChoiceQuizQuestion,
44
QuizPrinter,
5+
QuizQuestion,
56
} from "codedifferently-instructional";
7+
68
export class Lesson5 {
7-
run() {
9+
run(): void {
810
const quizQuestions = Lesson5.makeQuizQuestions();
911
if (!quizQuestions) throw new Error("Quiz questions cannot be null");
1012
const printer = new QuizPrinter();
1113
printer.printQuiz(quizQuestions);
1214
}
13-
static makeQuizQuestions() {
15+
16+
static makeQuizQuestions(): QuizQuestion[] {
1417
return [
1518
Lesson5.makeQuestion0(),
1619
Lesson5.makeQuestion1(),
@@ -24,7 +27,8 @@ export class Lesson5 {
2427
Lesson5.makeQuestion9(),
2528
];
2629
}
27-
static makeQuestion0() {
30+
31+
private static makeQuestion0(): QuizQuestion {
2832
return new MultipleChoiceQuizQuestion(
2933
0,
3034
"What is the purpose of the <h1> tag in HTML?",
@@ -34,10 +38,11 @@ export class Lesson5 {
3438
[AnswerChoice.C, "To insert an image"],
3539
[AnswerChoice.D, "To create a paragraph"],
3640
]),
37-
AnswerChoice.B,
41+
AnswerChoice.UNANSWERED,
3842
);
3943
}
40-
static makeQuestion1() {
44+
45+
private static makeQuestion1(): QuizQuestion {
4146
return new MultipleChoiceQuizQuestion(
4247
1,
4348
"Which attribute is used to specify alternative text for an image in HTML?",
@@ -47,10 +52,11 @@ export class Lesson5 {
4752
[AnswerChoice.C, "alt"],
4853
[AnswerChoice.D, "href"],
4954
]),
50-
AnswerChoice.C,
55+
AnswerChoice.UNANSWERED,
5156
);
5257
}
53-
static makeQuestion2() {
58+
59+
private static makeQuestion2(): QuizQuestion {
5460
return new MultipleChoiceQuizQuestion(
5561
2,
5662
"Which HTML tag is used to create a hyperlink?",
@@ -60,10 +66,11 @@ export class Lesson5 {
6066
[AnswerChoice.C, "<div>"],
6167
[AnswerChoice.D, "<link>"],
6268
]),
63-
AnswerChoice.B,
69+
AnswerChoice.UNANSWERED,
6470
);
6571
}
66-
static makeQuestion3() {
72+
73+
private static makeQuestion3(): QuizQuestion {
6774
return new MultipleChoiceQuizQuestion(
6875
3,
6976
"Which of the following is a semantic HTML tag?",
@@ -73,10 +80,11 @@ export class Lesson5 {
7380
[AnswerChoice.C, "<span>"],
7481
[AnswerChoice.D, "<br>"],
7582
]),
76-
AnswerChoice.B,
83+
AnswerChoice.UNANSWERED,
7784
);
7885
}
79-
static makeQuestion4() {
86+
87+
private static makeQuestion4(): QuizQuestion {
8088
return new MultipleChoiceQuizQuestion(
8189
4,
8290
"What does CSS stand for?",
@@ -86,10 +94,11 @@ export class Lesson5 {
8694
[AnswerChoice.C, "Computer Style Sheets"],
8795
[AnswerChoice.D, "Cascading System Sheets"],
8896
]),
89-
AnswerChoice.B,
97+
AnswerChoice.UNANSWERED,
9098
);
9199
}
92-
static makeQuestion5() {
100+
101+
private static makeQuestion5(): QuizQuestion {
93102
return new MultipleChoiceQuizQuestion(
94103
5,
95104
"Which CSS property is used to change the text color?",
@@ -99,10 +108,11 @@ export class Lesson5 {
99108
[AnswerChoice.C, "text-color"],
100109
[AnswerChoice.D, "background-color"],
101110
]),
102-
AnswerChoice.B,
111+
AnswerChoice.UNANSWERED,
103112
);
104113
}
105-
static makeQuestion6() {
114+
115+
private static makeQuestion6(): QuizQuestion {
106116
return new MultipleChoiceQuizQuestion(
107117
6,
108118
"How do you add a comment in CSS?",
@@ -112,10 +122,11 @@ export class Lesson5 {
112122
[AnswerChoice.C, "/* this is a comment */"],
113123
[AnswerChoice.D, "<!-- this is a comment -->"],
114124
]),
115-
AnswerChoice.C,
125+
AnswerChoice.UNANSWERED,
116126
);
117127
}
118-
static makeQuestion7() {
128+
129+
private static makeQuestion7(): QuizQuestion {
119130
return new MultipleChoiceQuizQuestion(
120131
7,
121132
"Which CSS property controls the size of text?",
@@ -125,10 +136,11 @@ export class Lesson5 {
125136
[AnswerChoice.C, "text-size"],
126137
[AnswerChoice.D, "text-style"],
127138
]),
128-
AnswerChoice.B,
139+
AnswerChoice.UNANSWERED,
129140
);
130141
}
131-
static makeQuestion8() {
142+
143+
private static makeQuestion8(): QuizQuestion {
132144
return new MultipleChoiceQuizQuestion(
133145
8,
134146
"What is the default display value for `<div>` in CSS?",
@@ -138,10 +150,11 @@ export class Lesson5 {
138150
[AnswerChoice.C, "inline-block"],
139151
[AnswerChoice.D, "none"],
140152
]),
141-
AnswerChoice.B,
153+
AnswerChoice.UNANSWERED,
142154
);
143155
}
144-
static makeQuestion9() {
156+
157+
private static makeQuestion9(): QuizQuestion {
145158
return new MultipleChoiceQuizQuestion(
146159
9,
147160
"How do you link an external CSS file to an HTML document?",
@@ -151,11 +164,11 @@ export class Lesson5 {
151164
[AnswerChoice.C, "<stylesheet link='styles.css'>"],
152165
[AnswerChoice.D, "<css href='styles.css'>"],
153166
]),
154-
AnswerChoice.A,
167+
AnswerChoice.UNANSWERED,
155168
);
156169
}
157170
}
171+
158172
if (!process.env.JEST_WORKER_ID) {
159173
new Lesson5().run();
160174
}
161-
//# sourceMappingURL=lesson5.js.map

0 commit comments

Comments
 (0)