Skip to content

Commit f93a09e

Browse files
jbey251Dlafferty251
authored andcommitted
feat: adds John's quiz implementation (code-differently#97)
1 parent 3707aec commit f93a09e

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
910
dylanlafferty:
1011
- $2y$10$JpiqIw6Ip/DUgaOkggURk.wP1OtxxAlmYJvVPJQ/6GfG3SslHNrBu
1112
- $2y$10$mPlPI9IsKf8cCKyQj3gtTOY8ffwgwTddHHjVAVd1PcAzfatOHED06
1213
- $2y$10$Sr6Fu4QqmqX/oKYnypzQ9e4SxOiTuFAgnLVNd6rKz9AxZlcAjWwaK
14+
15+
computerparts:
16+
- $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342
17+
- $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0.
18+
- $2y$10$JXoeInFy4UzHhi2Lskxzeu7CQ9RprnJgBw9pjAlV.t6zQyJTyy8OK
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
} from 'codedifferently-instructional';
5+
export class Jbeyquiz {
6+
getProviderName() {
7+
return 'computerparts';
8+
}
9+
makeQuizQuestions() {
10+
return [
11+
Jbeyquiz.makeQuestion0(),
12+
Jbeyquiz.makeQuestion1(),
13+
Jbeyquiz.makeQuestion2(),
14+
];
15+
}
16+
static makeQuestion0() {
17+
return new MultipleChoiceQuizQuestion(
18+
0,
19+
'What is RAM?',
20+
new Map([
21+
[AnswerChoice.A, 'Robotic Automated Mechanism'],
22+
[
23+
AnswerChoice.B,
24+
'A type of storage device that holds all of your files',
25+
],
26+
[
27+
AnswerChoice.C,
28+
'Special software that controls your computers internet connection',
29+
],
30+
[AnswerChoice.D, 'Random Access Memory'],
31+
]),
32+
AnswerChoice.UNANSWERED,
33+
); // Replace `UNANSWERED` with the correct answer.
34+
}
35+
static makeQuestion1() {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'What is a GPU?',
39+
new Map([
40+
[
41+
AnswerChoice.A,
42+
'A powerful cooling fan that keeps your computer from overheating',
43+
],
44+
[AnswerChoice.B, 'A special type of harddrive'],
45+
[
46+
AnswerChoice.C,
47+
'A special type of processor primarily designed to handleand accelerate the rendering of images, video, and animations.',
48+
],
49+
[
50+
AnswerChoice.D,
51+
'A keyboard that controls the movement of your mouse on screen',
52+
],
53+
]),
54+
AnswerChoice.UNANSWERED,
55+
); // Replace `UNANSWERED` with the correct answer.
56+
}
57+
static makeQuestion2() {
58+
return new MultipleChoiceQuizQuestion(
59+
2,
60+
'What is an SSD?',
61+
new Map([
62+
[AnswerChoice.A, 'A type of RAM that stores data permanently'],
63+
[
64+
AnswerChoice.B,
65+
'A storage device used in computers and other electronic devices',
66+
],
67+
[
68+
AnswerChoice.C,
69+
'A type of USB cable that connects your computer to the internet',
70+
],
71+
[
72+
AnswerChoice.D,
73+
'A type of screen that displays the contents of your computers memory',
74+
],
75+
]),
76+
AnswerChoice.UNANSWERED,
77+
); // Replace `UNANSWERED` with the correct answer.
78+
}
79+
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@ import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
44
import { DylanLaffertyQuiz } from './Dylan_Lafferty_quiz.js';
5+
import { Jbeyquiz } from './jbeyquiz.js';
56

67
export const Quizzes = Symbol.for('Quizzes');
78

89
// Add your quiz provider here.
9-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, DylanLaffertyQuiz];
10+
11+
const QUIZ_PROVIDERS = [
12+
AnthonyMaysQuiz,
13+
AnotherQuiz,
14+
DylanLaffertyQuiz,
15+
Jbeyquiz,
16+
];
1017

1118
@Module({
1219
providers: [

0 commit comments

Comments
 (0)