You can embed an iFrame in a book, for instance an embeddable quiz like Betterquiz.

At this stage, it’s best to use Liquid control flow tags to show text-only alternatives in PDF and epub, and embedded iFrames only in web output.

Here’s an iFrame showing the modern book production process.