As there is no option available in Google web stories WordPress plugin to add amp-story-interactive-quiz, I'm trying to add a page manually with following code. The page appears but not the quiz.
<amp-story-page id="page-quiz-1" auto-advance-after="7s" class="i-amphtml-layout-container" i-amphtml-layout="container">
<amp-story-grid-layer template="vertical" aspect-ratio="412:618" class="grid-layer i-amphtml-layout-container" i-amphtml-layout="container" style="--aspect-ratio:412/618;">
<div class="_d81be3e page-fullbleed-area">
<div class="page-safe-area">
<div class="_6120891">
<div class="_89d52dd mask" id="el-308cf719-9b44-4c9e-904e-13145bbbdc61">
<div data-leaf-element="true" class="_1ef959d">
<amp-img layout="fill" src="https://images.unsplash.com/photo-1580582932707-520aed937b7b?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxleGFtfGVufDB8fHx8MTY4MTM4MTM4OA&ixlib=rb-4.0.3&fm=jpg&w=4668&h=2626&fit=max" alt="brown wooden table and chairs" sizes="(min-width: 1024px) 143vh, 317vw" disable-inline-width="true" class="i-amphtml-layout-fill i-amphtml-layout-size-defined" i-amphtml-layout="fill"></amp-img>
</div>
<div class="_f0c8e08 element-overlay-area"></div>
</div>
</div>
</div>
</div>
</amp-story-grid-layer>
<amp-story-grid-layer template="fill" aspect-ratio="412:618"
class="grid-layer i-amphtml-layout-container" i-amphtml-layout="container" style="--aspect-ratio:412/618;">
<div class="_d81be3e page-fullbleed-area">
<div class="page-safe-area">
<amp-story-interactive-quiz
id="quiz-1" class="center"
prompt-text="Who won the first soccer world cup?"
endpoint="https://amp.dev/documentation/examples/components/amp-story-interactive-poll/results"
prompt-size="large" chip-style="transparent"
option-1-text="Spain"
option-2-text="Brazil"
option-3-text="Uruguay" option-3-correct option-3-confetti="⚽"
option-4-text="Germany"
correct-option="3"
explanation-text="Uruguay won the first soccer world cup." >
</amp-story-interactive-quiz>
</div>
</div>
</amp-story-grid-layer>
</amp-story-page>
I have already added following code in head
<script async custom-element="amp-story-interactive" src="https://cdn.ampproject.org/v0/amp-story-interactive-0.1.js"></script>
<style amp-custom>
.center {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 22em;
font-size: 0.23em;
}
#quiz-1 {
--interactive-prompt-text-color: rgb(112, 238, 96);
--interactive-accent-color: green;
}
</style>
I would recommend checking the documentation & examples there to see if you've missed something.
Then, I'd recommend testing in AMP playground or on a static web story to see if it works there. This way you can identify whether it's an issue with your quiz code or how you've added it to the plugin.
If the quiz is not appearing when adding it to the plugin's output, it might be that the AMP sanitization logic in the plugin has removed some of your code because it's invalid AMP.
As a starting point, here's how I've added an interactive quiz component to a story coming from the plugin in the past: