Skip to content

Lesson_03: Created Quiz with Answers - Zion Buchanan #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ quiz:
- $2y$10$XcsVuO66KZiUiN75NtssdOkKvHKhuBo91JgE/TJEnSrrzbhjxuql.
- $2y$10$9fZs867NHxoPQ/VWMeLyj.us5Kg3SLPcbt9O5ki/FdJ37TbhgFMFC
- $2y$10$GfjcKvtzr6n8553Mdr1RJOOYDfzOudlW.3i8otsH0HiW52CU7tUAW
ZionBuchanan:
- $2y$10$ufNCdP1efvioBYIih6K92uye33p5ckN/IrxfCvw4n7agHjN8aNfhe
- $2y$10$Mb7LA1kqlDRWlN9jdBYvF.u1B8cmJqXWkrxQeMr/3ETRVOAzFlflG
- $2y$10$9bTVOlLmkj4y5f9u1b3sgeTQ9hIrVFrGiz71B0HTxiIidqq0VXHGS
4 changes: 3 additions & 1 deletion lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
import { ZionBuchananQuiz } from './zion_buchanan_quiz.js';

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

Expand All @@ -15,6 +16,7 @@ const QUIZ_PROVIDERS = [
AnotherQuiz,
JosephCaballeroQuiz,
OyeyemiJimohQuiz,
ZionBuchananQuiz,
];

@Module({
Expand Down
74 changes: 74 additions & 0 deletions lesson_03/quiz/src/quizzes/zion_buchanan_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class ZionBuchananQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'ZionBuchanan';
}

makeQuizQuestions(): QuizQuestion[] {
return [
ZionBuchananQuiz.makeQuestion0(),
ZionBuchananQuiz.makeQuestion1(),
ZionBuchananQuiz.makeQuestion2(),
];
}

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What is a computer?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'A machine that transforms input data to output'],
[AnswerChoice.B, 'A device that only stores information'],
[AnswerChoice.C, 'A system that requires no user input to function'],
[
AnswerChoice.D,
'A machine that operates only when connected to the internet.',
],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'Why do we use IDEs?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'to issue tracking and debugging'],
[AnswerChoice.B, 'Managing source control'],
[AnswerChoice.C, 'Refactoring code'],
[AnswerChoice.D, 'All of the above'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'What is a branch?',
new Map<AnswerChoice, string>([
[
AnswerChoice.A,
'A kind of software program that runs on every computer automatically.',
],
[AnswerChoice.B, 'Both Choices A and D'],
[
AnswerChoice.C,
'A specialized type of car engine designed for off-road vehicles.',
],
[
AnswerChoice.D,
'A copy of the repository that allows you to make changes and merge them back later.',
],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
}