Skip to content

Commit 616f844

Browse files
committed
Lesson_03: Created Quiz with Answers - Zion Buchanan
1 parent aa65ed1 commit 616f844

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ quiz:
1818
- $2y$10$XcsVuO66KZiUiN75NtssdOkKvHKhuBo91JgE/TJEnSrrzbhjxuql.
1919
- $2y$10$9fZs867NHxoPQ/VWMeLyj.us5Kg3SLPcbt9O5ki/FdJ37TbhgFMFC
2020
- $2y$10$GfjcKvtzr6n8553Mdr1RJOOYDfzOudlW.3i8otsH0HiW52CU7tUAW
21+
ZionBuchanan:
22+
- $2y$10$ufNCdP1efvioBYIih6K92uye33p5ckN/IrxfCvw4n7agHjN8aNfhe
23+
- $2y$10$Mb7LA1kqlDRWlN9jdBYvF.u1B8cmJqXWkrxQeMr/3ETRVOAzFlflG
24+
- $2y$10$9bTVOlLmkj4y5f9u1b3sgeTQ9hIrVFrGiz71B0HTxiIidqq0VXHGS

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
3-
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
43
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
54
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
5+
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
66
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
7+
import { ZionBuchananQuiz } from './zion_buchanan_quiz.js';
78

89
export const Quizzes = Symbol.for('Quizzes');
910

@@ -15,6 +16,7 @@ const QUIZ_PROVIDERS = [
1516
AnotherQuiz,
1617
JosephCaballeroQuiz,
1718
OyeyemiJimohQuiz,
19+
ZionBuchananQuiz,
1820
];
1921

2022
@Module({
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class ZionBuchananQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'ZionBuchanan';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
ZionBuchananQuiz.makeQuestion0(),
16+
ZionBuchananQuiz.makeQuestion1(),
17+
ZionBuchananQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What is a computer?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'A machine that transforms input data to output'],
27+
[AnswerChoice.B, 'A device that only stores information'],
28+
[AnswerChoice.C, 'A system that requires no user input to function'],
29+
[
30+
AnswerChoice.D,
31+
'A machine that operates only when connected to the internet.',
32+
],
33+
]),
34+
AnswerChoice.UNANSWERED,
35+
); // Replace `UNANSWERED` with the correct answer.
36+
}
37+
38+
private static makeQuestion1(): QuizQuestion {
39+
return new MultipleChoiceQuizQuestion(
40+
1,
41+
'Why do we use IDEs?',
42+
new Map<AnswerChoice, string>([
43+
[AnswerChoice.A, 'to issue tracking and debugging'],
44+
[AnswerChoice.B, 'Managing source control'],
45+
[AnswerChoice.C, 'Refactoring code'],
46+
[AnswerChoice.D, 'All of the above'],
47+
]),
48+
AnswerChoice.UNANSWERED,
49+
); // Replace `UNANSWERED` with the correct answer.
50+
}
51+
52+
private static makeQuestion2(): QuizQuestion {
53+
return new MultipleChoiceQuizQuestion(
54+
2,
55+
'What is a branch?',
56+
new Map<AnswerChoice, string>([
57+
[
58+
AnswerChoice.A,
59+
'A kind of software program that runs on every computer automatically.',
60+
],
61+
[AnswerChoice.B, 'Both Choices A and D'],
62+
[
63+
AnswerChoice.C,
64+
'A specialized type of car engine designed for off-road vehicles.',
65+
],
66+
[
67+
AnswerChoice.D,
68+
'A copy of the repository that allows you to make changes and merge them back later.',
69+
],
70+
]),
71+
AnswerChoice.UNANSWERED,
72+
); // Replace `UNANSWERED` with the correct answer.
73+
}
74+
}

0 commit comments

Comments
 (0)