As I develop a quiz application using Vue 3 and Bootstrap 4, I've implemented functionality for navigating through the quiz in both directions with methods like nextQuestion
and prevQuestion
.
My ultimate goal is to transform this app into a full-stack application, leveraging the Trivia API for additional features. Since the Trivia API cannot be modified, most of the logic will need to reside within Vue.
#quiz_app { height: 100vh; } .container { flex: 1; } ... <div id="quiz_app" class="container d-flex flex-column justify-content-center my-3"> <h2 class="display-4 category-name">Books</h2> <div class="questions d-flex flex-column align-items-center"> <div v-if="results.length" class="card shadow-sm" :class="{'bg-light': isScoreVisible}"> ... </div> </div> </div>.
The Challenge
One issue I'm facing is that when navigating back and forth between quiz questions, the selected answers are not retained or saved for future reference.
Queries
- Is there a dependable method in JavaScript to retain user-selected answers, or should I consider utilizing an API to store them in a database?
- If an API solution is required, would the Trivia API suffice, especially regarding its support for POST requests?