regarding your first requirement:
a student should be able to attend a quiz only once within 24 hours, and after 24 hours he should be able to re-attempt it again only once
Set the number of attempts to unlimitted (if I understood your case correctly). Also, decide how quiz grading method:
Then, configure the following section:
Regarding your second requirement:
- This should go on until he achieves 100% in the quiz: that's why the number of attempts is unlimited. You could use the completion activity settings to make clear to a student when the quiz is completed (the checkmark will then appear)
only should be able to see the correct answers and their own attempt when they have achieved 100%: This is not possible to configure, it'd be a great feature. You can configure that a student sees his/her attempt with feedback, correct answers, or other option after a quiz is closed and not before in the Review Options section. But a quiz is considered closed only based on the date and not on the number of attempts.
There are some workarounds to this. For instance, I have created one identical quiz for each attempt, displayed them only after the previous one has been completed, and set different review options for each quiz. It's not ideal but it works. But of course, this doesn't work with unlimited attempts.
Maybe other peers have found different solutions to your scenario.