From 8c26ffceb80b2c5fc1a1609d17b1d0a52b2831cf Mon Sep 17 00:00:00 2001 From: Aaron2278 <143147068+Aaron2278@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:38:02 -0500 Subject: [PATCH] feat: Adds Aaron's quiz (#150) --- .../lesson3/quizzes/AaronSantiagoQuiz.java | 49 +++++++++++++++++++ .../src/test/resources/application.yml | 3 ++ 2 files changed, 52 insertions(+) create mode 100644 lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/AaronSantiagoQuiz.java diff --git a/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/AaronSantiagoQuiz.java b/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/AaronSantiagoQuiz.java new file mode 100644 index 00000000..b8a7d60b --- /dev/null +++ b/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/AaronSantiagoQuiz.java @@ -0,0 +1,49 @@ +package com.codedifferently.lesson3.quizzes; + +import com.codedifferently.instructional.quiz.AnswerChoice; +import com.codedifferently.instructional.quiz.MultipleChoiceQuizQuestion; +import com.codedifferently.instructional.quiz.QuizQuestion; +import com.codedifferently.instructional.quiz.QuizQuestionProvider; +import java.util.List; +import java.util.Map; +import org.springframework.stereotype.Service; + +@Service +public class AaronSantiagoQuiz implements QuizQuestionProvider { + + public String getProviderName() { + return "aaronsantiago"; + } + + public List makeQuizQuestions() { + return List.of(makeQuestion0(), makeQuestion1()); + } + + private QuizQuestion makeQuestion0() { + return new MultipleChoiceQuizQuestion( + 0, + "What is Object Oriented Programming?", + Map.of( + AnswerChoice.A, + "A programming language model organized around objects rather than actions, and data rather than logic.", + AnswerChoice.B, + "A programming convention that only allows for the use of specific Objects.", + AnswerChoice.C, + "Using Objects to program.", + AnswerChoice.D, + "A paradigm of building computer programs using expressions and functions without mutating state and data."), + AnswerChoice.UNANSWERED); + } + + private QuizQuestion makeQuestion1() { + return new MultipleChoiceQuizQuestion( + 1, + "Which data type is used to represent textual data in Java?", + Map.of( + AnswerChoice.A, "int", + AnswerChoice.B, "String", + AnswerChoice.C, "boolean", + AnswerChoice.D, "float"), + AnswerChoice.UNANSWERED); + } +} diff --git a/lesson_03/quiz/lesson_03_quiz/src/test/resources/application.yml b/lesson_03/quiz/lesson_03_quiz/src/test/resources/application.yml index 94faf520..a8b26810 100644 --- a/lesson_03/quiz/lesson_03_quiz/src/test/resources/application.yml +++ b/lesson_03/quiz/lesson_03_quiz/src/test/resources/application.yml @@ -51,3 +51,6 @@ quiz: mekhiwilliams: - $2y$10$LJMoAo2n0KtfU37Ulqalc.CF5CgXRD7Njp5UL6O7jH3.71q6Iu28u - $2y$10$bnBo4IRqGodV5lHFSsMbcOTTfZrxSwwR2hTp1ft4sD8b9dNbJcBjO + aaronsantiago: + - $2y$10$QFzEBrwDmU2HP42i4fhcH.XKXHb5hw56bpQJ1l23LsgZqtMjptCdm + - $2y$10$vldOhuX/.5WcqZRxQiilAeeDsyNGqFGE.zl1Fd22Nx.baomFvgbV6 \ No newline at end of file