Skip to content

Commit 97ac2e4

Browse files
NcoleJacnjackson0906anthonydmays
authored
feat: adds Nicole's custom quiz (#118)
Co-authored-by: NcoleJac <[email protected]> Co-authored-by: Anthony D. Mays <[email protected]>
1 parent a27b921 commit 97ac2e4

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
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+
nicolejackson:
10+
- $2y$10$eRdxpAR2N0ELMjdQ0DGzlOc8Lx5EhhwcddRJ3qPjit9nH9fwORhg.
11+
- $2y$10$eRdxpAR2N0ELMjdQ0DGzlOc8Lx5EhhwcddRJ3qPjit9nH9fwORhg.
12+
- $2y$10$eRdxpAR2N0ELMjdQ0DGzlOc8Lx5EhhwcddRJ3qPjit9nH9fwORhg.
913
mattieweathersby:
1014
- $2y$10$WxUCKALSc8EWp1uj26U./exKFNnV5yUtnP04IK.dX/G0A5QB94qXS
1115
- $2y$10$WxUCKALSc8EWp1uj26U./exKFNnV5yUtnP04IK.dX/G0A5QB94qXS
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class NicoleJacksonQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'nicolejackson';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
NicoleJacksonQuiz.makeQuestion0(),
16+
NicoleJacksonQuiz.makeQuestion1(),
17+
NicoleJacksonQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Which of the following MAC OS Terminal commands will allow you to list directories?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'pwd'],
27+
[AnswerChoice.B, 'ls'],
28+
[AnswerChoice.C, 'cd ..'],
29+
[AnswerChoice.D, 'mkdir'],
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+
'What is a CPU?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'Central Printing Unit'],
41+
[AnswerChoice.B, 'Central Processing Unit'],
42+
[AnswerChoice.C, 'Computer Programming Unit'],
43+
[AnswerChoice.D, 'Coding Protocol Unit'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Provide an answer.
47+
}
48+
private static makeQuestion2(): QuizQuestion {
49+
return new MultipleChoiceQuizQuestion(
50+
2,
51+
'Using boolean logic, which of the following would not represent a true value?',
52+
new Map<AnswerChoice, string>([
53+
[AnswerChoice.A, 'yes'],
54+
[AnswerChoice.B, 'probable'],
55+
[AnswerChoice.C, 'true'],
56+
[AnswerChoice.D, '1'],
57+
]),
58+
AnswerChoice.UNANSWERED,
59+
); // Provide an answer.
60+
61+
62+
63+
}
64+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Module } from '@nestjs/common';
22
import { DanielsonAdjocyQuiz } from './danielson_adjocys_quiz.js';
33
import { AnotherQuiz } from './another_quiz.js';
44
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
5+
import { NicoleJacksonQuiz } from './nicole_jackson_quiz.js';
56
import { MattieWeathersbyQuiz } from './mweathersby_quiz.js';
67
import { KerryFergusonQuiz } from './kerry_ferguson_quiz.js';
78
import { BenjaminScottQuiz } from './benjamin_scott_quiz.js';
@@ -17,6 +18,7 @@ export const Quizzes = Symbol.for('Quizzes');
1718
// Add your quiz provider here.
1819
const QUIZ_PROVIDERS = [
1920
AnthonyMaysQuiz,
21+
NicoleJacksonQuiz,
2022
TrinitieJacksonQuiz,
2123
BrooklynHardenQuiz,
2224
TyranRicesQuiz,

0 commit comments

Comments
 (0)