Well that sucks. I can understand both of your positions - your teacher lacks the basic computer terminology, but wants you to make your homework honestly, even tho it sucks for everyone, so she tries the scare tactic. What you did could be classified as cheating if she's in a bad mood and as stupid as it may sound, you could get hurt because of it... again because people are stupid.
I also understand you, trying to automate repetitive and boring tasks... it's what I would do as well... actually it's what I always do
Now about the solution to this... if you say the button is hidden, then they probably log it all the time, so you can't always press it. You could implement random delays to fuck up their time logging, but it would still count towards a correct total score since you say that this button somehow marks the answer as correct. But you could also implement a random answer selection along with random delays, so that you get some of the answers wrong (on purpose).
My guess is that this pass button has some kind of special meaning, so they could have a trigger which notifies them whenever it was used...
Ok, in short, I don't think you have a 100% full-proof solution to this, because they probably have triggers for the button or someshit, idk.