-
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.
* feat: added quiz * feat: added quiz * feat added answer key in YML * added test
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
.../quiz/lesson_03_quiz/src/main/java/com/codedifferently/lesson3/quizzes/SherllinTQuiz.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,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 SherllinTQuiz implements QuizQuestionProvider { | ||
|
||
public String getProviderName() { | ||
return "sherllint"; | ||
} | ||
|
||
public List<QuizQuestion> makeQuizQuestions() { | ||
return List.of(makeQuestion0(), makeQuestion1()); | ||
} | ||
|
||
private QuizQuestion makeQuestion0() { | ||
return new MultipleChoiceQuizQuestion( | ||
0, | ||
"An algorithm is predictable, deterministic, and not subject to chance", | ||
Map.of( | ||
AnswerChoice.A, "True", | ||
AnswerChoice.B, "False"), | ||
AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer. | ||
} | ||
|
||
private QuizQuestion makeQuestion1() { | ||
return new MultipleChoiceQuizQuestion( | ||
1, | ||
"Which of the following is not a strongly typed language?", | ||
Map.of( | ||
AnswerChoice.A, "Python", | ||
AnswerChoice.B, "JavaScript", | ||
AnswerChoice.C, "TypeScript", | ||
AnswerChoice.D, "Java"), | ||
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