Skip to content

Commit 8292062

Browse files
feat: finished making quiz and passes tests
1 parent 04825a1 commit 8292062

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ quiz:
55
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
8-
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
8+
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
mercedesmathews:
10+
- $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa
11+
- $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y
12+
- $2y$10$yI/2BgOyqQfLdHM3ixPE5uLu89su/sHRJB2c5szDFIAYXDhRakS.C
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js';
45

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

78
// Add your quiz provider here.
8-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz];
9+
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, MercedesMathewsQuiz];
910

1011
@Module({
1112
providers: [

0 commit comments

Comments
 (0)