Skip to content

Commit 1a884f2

Browse files
committed
feat: added Encoded Answers
1 parent 5226501 commit 1a884f2

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ quiz:
1414
- $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa
1515
- $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y
1616
- $2y$10$yI/2BgOyqQfLdHM3ixPE5uLu89su/sHRJB2c5szDFIAYXDhRakS.C
17+
evanphilakhong:
18+
- $2y$10$SormZiYqdPu/xe2ozqDsPOZluWVddVJvApuLAENxUoJtotXvyXeI2
19+
- $2y$10$zQ.K0zxiUgWDW.q0UbmwQ.35agiiSCCHLl.OQ2LCgmW846KWgJ/vW
20+
- $2y$10$5jSnU0l9MlHnvG8EzZtgQeh1YLTdPCgyGNaK/qG/s2woO6W1D2wHi
21+
- $2y$10$V8c7Ux476ueIK4UuQygZZO.8iejKFm/nO2fBtxCvYMcpkI0Di55xu
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class EvanPhilakhongQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'evanphilakhong';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
EvanPhilakhongQuiz.makeQuestion0(),
16+
EvanPhilakhongQuiz.makeQuestion1(),
17+
EvanPhilakhongQuiz.makeQuestion2(),
18+
EvanPhilakhongQuiz.makeQuestion3(),
19+
];
20+
}
21+
22+
private static makeQuestion0(): QuizQuestion {
23+
return new MultipleChoiceQuizQuestion(
24+
0,
25+
'What is a CPU?',
26+
new Map<AnswerChoice, string>([
27+
[AnswerChoice.A, 'Computer Power Unit'],
28+
[AnswerChoice.B, 'Complex Processing Unit'],
29+
[AnswerChoice.C, 'Central Processing Unit'],
30+
[AnswerChoice.D, 'Coding Processor Unit'],
31+
]),
32+
AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer
33+
);
34+
}
35+
36+
private static makeQuestion1(): QuizQuestion {
37+
return new MultipleChoiceQuizQuestion(
38+
1,
39+
'What is a GPU?',
40+
new Map<AnswerChoice, string>([
41+
[AnswerChoice.A, 'Graphics Processing Unit'],
42+
[AnswerChoice.B, 'Gaming Power Unit'],
43+
[AnswerChoice.C, 'Graphical Programming Unit'],
44+
[AnswerChoice.D, 'Gaming Processor Unit'],
45+
]),
46+
AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer
47+
);
48+
}
49+
50+
private static makeQuestion2(): QuizQuestion {
51+
return new MultipleChoiceQuizQuestion(
52+
2,
53+
'What is a PSU?',
54+
new Map<AnswerChoice, string>([
55+
[AnswerChoice.A, 'Programming Super Unit'],
56+
[AnswerChoice.B, 'Power Supply Unit'],
57+
[AnswerChoice.C, 'Power Supplier Unit'],
58+
[AnswerChoice.D, 'Power Storing Unit'],
59+
]),
60+
AnswerChoice.UNANSWERED, // repleace UNANSWERED with correct answer
61+
);
62+
}
63+
64+
private static makeQuestion3(): QuizQuestion {
65+
return new MultipleChoiceQuizQuestion(
66+
3,
67+
'RAM is short for ___?',
68+
new Map<AnswerChoice, string>([
69+
[AnswerChoice.A, 'Randomly Advanced Memory'],
70+
[AnswerChoice.B, 'Random Access Memory'],
71+
[AnswerChoice.C, 'Temporary Memory'],
72+
[AnswerChoice.D, 'Readlily Access Memory'],
73+
]),
74+
AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer
75+
);
76+
}
77+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { EvanPhilakhongQuiz } from './evan_philakhong_quiz.js';
45
import { Jbeyquiz } from './jbeyquiz.js';
56
import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js';
67

@@ -12,6 +13,7 @@ const QUIZ_PROVIDERS = [
1213
AnotherQuiz,
1314
MercedesMathewsQuiz,
1415
Jbeyquiz,
16+
EvanPhilakhongQuiz,
1517
];
1618

1719
@Module({

0 commit comments

Comments
 (0)