Skip to content

Commit de86969

Browse files
authored
feat: adds John's quiz implementation (code-differently#97)
1 parent ab7ccb9 commit de86969

File tree

3 files changed

+86
-2
lines changed

3 files changed

+86
-2
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ quiz:
55
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
8-
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
8+
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
computerparts:
10+
- $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342
11+
- $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0.
12+
- $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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { Jbeyquiz } from './jbeyquiz.js';
45

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

78
// Add your quiz provider here.
8-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz];
9+
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, Jbeyquiz];
910

1011
@Module({
1112
providers: [

0 commit comments

Comments
 (0)