Is there a way to allow students a second attempt at a quiz ONLY if they failed their first attempt?
As far as I'm aware the only way you could do this is by manually allowing a second attempt via user overrides when you know they have failed.
If you want it to be automated, a convoluted workaround could be to have a second locked (password protected) or restricted quiz that is revealed via PLD when the student fails the first version of the quiz. You could do this by either "unlock release code" or "add user to group" (for locked and restricted respectively). If the quiz contributes to a final grade, this method would require you to also set up your gradebook to drop the lowest quiz's grade to keep the highest one. Happy to explain further if you'd like.
That's just a wild thought, perhaps someone else might have a better solution for you!
Retrieving data ...