TestSessionViewModel

interface TestSessionViewModel

An interface that contains the methods and properties that are required for a concrete implementation of TestSessionViewModel.

This type of viewModel is used to encapsulate logic that is required to manage a single test session. In other words, it contains the logic that is used to manage a single test (TestDetails).

Types

Link copied to clipboard
enum UiState : Enum<TestSessionViewModel.UiState>

An enum class that contains different UI stats associated with a concrete implementation of TestSessionViewModel.

Functions

Link copied to clipboard
abstract fun markCurrentTestAsComplete()

Used to mark the current test as complete.

Link copied to clipboard
abstract fun moveToNextWorkBook()

Used to update the currentWorkBook value to the next workbook.

Link copied to clipboard
abstract fun playAudioForCurrentWorkBook()

Used to play the audio file for the currentWorkBook.

Link copied to clipboard
abstract fun stopAudioPlayback()

Used to stop the playback of the currently playing audio file.

Properties

Link copied to clipboard
abstract val currentWorkBook: State<WorkBook>

A state property that contains the current WorkBook.

Link copied to clipboard
abstract val currentWorkBookNumber: State<Int>

A state property that contains the current workbook number.

Link copied to clipboard
abstract val hoursRemaining: State<String>

A state property that contains a string indicating the number of hours remaining for the test.

Link copied to clipboard
abstract val isAudioFilePlaying: State<Boolean>

A state property that indicates whether the current audio is playing.

Link copied to clipboard
abstract val minutesRemaining: State<String>

A state property that contains a string indicating the number of minutes remaining for the test.

Link copied to clipboard
abstract val numberOfRepeatsLeftForAudioFile: State<Int>

A state property that contains a string indicating the number of repeats left for the current audio file .

Link copied to clipboard
abstract val playbackState: State<PlaybackState>

A state property that contains an instance of PlaybackState.

Link copied to clipboard
abstract val secondsRemaining: State<String>

A state property that contains a string indicating the number of seconds remaining for the test.

Link copied to clipboard
abstract val uiState: State<TestSessionViewModel.UiState>

A state property that contains the current UiState of the TestSessionViewModel.

Inheritors

Link copied to clipboard