Skip to content

Commit 7f067c8

Browse files
feat: adds Evan's custom quiz (#124)
* feat: added Encoded Answers * fix: encryption * test: Encryption * fix: Encoding * fix: wrong # of quzzes * fix: encryption * fix: Encoding * test: Multiple Coice Questions Configured incorrectly * fix: duplicate quiz provider * fix: changed answer choice to UNANSWERED --------- Co-authored-by: Anthony D. Mays <[email protected]>
1 parent 5d1a93c commit 7f067c8

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ quiz:
3434
- $2y$10$FquR69q7W4E68TX/SNCB7u8Ri0DOFRDqsUPdGfuyIBjZJRVFkNI.6
3535
- $2y$10$FSWRA7hulVpyVxd8s67Nxuq/1cdmviW24qqoUbqihBf79cR.w9yly
3636
- $2y$10$Qy1IsNsfuJvA384ypL/72uWubUuNbMRp4LD6j/LM0RIH66D/HIjF6
37+
evanphilakhong:
38+
- $2y$10$3ERfjtWq6bYipHm0QGOuDe8oeXth3dnmfxT8g5P65sc8m4EivQNY.
39+
- $2y$10$cr3WSpMx9zljgMYCqz4uYOAMT2iOzDaRsnoQi6CfPu/761F.1EpwW
40+
- $2y$10$us8POdRzHVBFr1wNcuC7iuDg/YsQvr0GXe5JpFg8EIWzc6IMnIEUG
3741
jeremiahwing:
3842
- $2y$10$YLN9gvb8/fBf3ByHNIdb9.UZ8ilcuCdPgZN9QIYd2rwD23vzt2lvy
3943
- $2y$10$AEUmg5pH8c2VLZ871//G4eKjwx5cnKH5c2HGTNXdnAPF.3/ZmNap2
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What is a CPU?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'Computer Power Unit'],
27+
[AnswerChoice.B, 'Complex Processing Unit'],
28+
[AnswerChoice.C, 'Central Processing Unit'],
29+
[AnswerChoice.D, 'Coding Processor Unit'],
30+
]),
31+
AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer
32+
);
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'What is a GPU?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'Graphics Processing Unit'],
41+
[AnswerChoice.B, 'Gaming Power Unit'],
42+
[AnswerChoice.C, 'Graphical Programming Unit'],
43+
[AnswerChoice.D, 'Gaming Processor Unit'],
44+
]),
45+
AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer
46+
);
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'What is a PSU?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, 'Programming Super Unit'],
55+
[AnswerChoice.B, 'Power Supply Unit'],
56+
[AnswerChoice.C, 'Power Supplier Unit'],
57+
[AnswerChoice.D, 'Power Storing Unit'],
58+
]),
59+
AnswerChoice.UNANSWERED, // repleace UNANSWERED with correct answer
60+
);
61+
}
62+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
44
import { JasonWatsonQuiz } from './jason_watson_quiz.js';
55
import { MeikoStephensQuiz } from './meiko_stephens_quiz.js';
66
import { DavidAdenaikeQuiz } from './david_adenaike_quiz.js';
7+
import { EvanPhilakhongQuiz } from './evan_philakhong_quiz.js';
78
import { EzraQuiz } from './ezra_quiz.js';
89
import { Jbeyquiz } from './jbeyquiz.js';
910
import { KhaylaSaundersQuiz } from './khayla_quiz.js';
@@ -23,6 +24,7 @@ const QUIZ_PROVIDERS = [
2324
Jbeyquiz,
2425
EzraQuiz,
2526
DavidAdenaikeQuiz,
27+
EvanPhilakhongQuiz,
2628
KhaylaSaundersQuiz,
2729
RasheedMillerQuiz,
2830
JeremiahWingQuiz,

0 commit comments

Comments
 (0)