diff --git a/lesson_03/quiz/src/quizzes/amiyah_jones_quiz.ts b/lesson_03/quiz/src/quizzes/amiyah_jones_quiz.ts new file mode 100644 index 000000000..f86dc07bd --- /dev/null +++ b/lesson_03/quiz/src/quizzes/amiyah_jones_quiz.ts @@ -0,0 +1,57 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class AmiyahJonesQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'amiyahjones'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + AmiyahJonesQuiz.makeQuestion0(), + AmiyahJonesQuiz.makeQuestion1(), + AmiyahJonesQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What two computer parts get mixed up often?', + new Map([ + [AnswerChoice.A, 'Power supply and mother board'], + [AnswerChoice.B, 'Graphics card and ram'], + [AnswerChoice.C, 'Ram and hard drive'], + [AnswerChoice.D, 'None of them get mixed up'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'Which computer part figures out how everything is supposed to look on your screen?', + new Map([ + [AnswerChoice.A, 'Graphics card'], + [AnswerChoice.B, 'CPU'], + [AnswerChoice.C, 'Mother board'], + [AnswerChoice.D, 'Ram'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'What is a computer?', + 'A machine that automatically transforms input into output.', + ); // Provide an answer. + } +} + diff --git a/lesson_03/quiz/src/quizzes/npm b/lesson_03/quiz/src/quizzes/npm new file mode 100644 index 000000000..e69de29bb diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index ac82f4600..f71f5eaa9 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -5,7 +5,7 @@ import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); // Add your quiz provider here. -const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz]; +const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, AmiyahJonesQuiz]; @Module({ providers: [