Skip to content

Commit

Permalink
feat: adds Randy's quiz (#124)
Browse files Browse the repository at this point in the history
* chore: made quiz folder under quizzes

* added 2 questions

* chore: updated questions and added an

* added another question

* chore: added answers

* chore: deleted 1 question

* chore: updated question and answers

* chore: fixed answers

* deleted file

* update

* update

* update

* undo files

* delete settings file
  • Loading branch information
RandyCastr0 committed Mar 5, 2024
1 parent bc5d932 commit ae9da2f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
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 RandycastroQuiz implements QuizQuestionProvider {

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

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

private QuizQuestion makeQuestion0() {
return new MultipleChoiceQuizQuestion(
0,
"What does CPU stand for?",
Map.of(
AnswerChoice.A, "Central Processing Unit",
AnswerChoice.B, "Computer Power Unit",
AnswerChoice.C, "Control Processing Unit",
AnswerChoice.D, "Central Power Unit"),
AnswerChoice.A); // Replace `UNANSWERED` with the correct answer.
}

private QuizQuestion makeQuestion1() {
return new MultipleChoiceQuizQuestion(
1,
"Which of the following is a type of computer memory that is volatile and loses its contents when the power is turned off?",
Map.of(
AnswerChoice.A, "ROM (Read-Only Memory)",
AnswerChoice.B, "RAM (Random Access Memory)",
AnswerChoice.C, "HDD (Hard Disk Drive)",
AnswerChoice.D, "SSD (Solid State Drive)"),
AnswerChoice.D); // Replace 'UNANSWERED' with the correct answer.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ quiz:
vicentevigueras:
- $2y$10$ZvHv8epqQTKiHglU62V5YOAT0gMAgzkikkabDH56gY3oqeFpK0uKC
- $2y$10$VIQxIQCzXdOYgiYfJ62.luYL5DFu34tU0HbqlawoH2LAOYCbT.Bky


randycastro:
- $2y$10$JDR92zWPkVIhw5.ipD3Tye6rJctiwGiNDL/QV1bZBY9OqH569SUmG
- $2y$10$Bc8KTSlblvafPd3Jskm4l.g1CAEgG4k5m/LPa99D3U3uHXwiLF1.e

0 comments on commit ae9da2f

Please sign in to comment.