Coping with school failure and self-regulated learning