Constructor
new MainQuizPage() → {React.Component}
- Source:
Returns:
A component for quiz interaction and management.
- Type
- React.Component
Methods
(static) calculateInitialTime() → {Number}
Calculates the initial time for the quiz based on the number of questions.
- Source:
Returns:
Initial time for the quiz.
- Type
- Number
(static) checkAnswer(choiceIndex)
Checks if the selected answer is correct and updates the question state.
Parameters:
Name | Type | Description |
---|---|---|
choiceIndex |
Number | Index of the selected choice. |
- Source:
(static) formatTime() → {String}
Formats the remaining time for display.
- Source:
Returns:
Formatted time string.
- Type
- String
(static) getButtonStyle(choiceIndex, questionIndex) → {Object}
Determines the style for each answer choice button.
Parameters:
Name | Type | Description |
---|---|---|
choiceIndex |
Number | Index of the current choice. |
questionIndex |
Number | Index of the current question. |
- Source:
Returns:
Style object for the button.
- Type
- Object
(static) getQuestionStyle(index) → {Object}
Determines the style for each question in the sidebar.
Parameters:
Name | Type | Description |
---|---|---|
index |
Number | Index of the question. |
- Source:
Returns:
Style object for the question.
- Type
- Object
(static) handleBack()
Navigates back to the flashcards page.
- Source:
(static) handleCloseDialog()
Closes the dialog for pausing the quiz.
- Source:
(static) handleConfirmPause()
Confirms the pause action and saves the current state of the quiz.
- Source:
(static) handleNext()
Navigates to the next question.
- Source:
(static) handleOpenDialog()
Opens the dialog for pausing the quiz.
- Source:
(static) handlePause()
Handles the action to pause the quiz.
- Source:
(static) handlePrevious()
Navigates to the previous question.
- Source:
(static) handleResume()
Resumes the quiz from the saved state.
- Source:
(static) shuffleChoices(choices) → {Array}
Randomly shuffles the choice options for each question.
Parameters:
Name | Type | Description |
---|---|---|
choices |
Array | Array of choice options to shuffle. |
- Source:
Returns:
Shuffled choice options.
- Type
- Array