Probably best to ask quiz activity specific questions in the quiz forum - but I'm pretty sure there's a CSV import option that might get you close.
The hardest part might be the fact you don't want this on every failure but only when there are 2 failures. I'm not sure if that will be possible without some development - our tool_trigger plugin might get you close, but you might need to contract your moodle partner to help you with the config/setup.
The hardest part might be the fact you don't want this on every failure but only when there are 2 failures. I'm not sure if that will be possible without some development - our tool_trigger plugin might get you close, but you might need to contract your moodle partner to help you with the config/setup.