Skip to content

Commit

Permalink
feat: adds Sherllin's quiz (#130)
Browse files Browse the repository at this point in the history
* feat: added quiz

* feat: added quiz

* feat added answer key in YML

* added test
  • Loading branch information
SherllinT committed Mar 6, 2024
1 parent 2f69520 commit 2328fd1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
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.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ quiz:
kyvonthompson:
- $2y$10$1HELIO6MiQIwOJhE0D2UWuoLCgfNk5H0VCBMp1Q75vmvCRVeElKqm
- $2y$10$F9WPv2rClYgTwVYBwkMz6u1TK36.3hY5qRQGBNFsrjE0FtubSpKka
sherllint:
- $2y$10$t.Bp0AznB1y1OuzyLD5y1eBHI3uGhzDGZAYmGmhQ7KevnafFbzgey
- $2y$10$ixh3kgGd8tFk0fBH4sr2JO87LncX88lqJGwVauc182Nug8IeHaJ7i

0 comments on commit 2328fd1

Please sign in to comment.