diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index a3bcaece..01e16096 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -6,6 +6,10 @@ quiz: anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa + dasiaenglish: + - $2y$10$ANtdDzA0GAqn/QeExPO/Du8LgHUwznRLxpv0W0ib2seYk23BZowOC + - $2y$10$6vAkOUmpPrUtWrh010f8e.A4M9kEzuzCrQ8ghWI9hQSEsZeGHpQ9W + - $2y$10$YYTJf2QW.BJST9EUB7NZneVpNkOywIfhsWRpxIsPBg/oTmgqoYWse chigazograham: - $2y$10$OTnSih9kHykUnsuM/YKufu3MXTpOZrif.dL13XwXt8rquJL4mV.m. - $2y$10$je60MntrKRBd/1tz7hNUY.D/cyKOEM.hp6/1fVVVGJRIIitmUGI5e diff --git a/lesson_03/quiz/src/quizzes/dasia_english_quiz.ts b/lesson_03/quiz/src/quizzes/dasia_english_quiz.ts new file mode 100644 index 00000000..384e1823 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/dasia_english_quiz.ts @@ -0,0 +1,67 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class DasiaEnglishQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'dasiaenglish'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + DasiaEnglishQuiz.makeQuestion0(), + DasiaEnglishQuiz.makeQuestion1(), + DasiaEnglishQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'How often should you sync your fork?', + new Map([ + [AnswerChoice.A, 'Never'], + [AnswerChoice.B, 'Once a day'], + [AnswerChoice.C, 'About every hour or as often as possible'], + [AnswerChoice.D, 'Once a week'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'What is a computer?', + new Map([ + [ + AnswerChoice.A, + 'A machine that transforms input to output data using automatically executed pre-programmed instructions', + ], + [AnswerChoice.B, 'A machine'], + [AnswerChoice.C, 'A laptop'], + [ + AnswerChoice.D, + 'A machine that automatically executed pre-programmed instructions', + ], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'What part of the computer does everything have to run through?', + new Map([ + [AnswerChoice.A, 'CPU'], + [AnswerChoice.B, 'GPU'], + [AnswerChoice.C, 'RAM'], + [AnswerChoice.D, 'Motherboard'], + ]), + 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 11fcf625..8c939da5 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 { DasiaEnglishQuiz } from './dasia_english_quiz.js'; import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.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'; @@ -17,6 +18,7 @@ const QUIZ_PROVIDERS = [ AnotherQuiz, JosephCaballeroQuiz, OyeyemiJimohQuiz, + DasiaEnglishQuiz, ChigazoGrahamsQuiz, AmiyahJonesQuiz ];