Skip to content

Commit 79dc002

Browse files
committed
quiz creation complete
1 parent aa65ed1 commit 79dc002

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ quiz:
44
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
55
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
66
anotherone:
7-
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
7+
- $2y$10$g1XJB.GyuK8RVdnc4JeU7ezsXL8DYgjS.KhqRLRh/PQnxdLUDL5tG
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
davidsmith:
10+
- $2y$10$EM5346ILJER4xu66qf1OcuJ/7f6hCOb9z1OUHgSXvl3QuCohBySTm
11+
- $2y$10$gWIUYJPn94weKopOVQKTl.XOwODK1tamszmt4uXCJupZofi7vXPdq
12+
- $2y$10$eh1.Cd6tXSmolUnY02xwM.BVR7RkYqJIDHepPfk8wJBIwol4jRw0S
913
oyeyemijimoh:
1014
- $2y$10$2LlSxAEM1HmR3Wl2fO6LQueu/77spr5SuWAh4b3MKesIWNy3CFjGe
1115
- $2y$10$csA90DFxK7.uq6dSfS06Yukk5fQPrzLvU2Lp43ArTs2za28LVvRGO
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class DavidSmithQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'davidsmith';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
DavidSmithQuiz.makeQuestion0(),
16+
DavidSmithQuiz.makeQuestion1(),
17+
DavidSmithQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Where have I worked before?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'JPMorganChase&Co.'],
27+
[AnswerChoice.B, 'Capital One'],
28+
[AnswerChoice.C, 'Nvidia'],
29+
[AnswerChoice.D, 'Meta'],
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+
'Have I worked at Code Differently before?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'Yes'],
41+
[AnswerChoice.B, 'No'],
42+
]),
43+
AnswerChoice.UNANSWERED,
44+
); // Replace `UNANSWERED` with the correct answer.
45+
}
46+
private static makeQuestion2(): QuizQuestion {
47+
return new MultipleChoiceQuizQuestion(
48+
2,
49+
'Was Jordan my teacher when I started coding',
50+
new Map<AnswerChoice, string>([
51+
[AnswerChoice.A, 'Yes'],
52+
[AnswerChoice.B, 'No'],
53+
]),
54+
AnswerChoice.UNANSWERED,
55+
); // Replace `UNANSWERED` with the correct answer.
56+
}
57+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Module } from '@nestjs/common';
2-
import { AnotherQuiz } from './another_quiz.js';
3-
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
2+
import { DavidSmithQuiz } from './another_quiz.js';
43
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
54
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
5+
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
66
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
77

88
export const Quizzes = Symbol.for('Quizzes');
@@ -12,7 +12,7 @@ export const Quizzes = Symbol.for('Quizzes');
1212
const QUIZ_PROVIDERS = [
1313
AnthonyMaysQuiz,
1414
YafiahAbdullahQuiz,
15-
AnotherQuiz,
15+
DavidSmithQuiz,
1616
JosephCaballeroQuiz,
1717
OyeyemiJimohQuiz,
1818
];

0 commit comments

Comments
 (0)