UserAnswers

data class UserAnswers(    val associatedWorkBookId: String,     val answers: Map<MultiChoiceQuestion, IndexOfChosenOption>,     val marksObtainedForWorkBook: Int)

A class that models the answers that are chosen by the user for a particular WorkBook.

Parameters

associatedWorkBookId

the id of the associated WorkBook.

answers

a map that contains the IndexOfChosenOption for each MultiChoiceQuestion.

marksObtainedForWorkBook

indicates the total marks obtained for the WorkBook with the associatedWorkBookId.

Constructors

Link copied to clipboard
fun UserAnswers(    associatedWorkBookId: String,     answers: Map<MultiChoiceQuestion, IndexOfChosenOption>,     marksObtainedForWorkBook: Int)

Properties

Link copied to clipboard
val answers: Map<MultiChoiceQuestion, IndexOfChosenOption>
Link copied to clipboard
val associatedWorkBookId: String
Link copied to clipboard
val marksObtainedForWorkBook: Int

Extensions

Link copied to clipboard
fun UserAnswers.toUserAnswersDTO(): UserAnswersDTO

A converter method that is used to convert an instance of UserAnswers to an instance of UserAnswersDTO.