From 84438b9d4191a960f5d8598cb1b7037a881a6684 Mon Sep 17 00:00:00 2001 From: "Anthony D. Mays" Date: Tue, 1 Oct 2024 15:50:40 +0000 Subject: [PATCH] feat: added another test! --- lesson_03/quiz/quiz.yaml | 3 ++ .../quiz/src/quizzes/anthony_mays_quiz_2.ts | 41 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 4 +- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 lesson_03/quiz/src/quizzes/anthony_mays_quiz_2.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index a3bcaece..95084f6e 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -3,6 +3,9 @@ quiz: anthonymays: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe + anthonymays2: + - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK + - $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa diff --git a/lesson_03/quiz/src/quizzes/anthony_mays_quiz_2.ts b/lesson_03/quiz/src/quizzes/anthony_mays_quiz_2.ts new file mode 100644 index 00000000..6257a7f7 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/anthony_mays_quiz_2.ts @@ -0,0 +1,41 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class AnthonyMaysQuiz2 implements QuizQuestionProvider { + getProviderName(): string { + return 'anthonymays2'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [AnthonyMaysQuiz2.makeQuestion0(), AnthonyMaysQuiz2.makeQuestion1()]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What is a multiple choice question?', + new Map([ + [AnswerChoice.A, 'A question about agency'], + [AnswerChoice.B, 'The hardest kind of quiz question there is'], + [ + AnswerChoice.C, + 'A question that can be answered using one or more provided choices', + ], + [AnswerChoice.D, 'Whatever you want it to be!'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new QuizQuestion( + 1, + 'What is a computer?', + 'A machine that automatically transforms input into output.', + ); // Provide an answer. + } +} diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 11fcf625..c03eaa30 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -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 { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js'; +import { AnthonyMaysQuiz2 } from './anthony_mays_quiz_2.js'; import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js'; +import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js'; import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js'; import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js'; @@ -19,6 +20,7 @@ const QUIZ_PROVIDERS = [ OyeyemiJimohQuiz, ChigazoGrahamsQuiz, AmiyahJonesQuiz + AnthonyMaysQuiz2, ]; @Module({