Skip to content

Commit 4c68d65

Browse files
feat: finished making quiz and passes tests
1 parent 7e50490 commit 4c68d65

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
<<<<<<< HEAD
910
computerparts:
1011
- $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342
1112
- $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0.
1213
- $2y$10$JXoeInFy4UzHhi2Lskxzeu7CQ9RprnJgBw9pjAlV.t6zQyJTyy8OK
14+
=======
15+
mercedesmathews:
16+
- $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa
17+
- $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y
18+
- $2y$10$yI/2BgOyqQfLdHM3ixPE5uLu89su/sHRJB2c5szDFIAYXDhRakS.C
19+
>>>>>>> 8292062 (feat: finished making quiz and passes tests)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class MercedesMathewsQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'mercedesmathews';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
MercedesMathewsQuiz.makeQuestion0(),
16+
MercedesMathewsQuiz.makeQuestion1(),
17+
MercedesMathewsQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Which HTML tag is used for a secondary header?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, '<h1>'],
27+
[AnswerChoice.B, '<h2>'],
28+
[AnswerChoice.C, '<h3>'],
29+
[AnswerChoice.D, '<h4>'],
30+
]),
31+
AnswerChoice.UNANSWERED,
32+
); // Replace `UNANSWERED` with the correct answer.
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'Which HTML tag makes text bold?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, '<strong>'],
41+
[AnswerChoice.B, '<b>'],
42+
[AnswerChoice.C, 'Both of the above'],
43+
[AnswerChoice.D, 'Neither of the above'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Replace `UNANSWERED` with the correct answer.
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'Which HTML tag is not a void element and needs a closing tag?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, '<img>'],
55+
[AnswerChoice.B, '<br>'],
56+
[AnswerChoice.C, '<link>'],
57+
[AnswerChoice.D, '<a>'],
58+
]),
59+
AnswerChoice.UNANSWERED,
60+
); // Replace `UNANSWERED` with the correct answer.
61+
}
62+
}

lesson_03/quiz/src/quizzes/quizzes.module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
44
import { Jbeyquiz } from './jbeyquiz.js';
5+
import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js';
56

67
export const Quizzes = Symbol.for('Quizzes');
78

89
// Add your quiz provider here.
9-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, Jbeyquiz];
10+
const QUIZ_PROVIDERS = [
11+
AnthonyMaysQuiz,
12+
AnotherQuiz,
13+
MercedesMathewsQuiz,
14+
Jbeyquiz,
15+
];
1016

1117
@Module({
1218
providers: [

0 commit comments

Comments
 (0)