Package com.example.examer.data.dto

Types

Link copied to clipboard
data class AudioFileDTO(val audioFileUrl: URL, val numberOfRepeatsAllowedForAudioFile: Int)

A DTO object for ExamerAudioFile.

Link copied to clipboard
data class MultiChoiceQuestionDTO(    val questionNumber: Int,     val question: String,     val options: Array<String>,     val indexOfCorrectOption: Int,     val markForQuestion: Int)

A DTO object for MultiChoiceQuestion.

Link copied to clipboard
value class MultiChoiceQuestionListDTO(val questions: List<MultiChoiceQuestionDTO>)

A DTO value class that wraps a list of MultiChoiceQuestionListDTO.

Link copied to clipboard
data class TestDetailsDTO(    val id: String,     val title: String,     val description: String,     val language: String,     val timeStamp: String,     val totalNumberOfWorkBooks: String,     val testDurationInMinutes: String,     val testStatus: String,     val maximumMarks: String)

A DTO object for TestDetails.

Link copied to clipboard
data class UserAnswersDTO(    val associatedWorkBookId: String,     val answersDetailsMap: List<Map<String, String>>,     val marksObtainedForWorkBook: String)

A DTO object for UserAnswers.

Link copied to clipboard
data class WorkBookDTO(    val id: String,     val audioFile: AudioFileDTO,     val questions: List<MultiChoiceQuestionDTO>)

A DTO object equivalent to WorkBookDTO.

Functions

Link copied to clipboard

Extension function used to convert an instance of MultiChoiceQuestionDTO to an instance of MultiChoiceQuestion.

Link copied to clipboard
fun TestDetailsDTO.toTestDetails(): TestDetails

Utility method used to convert an instance of TestDetailsDTO to an instance of TestDetails.

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

A utility method used to convert an instance of DocumentSnapshot to an instance of UserAnswersDTO.