Constructor
new QuizRepository(database)
Parameters:
Name | Type | Description |
---|---|---|
database |
Object | The database connection used for accessing quiz data. |
- Source:
Methods
(static) deleteQuiz(quizId) → {Promise.<void>}
Deletes a quiz from the database using its ID.
Parameters:
Name | Type | Description |
---|---|---|
quizId |
string | The ID of the quiz to be deleted. |
- Source:
Returns:
- Type
- Promise.<void>
(static) getAllQuizes() → {Promise.<Array.<Object>>}
Retrieves all quizzes as a mapped object.
- Source:
Returns:
A promise that resolves to an array of quiz objects.
- Type
- Promise.<Array.<Object>>
(static) getAll_Quizes() → {Promise.<Array.<Object>>}
Retrieves all quizzes from the database.
- Source:
Returns:
A promise that resolves to an array of quiz objects.
- Type
- Promise.<Array.<Object>>
(static) getQuizById(id) → {Promise.<Object>}
Retrieves a quiz by its ID.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The ID of the quiz to retrieve. |
- Source:
Returns:
A promise that resolves to the quiz object or a string indicating it does not exist.
- Type
- Promise.<Object>
(static) getQuizBy_Id(quizId) → {Promise.<Object>}
Retrieves a quiz by its ID from the 'quizzes' collection.
Parameters:
Name | Type | Description |
---|---|---|
quizId |
string | The ID of the quiz to retrieve. |
- Source:
Returns:
A promise that resolves to the quiz object.
- Type
- Promise.<Object>
(static) getQuizMap() → {Promise.<Object>}
Retrieves a map of quizzes from the snapshot.
- Source:
Returns:
A promise that resolves to a map of quiz objects.
- Type
- Promise.<Object>
(static) getSnapshot() → {Promise.<Object>}
Retrieves the snapshot of the quiz collection.
- Source:
Returns:
A promise that resolves to the snapshot object.
- Type
- Promise.<Object>
(static) get_AllQuizzes() → {Promise.<Array.<Object>>}
Retrieves all quizzes from the 'quizzesCreation' collection in the database.
- Source:
Returns:
A promise that resolves to an array of quiz objects.
- Type
- Promise.<Array.<Object>>
(static) get_QuizById(id) → {Promise.<Object>}
Retrieves a quiz by its ID from the 'quizzesCreation' collection.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The ID of the quiz to retrieve. |
- Source:
Returns:
A promise that resolves to the quiz object.
- Type
- Promise.<Object>
(static) initializeSnapshot() → {Promise.<void>}
Initializes the snapshot of the quiz collection.
- Source:
Returns:
- Type
- Promise.<void>