diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index c016c60e5..aea918df3 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -6,3 +6,7 @@ quiz: anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa + chigazograham: + - $2y$10$OTnSih9kHykUnsuM/YKufu3MXTpOZrif.dL13XwXt8rquJL4mV.m. + - $2y$10$je60MntrKRBd/1tz7hNUY.D/cyKOEM.hp6/1fVVVGJRIIitmUGI5e + - $2y$10$pPTmEp0acs8.NIAamLpmmuF7B72bXFZsikHywQI/JvfXuySkhHH5S \ No newline at end of file diff --git a/lesson_03/quiz/src/quizzes/chigazo_graham_quiz.ts b/lesson_03/quiz/src/quizzes/chigazo_graham_quiz.ts new file mode 100644 index 000000000..a4f5171b2 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/chigazo_graham_quiz.ts @@ -0,0 +1,60 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class ChigazoGrahamsQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'chigazograham'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ChigazoGrahamsQuiz.makeQuestion1(), ChigazoGrahamsQuiz.makeQuestion2, ChigazoGrahamsQuiz.makeQuestion3()]; + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'What is the sign for Modulo?', + new Map([ + [AnswerChoice.A, '^'], + [AnswerChoice.B, '*'], + [AnswerChoice.C,'%',], + [AnswerChoice.D, '//'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. | AnswerChoice.C, '%' + } + + private static makeQuestion2(): QuizQuestion { + return new QuizQuestion( + 2, + 'Who is are big three in hip hop?', + 'A machine that automatically transforms input into output.', + new Map([ + [AnswerChoice.A, 'Kendrick Lamar, J. Cole, and Drake'], + [AnswerChoice.B, 'Tupac, Biggie, and Nas'], + [AnswerChoice.C, 'Kanye West, Eminem, and Lil Wayne',], + [AnswerChoice.D, 'K. Dot'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. | AnswerChoice.D, 'K. Dot' + } + + private static makeQuestion3(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 3, + 'what is the answer to life, the universe, and everything else?', + new Map([ + [AnswerChoice.A, '42'], + [AnswerChoice.B, 'Jesus'], + [AnswerChoice.C,'N/A'], + [AnswerChoice.D, 'Whatever you want it to be!'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. | AnswerChoice.A, '42' + } + +} \ No newline at end of file diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index ac82f4600..2f7af4256 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,11 +1,11 @@ -import { Module } from '@nestjs/common'; +import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js'; import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); // Add your quiz provider here. -const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz]; +const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, ChigazoGrahamsQuiz]; @Module({ providers: [