The method has gone viral on Chinese social media, with many parents asking him for a tutorial on modifying their own sets, Shenzhen TV reported.

The father, a hired driver who takes customers home in their own cars, said his son, a junior high school student, spent long hours watching TV instead of studying.

In late October, the father described what he needed to an AI tool, which suggested building a "quiz lock" app and set out how it would work. He refined the plan with the AI and soon had a first version running on the TV.

Now, while the boy watches, a question on Chinese, math or English pops up every 10 minutes, matched to his textbooks and progress at school. A correct answer lets him keep watching, while a wrong one brings an extra question.

A boy looks at a screen in a dark room. Photo by Tra Tran/Unsplash

A boy looks at a screen in a dark room. Illustration photo by Unsplash/Tra Tran

The father said he was surprised to find the boy actually enjoyed the questions, and he plans to make them harder.

The aim was not an outright TV ban, he said, but a game of attack and defense between father and son.

"He's allowed to use every means to crack my system, and I'll use every method to patch the holes. Isn't that a way of learning, too?" he said. "If he can find his own way to deal with it, I'll be very happy."

He said a tutorial could take some time, as different TV sets have different security and privacy settings that he still needs to work through.

The first time a question popped up, the boy, a seventh grader, immediately realized his father was behind it and cut the power to restart the TV, state broadcaster CCTV reported. His father then closed the loophole.

The system also logs the questions the boy gets wrong and brings them back in different forms until the AI judges he has mastered them, the broadcaster said. If he picks a documentary, a "parent unlock" option gives him two hours of viewing free of questions.

Some social media users accused the father of "turning the home into an exam room" and asked what would be left of childhood if a child had to sit a test just to watch TV, Cover News reported.

Others said tying entertainment to schoolwork could lead children to equate learning with punishment.