Skip to content

Commit

Permalink
Add correctAnswer question property
Browse files Browse the repository at this point in the history
  • Loading branch information
PotatoCurry committed May 17, 2019
1 parent 423c85d commit b63207e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/api/Quiz.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class Quiz internal constructor(quizID: String) {
val created = jsonQuiz.created

val modified = jsonQuiz.modified


}

class Question internal constructor(jsonQuestion: JsonQuestion) {
Expand All @@ -73,6 +71,8 @@ class Question internal constructor(jsonQuestion: JsonQuestion) {
val answerCount = jsonQuestion.numberOfAnswers

val choices = jsonQuestion.choices.map(::Choice)

val correctAnswer = choices.single{ it.correct }.answer
}

class Choice internal constructor(jsonChoice: JsonChoice) {
Expand Down

0 comments on commit b63207e

Please sign in to comment.