From 79dc00256ef4bdb660a90e77763f24cf24b533a6 Mon Sep 17 00:00:00 2001 From: dxsmith244 Date: Tue, 1 Oct 2024 14:08:31 +0000 Subject: [PATCH 1/3] quiz creation complete --- lesson_03/quiz/quiz.yaml | 6 +- .../quiz/src/quizzes/david_smith_quiz.ts | 57 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 6 +- 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 lesson_03/quiz/src/quizzes/david_smith_quiz.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index b5827ea59..86f83270a 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -4,8 +4,12 @@ quiz: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe anotherone: - - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK + - $2y$10$g1XJB.GyuK8RVdnc4JeU7ezsXL8DYgjS.KhqRLRh/PQnxdLUDL5tG - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa + davidsmith: + - $2y$10$EM5346ILJER4xu66qf1OcuJ/7f6hCOb9z1OUHgSXvl3QuCohBySTm + - $2y$10$gWIUYJPn94weKopOVQKTl.XOwODK1tamszmt4uXCJupZofi7vXPdq + - $2y$10$eh1.Cd6tXSmolUnY02xwM.BVR7RkYqJIDHepPfk8wJBIwol4jRw0S oyeyemijimoh: - $2y$10$2LlSxAEM1HmR3Wl2fO6LQueu/77spr5SuWAh4b3MKesIWNy3CFjGe - $2y$10$csA90DFxK7.uq6dSfS06Yukk5fQPrzLvU2Lp43ArTs2za28LVvRGO diff --git a/lesson_03/quiz/src/quizzes/david_smith_quiz.ts b/lesson_03/quiz/src/quizzes/david_smith_quiz.ts new file mode 100644 index 000000000..f732719b1 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/david_smith_quiz.ts @@ -0,0 +1,57 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class DavidSmithQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'davidsmith'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + DavidSmithQuiz.makeQuestion0(), + DavidSmithQuiz.makeQuestion1(), + DavidSmithQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'Where have I worked before?', + new Map([ + [AnswerChoice.A, 'JPMorganChase&Co.'], + [AnswerChoice.B, 'Capital One'], + [AnswerChoice.C, 'Nvidia'], + [AnswerChoice.D, 'Meta'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'Have I worked at Code Differently before?', + new Map([ + [AnswerChoice.A, 'Yes'], + [AnswerChoice.B, 'No'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'Was Jordan my teacher when I started coding', + new Map([ + [AnswerChoice.A, 'Yes'], + [AnswerChoice.B, 'No'], + ]), + 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 0d6a58322..8c860323a 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; -import { AnotherQuiz } from './another_quiz.js'; -import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js'; +import { DavidSmithQuiz } from './another_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'; export const Quizzes = Symbol.for('Quizzes'); @@ -12,7 +12,7 @@ export const Quizzes = Symbol.for('Quizzes'); const QUIZ_PROVIDERS = [ AnthonyMaysQuiz, YafiahAbdullahQuiz, - AnotherQuiz, + DavidSmithQuiz, JosephCaballeroQuiz, OyeyemiJimohQuiz, ]; From a64dbd1f7a4615427d2675270da803a69f8d7b73 Mon Sep 17 00:00:00 2001 From: dxsmith244 Date: Wed, 2 Oct 2024 13:28:32 +0000 Subject: [PATCH 2/3] check failed --- lesson_03/quiz/src/quizzes/quizzes.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 8c860323a..6c60046d2 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; -import { DavidSmithQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; +import { DavidSmithQuiz } from './david_smith_quiz.js'; import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js'; import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js'; import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js'; From 19811f95fdef35d36257dac7824cb6c15451220d Mon Sep 17 00:00:00 2001 From: dxsmith244 Date: Thu, 3 Oct 2024 12:51:14 +0000 Subject: [PATCH 3/3] Fixing Duplicate Code --- lesson_03/quiz/src/quizzes/quizzes.module.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index dd4ff0885..5b7a65f30 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,16 +1,12 @@ import { Module } from '@nestjs/common'; import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js'; -import { AnotherQuiz } from './another_quiz.js'; import { AngelicaCQuiz } from './angelica_c_quiz.js'; +import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; import { ChelseaOgbonniaQuiz } from './chelsea_ogbonnia_quiz.js'; import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js'; import { DasiaEnglishQuiz } from './dasia_english_quiz.js'; import { DavidSmithQuiz } from './david_smith_quiz.js'; -import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js'; -import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js'; -import { XavierCruzQuiz } from './xavier_cruz_quiz.js'; -import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js'; import { JamesCapparellQuiz } from './james_capparell_quiz.js'; import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js'; import { KimberleeHaldaneQuiz } from './kimberlee_haldane_quiz.js';