Skip to content

Commit 0eabf6f

Browse files
feat: adds quiz for David
* quiz creation complete * check failed * Fixing Duplicate Code --------- Co-authored-by: Anthony D. Mays <[email protected]>
1 parent b680200 commit 0eabf6f

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
davidsmith:
10+
- $2y$10$EM5346ILJER4xu66qf1OcuJ/7f6hCOb9z1OUHgSXvl3QuCohBySTm
11+
- $2y$10$gWIUYJPn94weKopOVQKTl.XOwODK1tamszmt4uXCJupZofi7vXPdq
12+
- $2y$10$eh1.Cd6tXSmolUnY02xwM.BVR7RkYqJIDHepPfk8wJBIwol4jRw0S
913
dennislipscomb:
1014
- $2y$10$Y9gmPBd6JGgk06f/uv1MNOGf7sqxqfxYmF5GW48aZ95Homie8FdCC
1115
- $2y$10$vSETgB7wDGzpe5IQwGaZee2N7n1FafP.UelRv3QfpnZ4e.wvUmN8e
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
66
import { ChelseaOgbonniaQuiz } from './chelsea_ogbonnia_quiz.js';
77
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
88
import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
9+
import { DavidSmithQuiz } from './david_smith_quiz.js';
910
import { DennisQuiz } from './dennis_quiz.js';
1011
import { HummadTanweerQuiz } from './hummad_tanweer_quiz.js';
1112
import { JamesCapparellQuiz } from './james_capparell_quiz.js';
@@ -22,10 +23,11 @@ import { ZionBuchananQuiz } from './zion_buchanan_quiz.js';
2223

2324
export const Quizzes = Symbol.for('Quizzes');
2425

25-
// Add your quiz provider here.;
26+
// Add your quiz provider here.
2627
const QUIZ_PROVIDERS = [
2728
AnthonyMaysQuiz,
2829
YafiahAbdullahQuiz,
30+
DavidSmithQuiz,
2931
JamesCapparellQuiz,
3032
AnotherQuiz,
3133
JosephCaballeroQuiz,

0 commit comments

Comments
 (0)