Skip to content

Commit

Permalink
feat: add answerNumber field in tutorial quiz response
Browse files Browse the repository at this point in the history
  • Loading branch information
gikhoon committed Dec 12, 2024
1 parent a414a6d commit cbf0d18
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ public record RandomTutorialQuizResponse(
Long id,
String question,
String imageUrl,
List<String> choices
List<String> choices,
Integer answerNumber
) {
public static RandomTutorialQuizResponse from(final RandomQuiz randomQuiz) {
return new RandomTutorialQuizResponse(
randomQuiz.getId(),
randomQuiz.getQuestion(),
randomQuiz.getImage() != null ? randomQuiz.getImage().getUrl() : null,
randomQuiz.getChoices().buildChoiceList()
randomQuiz.getChoices().buildChoiceList(),
randomQuiz.getAnswerNumber()
);
}
}

0 comments on commit cbf0d18

Please sign in to comment.