FirebaseRemoteDatabase

class FirebaseRemoteDatabase(dispatcherProvider: DispatcherProvider) : RemoteDatabase

A concrete implementation of RemoteDatabase that uses Firebase.

Constructors

Link copied to clipboard
fun FirebaseRemoteDatabase(dispatcherProvider: DispatcherProvider)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override 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
open suspend override fun fetchPreviousTestListForUser(user: ExamerUser): List<TestDetails>

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

Link copied to clipboard
open suspend override 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
open suspend override 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
open suspend override fun markTestAsCompleted(user: ExamerUser, testDetailsId: String)

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

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

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

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