Skip to content

Commit 1fa2290

Browse files
feat: Adds Kerry Ferguson's Lesson_03 Quiz (#106)
* feat: Adds Kerry Ferguson's Lesson_03 Quiz * chore: removes extra line breaks * Update quizzes.module.ts --------- Co-authored-by: Anthony D. Mays <[email protected]>
1 parent 692cd51 commit 1fa2290

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-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+
kerryferguson:
10+
- $2y$10$rQOC2ou8kj7O7haspQdoVOgn9nJnNeQqx.bl3JS8FugfT3.gr0cby
11+
- $2y$10$1rKN/68YNsCHyFbIYN5mAOKsmA2L.0IjmoSlHyYsLSabPBTEmQlua
12+
- $2y$10$cesMJeZzsIIh1JqoLmwWh.PtMWXAgJjJuIX0LZJOVWIZxzEna3WzK
913
danielsonadjocy:
1014
- $2y$13$a2VPLkXi0XoTkCgytHabiuFX36ezOtQvSgG8Fjonlp.FYsgDnMQ1S
1115
- $2y$10$z37Nf6Ay1CZrbb3OtmhaXuFGnOqiUgAEc6CThl3iUAVFE3kEYS/cq
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class KerryFergusonQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'kerryferguson';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
KerryFergusonQuiz.makeQuestion0(),
16+
KerryFergusonQuiz.makeQuestion1(),
17+
KerryFergusonQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What is the command to print the working directory in a terminal?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'pwd'],
27+
[AnswerChoice.B, 'ls'],
28+
[AnswerChoice.C, 'dir'],
29+
[AnswerChoice.D, 'cd'],
30+
]),
31+
AnswerChoice.UNANSWERED,
32+
); // Replace `UNANSWERED` with the correct answer (A).
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'What is the command to make a new file?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'mkdir'],
41+
[AnswerChoice.B, 'mv'],
42+
[AnswerChoice.C, 'touch'],
43+
[AnswerChoice.D, 'grep'],
44+
]),
45+
AnswerChoice.UNANSWERED,
46+
); // Replace `UNANSWERED` with the correct answer (C).
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'What is the special operator to (pipe) feed output of one command to another?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, '&&'],
55+
[AnswerChoice.B, '||'],
56+
[AnswerChoice.C, ';'],
57+
[AnswerChoice.D, '|'],
58+
]),
59+
AnswerChoice.UNANSWERED,
60+
); // Replace `UNANSWERED` with the correct answer (D) - pipe operator chains commands
61+
}
62+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ 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 { KerryFergusonQuiz } from './kerry_ferguson_quiz.js';
56
import { BenjaminScottQuiz } from './benjamin_scott_quiz.js';
67
import { TrinitieJacksonQuiz } from './trinitie_jackson_quiz.js';
78
import { TyranRicesQuiz } from './tyran_rices_quiz.js';
89
import { BrooklynHardenQuiz } from './brooklyn_harden_quiz.js';
10+
911
export const Quizzes = Symbol.for('Quizzes');
1012

1113
// Add your quiz provider here.
@@ -20,6 +22,7 @@ const QUIZ_PROVIDERS = [
2022
TyranRicesQuiz,
2123
AnotherQuiz,
2224
BenjaminScottQuiz,
25+
KerryFergusonQuiz,
2326
DanielsonAdjocyQuiz
2427
];
2528

0 commit comments

Comments
 (0)