That's funny, but he may have meant you should not put off homework til the last possible day or minute, or just this kind of thing can come up and scuttle it. If the teacher literally assigned it at 3pm, due next day, then a few hours later you're electrocuted, that's understandable. But if it was assigned a week before, and it would have only done a few hours to do, it's much less so. Because stuff comes up. If it wasn't random electrocution it would be random something else. And keep in mind the same teacher probably hears lots of excuses, some real, some made-up, all the time. I imagine it gets frustrating for them, and their empathy wanes away. Cops have a similar effect.
jes5199's wiktionary link says that "Strictly correct usage is to reserve electrocute and electrocution for fatal electric shocks". Do you have a source?
Looks like I was misinformed. However, the Wikipedia entry for electrocution (http://en.wikipedia.org/wiki/Electrocution) does mention that the choice of definition varies from dictionary to dictionary.
Me: I don't have my homework because I electrocuted myself last night and went to the hospital [true story].
Teacher: You should have planned that into your schedule [apparently serious].