Skip to content

Commit 233ff97

Browse files
dahwanthonydmays
andauthored
feat: adds Dean's custom quiz (#112)
Co-authored-by: Anthony D. Mays <[email protected]>
1 parent 1fa2290 commit 233ff97

File tree

3 files changed

+91
-9
lines changed

3 files changed

+91
-9
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ quiz:
3030
brooklynharden:
3131
- $2y$10$FMRsdjEhIG0anbZOIcVvSOy4e4eFTZGIYYyATChwc.QRMpWuomR5C
3232
- $2y$10$0AQW/94c4pPxp8xIhJUIs.qoLnUuQg/Hwe1vd4975K96EKGEPz.H6
33-
- $2y$10$ibNpd6ZjWh/yRXafaN8R5.vxbBw7KVZ7r4IsFv4Uy3naXqagr2B5W
33+
- $2y$10$ibNpd6ZjWh/yRXafaN8R5.vxbBw7KVZ7r4IsFv4Uy3naXqagr2B5W
34+
dean_walston_25_2:
35+
- $2y$10$avH4Adz6z900VAKHK3p0bunDaJBPPckhVzdJ1XWbp/oK3myHl8LMC
36+
- $2y$10$YTgMZYzNVpbjywYu2DvyZOHjtIIjyFj1gyjI5sGLPxjl91s7FHRGO
37+
- $2y$10$xlWI1a5RHpIzgCE65ys5wue6935c9mqH3AKbRfq6ZC7xz5QSsBmYS
38+
- $2y$10$zr1Do5BFxa6Ts6wCd3i9cOeDiJWHK1tY4QbAspwXdVUcrYllLl1vG
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class DeanWalstonQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'dean_walston_25_2';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
DeanWalstonQuiz.makeQuestion0(),
16+
DeanWalstonQuiz.makeQuestion1(),
17+
DeanWalstonQuiz.makeQuestion2(),
18+
DeanWalstonQuiz.makeQuestion3(),
19+
];
20+
}
21+
22+
private static makeQuestion0(): QuizQuestion {
23+
return new MultipleChoiceQuizQuestion(
24+
0,
25+
'What is a programming language?',
26+
new Map<AnswerChoice, string>([
27+
[AnswerChoice.A, 'A way to communicate with computers'],
28+
[AnswerChoice.B, 'A formal language for writing instructions'],
29+
[AnswerChoice.C, 'A set of rules for creating software'],
30+
[AnswerChoice.D, 'All of the above'],
31+
]),
32+
AnswerChoice.UNANSWERED, // Replace `UNANSWERED` with the correct answer.
33+
);
34+
}
35+
36+
private static makeQuestion1(): QuizQuestion {
37+
return new MultipleChoiceQuizQuestion(
38+
1,
39+
'What is source code?',
40+
new Map<AnswerChoice, string>([
41+
[AnswerChoice.A, 'The final program that users can run'],
42+
[
43+
AnswerChoice.B,
44+
'The human-readable instructions written in a programming language',
45+
],
46+
[AnswerChoice.C, 'The binary code that computers execute'],
47+
[AnswerChoice.D, 'The documentation for a program'],
48+
]),
49+
AnswerChoice.UNANSWERED, // Replace `UNANSWERED` with the correct answer.
50+
);
51+
}
52+
53+
private static makeQuestion2(): QuizQuestion {
54+
return new MultipleChoiceQuizQuestion(
55+
2,
56+
'Which Terminal command is used to display the current working directory path?',
57+
new Map<AnswerChoice, string>([
58+
[AnswerChoice.A, 'cd'],
59+
[AnswerChoice.B, 'ls -l'],
60+
[AnswerChoice.C, 'pwd'],
61+
[AnswerChoice.D, 'echo $PATH'],
62+
]),
63+
AnswerChoice.UNANSWERED, // Replace `UNANSWERED` with the correct answer.
64+
);
65+
}
66+
67+
private static makeQuestion3(): QuizQuestion {
68+
return new MultipleChoiceQuizQuestion(
69+
3,
70+
'Which Git command is used to create a new branch and switch to it?',
71+
new Map<AnswerChoice, string>([
72+
[AnswerChoice.A, 'git branch'],
73+
[AnswerChoice.B, 'git checkout -b'],
74+
[AnswerChoice.C, 'git switch'],
75+
[AnswerChoice.D, 'git new'],
76+
]),
77+
AnswerChoice.UNANSWERED, // Replace `UNANSWERED` with the correct answer.
78+
);
79+
}
80+
}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@ import { BenjaminScottQuiz } from './benjamin_scott_quiz.js';
77
import { TrinitieJacksonQuiz } from './trinitie_jackson_quiz.js';
88
import { TyranRicesQuiz } from './tyran_rices_quiz.js';
99
import { BrooklynHardenQuiz } from './brooklyn_harden_quiz.js';
10+
import { DeanWalstonQuiz } from './dean_walston_quiz.js';
1011

1112
export const Quizzes = Symbol.for('Quizzes');
1213

1314
// Add your quiz provider here.
14-
15-
16-
17-
1815
const QUIZ_PROVIDERS = [
19-
AnthonyMaysQuiz,
20-
TrinitieJacksonQuiz,
16+
AnthonyMaysQuiz,
17+
TrinitieJacksonQuiz,
2118
BrooklynHardenQuiz,
2219
TyranRicesQuiz,
2320
AnotherQuiz,
2421
BenjaminScottQuiz,
22+
DanielsonAdjocyQuiz,
23+
DeanWalstonQuiz,
2524
KerryFergusonQuiz,
26-
DanielsonAdjocyQuiz
2725
];
2826

29-
3027
@Module({
3128
providers: [
3229
...QUIZ_PROVIDERS,

0 commit comments

Comments
 (0)