Session is totally fine. It’s easy to use, no database setup required, and the data will stick around while the user is taking the quiz. Once they’re done, you can calculate the result and display it, and that’s it.
If you want to store results or review them later:
Database is the way to go. You’ll be able to save each user’s answers along with their name, timestamp, score, whatever you want. That opens up possibilities like:
Viewing past quiz results
Tracking how many people took the quiz
Generating stats, reports, etc.
TL;DR:
For one-time use, session is okay.
If you want to store data for future use, go with the database.