Skip to content

Commit b4d7ae7

Browse files
committed
feat: added another test!
1 parent aa65ed1 commit b4d7ae7

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ quiz:
33
anthonymays:
44
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
55
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
6+
anthonymays2:
7+
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
8+
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
69
anotherone:
710
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
811
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class AnthonyMaysQuiz2 implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'anthonymays2';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [AnthonyMaysQuiz2.makeQuestion0(), AnthonyMaysQuiz2.makeQuestion1()];
15+
}
16+
17+
private static makeQuestion0(): QuizQuestion {
18+
return new MultipleChoiceQuizQuestion(
19+
0,
20+
'What is a multiple choice question?',
21+
new Map<AnswerChoice, string>([
22+
[AnswerChoice.A, 'A question about agency'],
23+
[AnswerChoice.B, 'The hardest kind of quiz question there is'],
24+
[
25+
AnswerChoice.C,
26+
'A question that can be answered using one or more provided choices',
27+
],
28+
[AnswerChoice.D, 'Whatever you want it to be!'],
29+
]),
30+
AnswerChoice.UNANSWERED,
31+
); // Replace `UNANSWERED` with the correct answer.
32+
}
33+
34+
private static makeQuestion1(): QuizQuestion {
35+
return new QuizQuestion(
36+
1,
37+
'What is a computer?',
38+
'A machine that automatically transforms input into output.',
39+
); // Provide an answer.
40+
}
41+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
3-
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
43
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { AnthonyMaysQuiz2 } from './anthony_mays_quiz_2.js';
55
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
6+
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
67
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
78

89
export const Quizzes = Symbol.for('Quizzes');
@@ -15,6 +16,7 @@ const QUIZ_PROVIDERS = [
1516
AnotherQuiz,
1617
JosephCaballeroQuiz,
1718
OyeyemiJimohQuiz,
19+
AnthonyMaysQuiz2,
1820
];
1921

2022
@Module({

0 commit comments

Comments
 (0)