No easy way to do this - I don't think there is a config setting to change it.
It would be possible to do with a change to the code, but this is not advised unless you know what you're doing and you understand the consequences.
With that caveat... line 117 of mod/lesson/view.php says
$attemptflag = true;
Change that to
$attemptflag = false;