1) You need to retain the Answer value as per selected option on next button click for each question in ViewState as per Question id
2) In Last Where you are showing the Quiz Score there you can Save the details By looping to all the question with saved values for selected answer from Viewstate.
3) So if user quit in between then there is no impact in database as user not completed the exam till the last question so details will not get saved in database until he complete the test also you don’t need to restore any value if use quit the test in between.