RemoteDatabase

interface RemoteDatabase

An interface that contains the requisite methods for a remote database.

Functions

Link copied to clipboard
abstract suspend fun fetchActiveTestListForUser(user: ExamerUser): List<TestDetails>

Used to fetch a list of active tests for the specified user. An active test is any instance of TestDetails with TestDetails.testStatus set to Status.OPEN or Status.SCHEDULED. The returned list will contain both, tests which are open and tests which are scheduled.

Link copied to clipboard
abstract suspend fun fetchPreviousTestListForUser(user: ExamerUser): List<TestDetails>

Used to fetch a list of previous tests for the specified user.

Link copied to clipboard
abstract suspend fun fetchResultsForTest(user: ExamerUser, testDetailsId: String): TestResult

Used to fetch the TestResult of a single test with the specified testDetailsId for a specific user.

Link copied to clipboard
abstract suspend fun fetchWorkBookList(user: ExamerUser, testDetails: TestDetails): Result<List<WorkBookDTO>>

Used to fetch a list of WorkBooks associated with a specific TestDetails object, for the specified user. An instance of Result containing the list is returned.

Link copied to clipboard
abstract suspend fun markTestAsCompleted(user: ExamerUser, testDetailsId: String)

Used to mark a test with the associated testDetailsId as complete.

Link copied to clipboard
abstract suspend fun markTestAsMissed(user: ExamerUser, testDetailsId: String)

Used to mark a test with the associated testDetailsId as missed.

Link copied to clipboard
abstract suspend fun saveBitmap(bitmap: Bitmap, fileName: String): Result<Uri>

Used to save an instance of bitmap with the specified fileName. It returns an instance of Result containing the associated Uri.

Link copied to clipboard
abstract suspend fun saveUserAnswers(    user: ExamerUser,     userAnswers: UserAnswers,     testDetailsId: String)

Used to save the userAnswers associated with a particular test, with the specified testDetailsId, for the specified user.

Inheritors

Link copied to clipboard