Skip to content

Commit 8a0f9a3

Browse files
feat: adds Joy's lesson03 quiz (#309)
* add my quiz * feat: Added the required dependencies for the tests to pass --------- Co-authored-by: Anthony D. Mays <[email protected]>
1 parent a12ae59 commit 8a0f9a3

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
@@ -17,6 +17,10 @@ quiz:
1717
anotherone:
1818
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
1919
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
20+
joybrown:
21+
- $2y$10$yTiBtEBryEjrDBCr2oMgM.ZK5brflCLeA6jrUeYFMp2Chy8wMYTQS
22+
- $2y$10$6v2jhMmq59J50eApiMlPaufiq8piTl8fWxVkZba8OayMSVtcp1XPG
23+
- $2y$10$PAhEzyzGbbr0G9GmPTcKLueZUSjn5bccbPZKYJWinvlW.FHnRtdeq
2024
calvinrobinson:
2125
- $2y$10$cq2na3OgOfB0rpCum0vwA./4zXbQ2xZT5avpyfmpp9e0LDtU5eJu.
2226
- $2y$10$yog14Y5aV9U3lPv3s9FhaORRwg9rRslGdnBt8Px8ASQWtxUjgwHpS
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+
9+
export class JoyBrownQuiz implements QuizQuestionProvider {
10+
getProviderName(): string {
11+
return 'joybrown';
12+
}
13+
14+
makeQuizQuestions(): QuizQuestion[] {
15+
return [
16+
JoyBrownQuiz.makeQuestion0(),
17+
JoyBrownQuiz.makeQuestion1(),
18+
JoyBrownQuiz.makeQuestion2(),
19+
20+
];
21+
}
22+
23+
private static makeQuestion0(): QuizQuestion {
24+
return new MultipleChoiceQuizQuestion(
25+
0,
26+
'What is a pull?',
27+
new Map<AnswerChoice, string>([
28+
[AnswerChoice.A, 'A download.'],
29+
[AnswerChoice.B, 'A upload.'],
30+
[
31+
AnswerChoice.C,
32+
'Saving a file.',
33+
],
34+
[AnswerChoice.D, 'A request to merge your changes into another branch.'],
35+
]),
36+
AnswerChoice.UNANSWERED,
37+
); // Replace `UNANSWERED` with the correct answer.
38+
}
39+
40+
private static makeQuestion1(): QuizQuestion {
41+
return new QuizQuestion(
42+
1,
43+
'Git is an online cloud for coding, Yes or No',
44+
'No',
45+
); // Provide an answer.
46+
}
47+
48+
private static makeQuestion2(): QuizQuestion {
49+
return new MultipleChoiceQuizQuestion(
50+
2,
51+
'Which command makes a new directory',
52+
new Map<AnswerChoice, string>([
53+
[AnswerChoice.A, 'mkdir'],
54+
[AnswerChoice.B, 'cp'],
55+
[
56+
AnswerChoice.C,
57+
'rm',
58+
],
59+
[AnswerChoice.D, 'mv'],
60+
]),
61+
AnswerChoice.UNANSWERED,
62+
); // Replace `UNANSWERED` with the correct answer.
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 { JoyBrownQuiz } from './joy_brown_quiz.js';
56
import { CalvinRobinsonQuiz } from './calvin_robinson_quiz.js';
67
import { DanielBoyceQuiz } from './daniel_boyce_quiz.js';
78
import { NicoleJacksonQuiz } from './nicole_jackson_quiz.js';
@@ -31,6 +32,7 @@ const QUIZ_PROVIDERS = [
3132
DevynBensonQuiz,
3233
TyranRicesQuiz,
3334
AnotherQuiz,
35+
JoyBrownQuiz,
3436
CalvinRobinsonQuiz,
3537
MattieWeathersbyQuiz,
3638
BenjaminScottQuiz,

0 commit comments

Comments
 (0)