Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding Anthony's quiz #114

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,40 @@
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 ExampleQuiz implements QuizQuestionProvider {

public String getProviderName() {
return "example";
}

public List<QuizQuestion> makeQuizQuestions() {
return List.of(makeQuestion0(), makeQuestion1());
}

private QuizQuestion makeQuestion0() {
return new MultipleChoiceQuizQuestion(
0,
"What is a multiple choice question?",
Map.of(
AnswerChoice.A, "A question about agency",
AnswerChoice.B, "The hardest kind of quiz question there is",
AnswerChoice.C, "A question that can be answered using one or more provided choices",
AnswerChoice.D, "Whatever you want it to be!"),
AnswerChoice.UNANSWERED); // Replace `UNANSWERED` with the correct answer.
}

private QuizQuestion makeQuestion1() {
return new QuizQuestion(
1,
"What is a computer?",
"A machine that automatically transforms input into output."); // Provide an answer.
}
}
Expand Up @@ -12,6 +12,9 @@ quiz:
anthonymays:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
example:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
moibrahi7:
- $2y$10$qMRtpEAfuW9e5WyZv5qzxuTj3JDO4xuOrNwm1FZuQ9uGcm3NHZMC.
- $2y$10$VOND8Wn7DA7DHPhJWmyMqurfRkjWZv3m3VnG29TfTOTRusxTNKa6q
Expand Down