-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding my Quiz and answers * Update: Quiz complete and tests passed
- Loading branch information
1 parent
e10ebd1
commit 51d9872
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
.../lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/JordanEldridgeQuiz.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
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 JordanEldridgeQuiz implements QuizQuestionProvider { | ||
|
||
public String getProviderName() { | ||
return "jordaneldridge"; | ||
} | ||
|
||
public List<QuizQuestion> makeQuizQuestions() { | ||
return List.of(makeQuestion0(), makeQuestion1()); | ||
} | ||
|
||
private QuizQuestion makeQuestion0() { | ||
return new MultipleChoiceQuizQuestion( | ||
0, | ||
"What is the size of float and double in java?", | ||
Map.of( | ||
AnswerChoice.A, | ||
"34 and 64", | ||
AnswerChoice.B, | ||
"32 and 32", | ||
AnswerChoice.C, | ||
"34 and 34", | ||
AnswerChoice.D, | ||
"64 and 32"), | ||
AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. | ||
} | ||
|
||
private QuizQuestion makeQuestion1() { | ||
return new MultipleChoiceQuizQuestion( | ||
1, | ||
"Arrays in java are-", | ||
Map.of( | ||
AnswerChoice.A, | ||
"Object references", | ||
AnswerChoice.B, | ||
"objects", | ||
AnswerChoice.C, | ||
"Primitive data type", | ||
AnswerChoice.D, | ||
"none"), | ||
AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters