From c7b6a2d5f740ee4e837db0fc26e04a9ebf434a95 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 2 Mar 2024 20:17:56 +0000 Subject: [PATCH 1/3] Chore: changed only the Lesson2.java file to have the correct answers. --- .../com/codedifferently/lesson2/Lesson2.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lesson_02/quiz/lesson_02_quiz/src/main/java/com/codedifferently/lesson2/Lesson2.java b/lesson_02/quiz/lesson_02_quiz/src/main/java/com/codedifferently/lesson2/Lesson2.java index cbe4a24f..48abefc8 100644 --- a/lesson_02/quiz/lesson_02_quiz/src/main/java/com/codedifferently/lesson2/Lesson2.java +++ b/lesson_02/quiz/lesson_02_quiz/src/main/java/com/codedifferently/lesson2/Lesson2.java @@ -52,7 +52,7 @@ private static QuizQuestion makeQuestion0() { AnswerChoice.B, "The monitor", AnswerChoice.C, "The keyboard", AnswerChoice.D, "The mouse"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.A); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion1() { @@ -64,7 +64,7 @@ private static QuizQuestion makeQuestion1() { AnswerChoice.B, "The keyboard", AnswerChoice.C, "The CPU", AnswerChoice.D, "RAM"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer + AnswerChoice.C); // Replace `UNANSWERED` with the correct answer } private static QuizQuestion makeQuestion2() { @@ -76,7 +76,7 @@ private static QuizQuestion makeQuestion2() { AnswerChoice.B, "The GPU", AnswerChoice.C, "RAM", AnswerChoice.D, "The motherboard"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.B); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion3() { @@ -88,7 +88,7 @@ private static QuizQuestion makeQuestion3() { AnswerChoice.B, "The keyboard", AnswerChoice.C, "RAM", AnswerChoice.D, "The GPU"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.C); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion4() { @@ -100,7 +100,7 @@ private static QuizQuestion makeQuestion4() { AnswerChoice.B, "Storage devices", AnswerChoice.C, "RAM", AnswerChoice.D, "CPU"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.B); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion5() { @@ -112,28 +112,28 @@ private static QuizQuestion makeQuestion5() { AnswerChoice.B, "Storage", AnswerChoice.C, "RAM", AnswerChoice.D, "CPU"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.A); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion6() { return new QuizQuestion( 6, "What is the decimal number 34 in binary?", - "0b00000000"); // Replace the correct digits in the answer. + "0b00100010"); // Replace the correct digits in the answer. } private static QuizQuestion makeQuestion7() { return new QuizQuestion( 7, "What is the decimal number 34 in hex?", - "0x00"); // Replace the correct digits in the answer. + "0x22"); // Replace the correct digits in the answer. } private static QuizQuestion makeQuestion8() { return new QuizQuestion( 8, "What is binary number 0b01100101 in decimal?", - "0"); // Specify the correct number (no leading zeros). + "101"); // Specify the correct number (no leading zeros). } private static QuizQuestion makeQuestion9() { @@ -145,7 +145,7 @@ private static QuizQuestion makeQuestion9() { AnswerChoice.B, "git pull ", AnswerChoice.C, "git checkout -b ", AnswerChoice.D, "git push "), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.C); // Replace `UNANSWERED` with the correct answer. } private static QuizQuestion makeQuestion10() { @@ -157,6 +157,6 @@ private static QuizQuestion makeQuestion10() { AnswerChoice.B, "There is no difference since everything is a branch to git", AnswerChoice.C, "A fork requires an upstream remote whereas a branch does not", AnswerChoice.D, "You can only make pull requests using a branch"), - AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. + AnswerChoice.B); // Replace `UNANSWERED` with the correct answer. } } From e6a9507bcbe1734372adfeb8e5a95a21499cd1df Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 3 Mar 2024 17:48:28 +0000 Subject: [PATCH 2/3] chore: updating --- .../org.eclipse.buildship.core.prefs | 4 +- .../.settings/org.eclipse.jdt.core.prefs | 16 +- lesson_03/quiz/lesson_03_quiz/.classpath | 334 +----------------- lesson_03/quiz/lesson_03_quiz/.project | 20 +- .../org.eclipse.buildship.core.prefs | 6 +- .../instructional-lib/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 16 +- 7 files changed, 38 insertions(+), 360 deletions(-) diff --git a/lesson_02/quiz/.settings/org.eclipse.buildship.core.prefs b/lesson_02/quiz/.settings/org.eclipse.buildship.core.prefs index 31a1d403..f9d201ee 100644 --- a/lesson_02/quiz/.settings/org.eclipse.buildship.core.prefs +++ b/lesson_02/quiz/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ -arguments=--init-script /root/.local/share/nvim/mason/packages/jdtls/config_linux/org.eclipse.osgi/55/0/.cp/gradle/init/init.gradle +arguments=--init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.28.1/config_linux/org.eclipse.osgi/55/0/.cp/gradle/init/init.gradle --init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.28.1/config_linux/org.eclipse.osgi/55/0/.cp/gradle/protobuf/init.gradle auto.sync=false build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=/root/.sdkman/candidates/java/17-open +java.home=/usr/local/sdkman/candidates/java/current jvm.arguments= offline.mode=false override.workspace.settings=true diff --git a/lesson_02/quiz/lesson_02_quiz/.settings/org.eclipse.jdt.core.prefs b/lesson_02/quiz/lesson_02_quiz/.settings/org.eclipse.jdt.core.prefs index be44e1b7..ee08bb14 100644 --- a/lesson_02/quiz/lesson_02_quiz/.settings/org.eclipse.jdt.core.prefs +++ b/lesson_02/quiz/lesson_02_quiz/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=ignore org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve @@ -14,9 +14,9 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled org.eclipse.jdt.core.compiler.source=17 diff --git a/lesson_03/quiz/lesson_03_quiz/.classpath b/lesson_03/quiz/lesson_03_quiz/.classpath index 890e87c6..24f7f804 100644 --- a/lesson_03/quiz/lesson_03_quiz/.classpath +++ b/lesson_03/quiz/lesson_03_quiz/.classpath @@ -1,21 +1,19 @@ - - - + - + - + @@ -23,333 +21,11 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/lesson_03/quiz/lesson_03_quiz/.project b/lesson_03/quiz/lesson_03_quiz/.project index f44fadbd..c107cec0 100644 --- a/lesson_03/quiz/lesson_03_quiz/.project +++ b/lesson_03/quiz/lesson_03_quiz/.project @@ -2,27 +2,29 @@ lesson_03_quiz - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - + + org.eclipse.jdt.core.javabuilder - + + org.eclipse.buildship.core.gradleprojectbuilder - + + - + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + 1 + 30 - org.eclipse.core.resources.regexFilterMatcher node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/lib/java/codedifferently-instructional/.settings/org.eclipse.buildship.core.prefs b/lib/java/codedifferently-instructional/.settings/org.eclipse.buildship.core.prefs index 31a1d403..d8849818 100644 --- a/lib/java/codedifferently-instructional/.settings/org.eclipse.buildship.core.prefs +++ b/lib/java/codedifferently-instructional/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ -arguments=--init-script /root/.local/share/nvim/mason/packages/jdtls/config_linux/org.eclipse.osgi/55/0/.cp/gradle/init/init.gradle -auto.sync=false +arguments=--init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.28.1/config_linux/org.eclipse.osgi/55/0/.cp/gradle/init/init.gradle --init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.28.1/config_linux/org.eclipse.osgi/55/0/.cp/gradle/protobuf/init.gradle +auto.sync=true build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=/root/.sdkman/candidates/java/17-open +java.home=/usr/local/sdkman/candidates/java/current jvm.arguments= offline.mode=false override.workspace.settings=true diff --git a/lib/java/codedifferently-instructional/instructional-lib/.classpath b/lib/java/codedifferently-instructional/instructional-lib/.classpath index 187fe762..ae30f860 100644 --- a/lib/java/codedifferently-instructional/instructional-lib/.classpath +++ b/lib/java/codedifferently-instructional/instructional-lib/.classpath @@ -15,5 +15,5 @@ - + diff --git a/lib/java/codedifferently-instructional/instructional-lib/.settings/org.eclipse.jdt.core.prefs b/lib/java/codedifferently-instructional/instructional-lib/.settings/org.eclipse.jdt.core.prefs index 7726726d..66ec0063 100644 --- a/lib/java/codedifferently-instructional/instructional-lib/.settings/org.eclipse.jdt.core.prefs +++ b/lib/java/codedifferently-instructional/instructional-lib/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve @@ -13,9 +13,9 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled org.eclipse.jdt.core.compiler.source=17 From d745a19e9a7220c5b7e383a730124279653b2f50 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 3 Mar 2024 19:30:31 +0000 Subject: [PATCH 3/3] chore: updated JavyenWareQuiz.java file and added my encrypted answers to the application.yml file --- .../lesson3/quizzes/JavyenWareQuiz.java | 43 +++++++++++++++++++ .../src/test/resources/application.yml | 4 ++ 2 files changed, 47 insertions(+) create mode 100644 lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/JavyenWareQuiz.java diff --git a/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/JavyenWareQuiz.java b/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/JavyenWareQuiz.java new file mode 100644 index 00000000..cce522b0 --- /dev/null +++ b/lesson_03/quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/JavyenWareQuiz.java @@ -0,0 +1,43 @@ +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 JavyenWareQuiz implements QuizQuestionProvider { + + public String getProviderName() { + return "javyenware"; + } + + 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 convetion 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); // Replace `UNANSWERED` with the correct answer. + } + + private QuizQuestion makeQuestion1() { + return new QuizQuestion( + 1, + "What is the defintion of a class in the Java programming language?", + ""); // Provide an answer. + } +} 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 7c6b2bdd..6f142310 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 @@ -6,3 +6,7 @@ quiz: anthonymays: - $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK - $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe + + javyenware: + - $2y$10$BeOZiGHEZhPmVsDZctelR.MoJM.d958.kQNXUbU8wv9YJv6y5LCyi + - $2y$10$PGEOcTvM4l6u0yk3Nydh6.mPUXjMYKccMl/tsmQUa5j/tZR55ND0. \ No newline at end of file