-
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.
* changed number 1 * feat: Answered quiz questions * feat: Remade my branch and created quiz with answers * Update Lesson2.java
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...uiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/NatayaPriceQuiz.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,45 @@ | ||
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 NatayaPriceQuiz implements QuizQuestionProvider { | ||
|
||
public String getProviderName() { | ||
return "natayaprice"; | ||
} | ||
|
||
public List<QuizQuestion> makeQuizQuestions() { | ||
return List.of(makeQuestion0(), makeQuestion1()); | ||
} | ||
|
||
private QuizQuestion makeQuestion0() { | ||
return new MultipleChoiceQuizQuestion( | ||
0, | ||
"Programmable read-only memory (PROM) chips can be programmed..", | ||
Map.of( | ||
AnswerChoice.A, "Once", | ||
AnswerChoice.B, "Twice", | ||
AnswerChoice.C, "However many times you would like to", | ||
AnswerChoice.D, "Every so often"), | ||
AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. | ||
} | ||
|
||
private QuizQuestion makeQuestion1() { | ||
return new MultipleChoiceQuizQuestion( | ||
1, | ||
"Who designed and programmed the VisiCalc?", | ||
Map.of( | ||
AnswerChoice.A, "Alan Kay and Douglas Engelbart", | ||
AnswerChoice.B, "Ken Thompson and Dennis Ritchie", | ||
AnswerChoice.C, "Dan Bricklin and Bob Frankston", | ||
AnswerChoice.D, "Tom and Jerry"), | ||
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