diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index 5a611f3f3..0a4481798 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -6,6 +6,11 @@ quiz: anotherone: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa + xaviercruz: + - $2y$10$1WMmkMjazP78KVns1l85zOC5r8cwgTnxLLs/scOzIkgCQ8HP28Y.q + - $2y$10$9D.oRC8h/PD/10NMSR6MMOzjVAJKm.vfw4te8Rxgw1M1.0Q9x8pjK + - $2y$10$ypLhtfxJikRhLaQdW0Y8GOEqO/X1uoBD8w.kSSSUPggBa9wHLkw0i + - $2y$10$cYuji5D0xOEFAV2fyMaJAuaODeWEwIYu.X3089qnojdx3nQljil5G dasiaenglish: - $2y$10$ANtdDzA0GAqn/QeExPO/Du8LgHUwznRLxpv0W0ib2seYk23BZowOC - $2y$10$6vAkOUmpPrUtWrh010f8e.A4M9kEzuzCrQ8ghWI9hQSEsZeGHpQ9W diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 99d24a254..2ecba2f90 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -2,6 +2,7 @@ import { Module } from '@nestjs/common'; import { AngelicaCQuiz } from './angelica_c_quiz.js'; import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; +import { XavierCruzQuiz } from './xavier_cruz_quiz.js'; import { DasiaEnglishQuiz } from './dasia_english_quiz.js'; import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js'; import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js'; @@ -12,7 +13,6 @@ import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); // Add your quiz provider here. - const QUIZ_PROVIDERS = [ AnthonyMaysQuiz, YafiahAbdullahQuiz, @@ -22,7 +22,8 @@ const QUIZ_PROVIDERS = [ OyeyemiJimohQuiz, DasiaEnglishQuiz, ChigazoGrahamsQuiz, - AmiyahJonesQuiz + AmiyahJonesQuiz, + XavierCruzQuiz ]; @Module({ diff --git a/lesson_03/quiz/src/quizzes/xavier_cruz_quiz.ts b/lesson_03/quiz/src/quizzes/xavier_cruz_quiz.ts new file mode 100644 index 000000000..654d93441 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/xavier_cruz_quiz.ts @@ -0,0 +1,76 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class XavierCruzQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'xaviercruz'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + XavierCruzQuiz.makeQuestion0(), + XavierCruzQuiz.makeQuestion1(), + XavierCruzQuiz.makeQuestion2(), + XavierCruzQuiz.makeQuestion3(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What programming language supports the "struct" data type?', + new Map([ + [AnswerChoice.A, 'C'], + [AnswerChoice.B, 'PHP'], + [AnswerChoice.C, 'JSP'], + [AnswerChoice.D, 'HTML'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'What is another name for an app?', + new Map([ + [AnswerChoice.A, 'Program'], + [AnswerChoice.B, 'Field'], + [AnswerChoice.C, 'Record'], + [AnswerChoice.D, 'Library'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'A virtual machine is an example of what?', + new Map([ + [AnswerChoice.A, 'Presentation'], + [AnswerChoice.B, 'Fabrication'], + [AnswerChoice.C, 'Deprecation'], + [AnswerChoice.D, 'Emulation'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. + } + private static makeQuestion3(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 3, + 'What data type closely resembles a queue?', + new Map([ + [AnswerChoice.A, 'String'], + [AnswerChoice.B, 'Character'], + [AnswerChoice.C, 'Integer'], + [AnswerChoice.D, 'Array'], + ]), + AnswerChoice.UNANSWERED, + ); // Provide an answer. + } +}