Skip to content

Commit 451ca3c

Browse files
committed
feat: added test and passing
1 parent 06ce81e commit 451ca3c

File tree

3 files changed

+73
-6
lines changed

3 files changed

+73
-6
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+
danielsonadjocy:
10+
- $2y$13$a2VPLkXi0XoTkCgytHabiuFX36ezOtQvSgG8Fjonlp.FYsgDnMQ1S
11+
- $2y$10$z37Nf6Ay1CZrbb3OtmhaXuFGnOqiUgAEc6CThl3iUAVFE3kEYS/cq
12+
- $2y$10$z37Nf6Ay1CZrbb3OtmhaXuFGnOqiUgAEc6CThl3iUAVFE3kEYS/cq
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+
export class DanielsonAdjocyQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'danielsonadjocy';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
DanielsonAdjocyQuiz.makeQuestion0(),
16+
DanielsonAdjocyQuiz.makeQuestion1(),
17+
DanielsonAdjocyQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What should go first in a pc frame?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'CPU'],
27+
[AnswerChoice.B, 'GPU'],
28+
[
29+
AnswerChoice.C,
30+
'Motherboard',
31+
],
32+
[AnswerChoice.D, 'Power supply'],
33+
]),
34+
AnswerChoice.UNANSWERED,
35+
); // Replace `UNANSWERED` with the correct answer.
36+
}
37+
38+
private static makeQuestion1(): QuizQuestion {
39+
return new MultipleChoiceQuizQuestion(
40+
1,
41+
'True or False: Data in a computer is represented by Binary, Decimal, and Hexadecimal',
42+
new Map<AnswerChoice, string>([
43+
[AnswerChoice.A, 'True'],
44+
[AnswerChoice.B, 'False'],
45+
]),
46+
AnswerChoice.UNANSWERED,
47+
); // Replace `UNANSWERED` with the correct answer.
48+
}
49+
50+
private static makeQuestion2(): QuizQuestion {
51+
return new MultipleChoiceQuizQuestion(
52+
2,
53+
'What is the brain of the computer?',
54+
new Map<AnswerChoice, string>([
55+
[AnswerChoice.A, 'CPU'],
56+
[AnswerChoice.B, 'GPU'],
57+
[AnswerChoice.C, 'Motherboard'],
58+
[AnswerChoice.D, 'Power supply'],
59+
]),
60+
AnswerChoice.UNANSWERED,
61+
); // Replace `UNANSWERED` with the correct answer.
62+
}
63+
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { Module } from '@nestjs/common';
2-
import { AnotherQuiz } from './another_quiz.js';
3-
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
2+
//import { AnotherQuiz } from './another_quiz.js';
3+
//import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { DanielsonAdjocyQuiz } from './danielson_adjocys_quiz.js';
45
export const Quizzes = Symbol.for('Quizzes');
56

67
// Add your quiz provider here.
78

89
const QUIZ_PROVIDERS = [
9-
AnthonyMaysQuiz,
10-
AnotherQuiz,
11-
10+
//AnthonyMaysQuiz,
11+
//AnotherQuiz,
12+
DanielsonAdjocyQuiz,
1213
];
1314

1415
@Module({

0 commit comments

Comments
 (0)