Skip to content

Commit b339bb8

Browse files
committed
add my quiz
1 parent 70acc3d commit b339bb8

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9-
9+
joybrown:
10+
- $2y$10$yTiBtEBryEjrDBCr2oMgM.ZK5brflCLeA6jrUeYFMp2Chy8wMYTQS
11+
- $2y$10$6v2jhMmq59J50eApiMlPaufiq8piTl8fWxVkZba8OayMSVtcp1XPG
12+
- $2y$10$PAhEzyzGbbr0G9GmPTcKLueZUSjn5bccbPZKYJWinvlW.FHnRtdeq
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
private static makeQuestion0(): QuizQuestion {
23+
return new MultipleChoiceQuizQuestion(
24+
0,
25+
'What is a pull?',
26+
new Map<AnswerChoice, string>([
27+
[AnswerChoice.A, 'A download.'],
28+
[AnswerChoice.B, 'A upload.'],
29+
[
30+
AnswerChoice.C,
31+
'Saving a file.',
32+
],
33+
[AnswerChoice.D, 'A request to merge your changes into another branch.'],
34+
]),
35+
AnswerChoice.UNANSWERED,
36+
); // Replace `UNANSWERED` with the correct answer.
37+
}
38+
39+
private static makeQuestion1(): QuizQuestion {
40+
return new QuizQuestion(
41+
1,
42+
'Git is an online cloud for coding, Yes or No',
43+
'No',
44+
); // Provide an answer.
45+
}
46+
47+
private static makeQuestion2(): QuizQuestion {
48+
return new MultipleChoiceQuizQuestion(
49+
2,
50+
'Which command makes a new directory',
51+
new Map<AnswerChoice, string>([
52+
[AnswerChoice.A, 'mkdir'],
53+
[AnswerChoice.B, 'cp'],
54+
[
55+
AnswerChoice.C,
56+
'rm',
57+
],
58+
[AnswerChoice.D, 'mv'],
59+
]),
60+
AnswerChoice.UNANSWERED,
61+
); // Replace `UNANSWERED` with the correct answer.
62+
}
63+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { JoyBrownQuiz } from './joy_brown_quiz.js';
45
export const Quizzes = Symbol.for('Quizzes');
56

67
// Add your quiz provider here.
78

89
const QUIZ_PROVIDERS = [
910
AnthonyMaysQuiz,
1011
AnotherQuiz,
12+
JoyBrownQuiz
1113

1214
];
1315

0 commit comments

Comments
 (0)