Skip to content

Commit 6f9d06e

Browse files
Boyce007Daniel Boyce
andauthored
feat: adds Daniel's custom quiz (#122)
* feat:added my own quiz * fix:added comma to fix syntax error --------- Co-authored-by: Daniel Boyce <[email protected]>
1 parent 5610b77 commit 6f9d06e

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 1 deletion
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+
danielboyce:
10+
- $2y$10$3sE7jqrvoniwvAR7Hb94aOkqvWtRMX/rLARy4q8B2xJ4JVifK3BLC
11+
- $2y$10$ONEdMxmf7aUg.1p/PGhAfOIaRyNoFepaoRqpCnR//JLdJETXNKuzK
12+
- $2y$10$.mzip.DvXRpm0CU3T6nQOuiq82J1HnWnBc.uMLfAEPZp76Y6mB5Ei
913
marthao:
1014
- $2y$10$y6amHaLPanQnyIaLHfQVo.NLAVnsulCLZYc3OcXj2uJZW4zCwFpc2
1115
- $2y$10$6iYhNOcXHY/Ihf9FdYjulu.rXISSkk3sqWLCDCbybNsWVfoU6sa4q
@@ -59,4 +63,4 @@ quiz:
5963
- $2y$10$avH4Adz6z900VAKHK3p0bunDaJBPPckhVzdJ1XWbp/oK3myHl8LMC
6064
- $2y$10$YTgMZYzNVpbjywYu2DvyZOHjtIIjyFj1gyjI5sGLPxjl91s7FHRGO
6165
- $2y$10$xlWI1a5RHpIzgCE65ys5wue6935c9mqH3AKbRfq6ZC7xz5QSsBmYS
62-
- $2y$10$zr1Do5BFxa6Ts6wCd3i9cOeDiJWHK1tY4QbAspwXdVUcrYllLl1vG
66+
- $2y$10$zr1Do5BFxa6Ts6wCd3i9cOeDiJWHK1tY4QbAspwXdVUcrYllLl1vG
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
@@ -2,6 +2,7 @@ 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 { DanielBoyceQuiz } from './daniel_boyce_quiz.js';
56
import { NicoleJacksonQuiz } from './nicole_jackson_quiz.js';
67
import { MattieWeathersbyQuiz } from './mweathersby_quiz.js';
78
import { KerryFergusonQuiz } from './kerry_ferguson_quiz.js';
@@ -27,6 +28,7 @@ const QUIZ_PROVIDERS = [
2728
MattieWeathersbyQuiz,
2829
BenjaminScottQuiz,
2930
DanielsonAdjocyQuiz,
31+
DanielBoyceQuiz,
3032
LindaQuinoaQuiz,
3133
TaliaCrockettQuiz,
3234
DeanWalstonQuiz,

0 commit comments

Comments
 (0)