Package com.example.examer.data.domain

Types

Link copied to clipboard
data class ExamerAudioFile(val localAudioFileUri: Uri, val numberOfRepeatsAllowedForAudioFile: Int) : Serializable

Models an audio file.

Link copied to clipboard
data class ExamerUser(    val id: String,     val name: String,     val email: String,     val phoneNumber: String?,     val photoUrl: Uri? = null)

A domain model class that represents a user with a id,name, email,phoneNumber and a photoUrl that will be used as the profile picture of the user.

Link copied to clipboard
value class IndexOfChosenOption(val value: Int)

A value class that models the index of the option that is chosen by the user for a MultiChoiceQuestion.

Link copied to clipboard
data class MultiChoiceQuestion(    val id: String,     val question: String,     val options: Array<String>,     val indexOfCorrectOption: Int,     val mark: Int) : Serializable

Class that models a single question in a WorkBook.

Link copied to clipboard
enum Status : Enum<Status>

An enum class representing the status of the test.

Link copied to clipboard
data class TestDetails(    val id: String,     val title: String,     val description: String,     val language: String,     val localDateTime: LocalDateTime,     val totalNumberOfWorkBooks: Int,     val testDurationInMinutes: Int,     val testStatus: Status) : Serializable

A data class that models a test.

Link copied to clipboard
data class TestResult(    val testDetailsId: String,     val marksObtained: Int,     val maximumMarks: Int)

A class that models the results of single test.

Link copied to clipboard
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.

Link copied to clipboard
data class WorkBook(    val id: String,     val audioFile: ExamerAudioFile,     val questions: List<MultiChoiceQuestion>) : Serializable

A class that models a work book with the associated id, audioFile and questions list.

Functions

Link copied to clipboard
fun TestDetails.getDateStringAndTimeString(is24hourFormat: Boolean = false): Pair<String, String>

Used to get a pair consisting of strings representing date and time. The first value in the pair is the date string and the second value is the time.

Link copied to clipboard
fun TestDetails.isScheduledNotOpen(): Boolean

Used to check whether the test is scheduled, but not open.

Link copied to clipboard
fun TestDetails.isTestExpired(): Boolean

Used to check whether the test has expired (The window for taking the test has expired).

Link copied to clipboard
fun TestDetails.isTestOpen(): Boolean

Used to check whether the test is open for accepting answers.

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.