From 4c68d65bea9c4db08570adc9c57f4f8c447ed594 Mon Sep 17 00:00:00 2001 From: mercedes-mathews Date: Mon, 10 Mar 2025 22:18:47 +0000 Subject: [PATCH 1/2] feat: finished making quiz and passes tests --- lesson_03/quiz/quiz.yaml | 7 +++ .../quiz/src/quizzes/mercedes_mathews_quiz.ts | 62 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 8 ++- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 lesson_03/quiz/src/quizzes/mercedes_mathews_quiz.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index 203b424ce..078e3d9b4 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -6,7 +6,14 @@ quiz: anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa +<<<<<<< HEAD computerparts: - $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342 - $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0. - $2y$10$JXoeInFy4UzHhi2Lskxzeu7CQ9RprnJgBw9pjAlV.t6zQyJTyy8OK +======= + mercedesmathews: + - $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa + - $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y + - $2y$10$yI/2BgOyqQfLdHM3ixPE5uLu89su/sHRJB2c5szDFIAYXDhRakS.C +>>>>>>> 8292062 (feat: finished making quiz and passes tests) diff --git a/lesson_03/quiz/src/quizzes/mercedes_mathews_quiz.ts b/lesson_03/quiz/src/quizzes/mercedes_mathews_quiz.ts new file mode 100644 index 000000000..084bbbb8e --- /dev/null +++ b/lesson_03/quiz/src/quizzes/mercedes_mathews_quiz.ts @@ -0,0 +1,62 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class MercedesMathewsQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'mercedesmathews'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + MercedesMathewsQuiz.makeQuestion0(), + MercedesMathewsQuiz.makeQuestion1(), + MercedesMathewsQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'Which HTML tag is used for a secondary header?', + new Map([ + [AnswerChoice.A, '

'], + [AnswerChoice.B, '

'], + [AnswerChoice.C, '

'], + [AnswerChoice.D, '

'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'Which HTML tag makes text bold?', + new Map([ + [AnswerChoice.A, ''], + [AnswerChoice.B, ''], + [AnswerChoice.C, 'Both of the above'], + [AnswerChoice.D, 'Neither of the above'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'Which HTML tag is not a void element and needs a closing tag?', + new Map([ + [AnswerChoice.A, ''], + [AnswerChoice.B, '
'], + [AnswerChoice.C, ''], + [AnswerChoice.D, ''], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } +} diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 61b17227e..090417429 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -2,11 +2,17 @@ import { Module } from '@nestjs/common'; import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; import { Jbeyquiz } from './jbeyquiz.js'; +import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); // Add your quiz provider here. -const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, Jbeyquiz]; +const QUIZ_PROVIDERS = [ + AnthonyMaysQuiz, + AnotherQuiz, + MercedesMathewsQuiz, + Jbeyquiz, +]; @Module({ providers: [ From a5bc417a3d9c1fdcff394c92be1aee5dd632659c Mon Sep 17 00:00:00 2001 From: mercedes-mathews Date: Tue, 11 Mar 2025 01:14:22 +0000 Subject: [PATCH 2/2] Merged files --- lesson_03/quiz/quiz.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index 078e3d9b4..266f1a7e7 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -6,14 +6,11 @@ quiz: anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa -<<<<<<< HEAD computerparts: - $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342 - $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0. - $2y$10$JXoeInFy4UzHhi2Lskxzeu7CQ9RprnJgBw9pjAlV.t6zQyJTyy8OK -======= mercedesmathews: - $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa - $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y - $2y$10$yI/2BgOyqQfLdHM3ixPE5uLu89su/sHRJB2c5szDFIAYXDhRakS.C ->>>>>>> 8292062 (feat: finished making quiz and passes tests)