Skip to content

Commit c340196

Browse files
Daniel BoyceDaniel Boyce
authored andcommitted
feat:added my own quiz
1 parent 70acc3d commit c340196

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ quiz:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
99

10+
danielboyce:
11+
- $2y$10$3sE7jqrvoniwvAR7Hb94aOkqvWtRMX/rLARy4q8B2xJ4JVifK3BLC
12+
- $2y$10$ONEdMxmf7aUg.1p/PGhAfOIaRyNoFepaoRqpCnR//JLdJETXNKuzK
13+
- $2y$10$.mzip.DvXRpm0CU3T6nQOuiq82J1HnWnBc.uMLfAEPZp76Y6mB5Ei
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class DanielBoyceQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'danielboyce';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [DanielBoyceQuiz.makeQuestion0(), DanielBoyceQuiz.makeQuestion1(), DanielBoyceQuiz.makeQuestion2()];
15+
}
16+
17+
public static makeQuestion0(): QuizQuestion {
18+
return new MultipleChoiceQuizQuestion(
19+
0,
20+
'Where is the CPU located in a computer?',
21+
new Map<AnswerChoice, string>([
22+
[AnswerChoice.A, 'On the screen'],
23+
[AnswerChoice.B, 'In the power supply unit'],
24+
[AnswerChoice.C, 'On the motherboard'],
25+
[AnswerChoice.D, 'The CPU is not a physical component'],
26+
]),
27+
AnswerChoice.UNANSWERED,
28+
); // Replace `UNANSWERED` with the correct answer.
29+
}
30+
31+
public static makeQuestion1(): QuizQuestion {
32+
return new MultipleChoiceQuizQuestion(
33+
1,
34+
'What is the puropse of the cpu',
35+
new Map<AnswerChoice, string>([
36+
[AnswerChoice.A, 'preform calculations'],
37+
[AnswerChoice.B, 'To store data'],
38+
[AnswerChoice.C, 'provide power to the computer'],
39+
[AnswerChoice.D, 'To display information on the screen'],
40+
]),
41+
AnswerChoice.UNANSWERED,
42+
); // Replace `UNANSWERED` with the correct answer.
43+
}
44+
45+
public static makeQuestion2(): QuizQuestion {
46+
return new MultipleChoiceQuizQuestion(
47+
2,
48+
'What is the main function of RAM in a computer?',
49+
new Map<AnswerChoice, string>([
50+
[AnswerChoice.A, 'To store data permanently'],
51+
[AnswerChoice.B, 'To provide temporary storage for data in use'],
52+
[AnswerChoice.C, 'To manage power supply'],
53+
[AnswerChoice.D, 'To connect to the internet'],
54+
]),
55+
AnswerChoice.UNANSWERED,
56+
); // Replace `UNANSWERED` with the correct answer.
57+
}
58+
}

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 { DanielBoyceQuiz } from './daniel_boyce_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+
DanielBoyceQuiz
1113

1214
];
1315

0 commit comments

Comments
 (0)