Join Keith Gilbert for an in-depth discussion in this video Create a multiple choice quiz, part of InDesign: Fixed-Layout EPUB Interactive Techniques & Publish Online.
- Quizzes can be a fun way to encourage users to interact with your content. They give the user a chance to test their comprehension, or they can just be a fun way to summarize your material. We're going to start with a multiple choice quiz. We want the user to tap one of the multiple choice answers, then if it's correct, they get a green checkmark. If the answer is incorrect, they get a red X. This effect can be accomplished with a series of two state multi-state objects. In the exercise files folder, open 04_01 quiz begin, and begin by drawing a clear frame over the region that you want to be tappable for the first answer.
And I suggest you make the frame about the same height as the gray box and include the actual text of the answer. So if somebody might actually tap on the more than $102 text rather than tapping on the gray box, it would still work in this case. Then select that frame and the red X and create a multi-state object out of that. Name the multi-state object Answer 1, and name the first state start, and the next state end.
Select the start date, and we want to make it so that when somebody taps on this state, they are taken to the next state, or the end state. So on this start state, double click on the rectangle to get the clear frame selected within that state, and choose a button action. And the action should be Go To Next State. Now before we repeat this throughout the quiz, we should preview that to make sure that we got it right. So go to your EPUB Interactivity Preview panel, click the play button, and click on the first answer, and the red X should appear.
Now if you click again, nothing happens because there's no button set up in that state to do anything, and that's just fine. So now that we have that right, we want to step and repeat this object throughout the rest of the quiz. To make this a little bit easier, I would suggest that you select the parent multi-state object, select the end state to make sure that the red X is displayed, and then hit the Escape key a few times to back up and get the parent selected again. So I want to have the parent MSO selected, but I want the X to display to make our life easier for the next steps.
And then to generate some duplicates of this, just go to Edit, Step and Repeat, and we want to make 13 Duplicates, Offset 46 pixels vertical, zero horizontal. Now if you select one of these MSOs that were generated, you'll see that it's nicely numbered. So I selected this one that says that's named Answer 3, and I select this one, it's answer nine. InDesign does a sweet job of taking whatever you gave the MSO for the name and appending a number on it.
If your initial name ends with a number like ours did, we named it Answer 1, then it just continues that numbering scheme, Answer 2, Answer 3, et cetera. That's pretty handy, and we're going to see that that's important in the last step of this exercise. So now you want to move these answers into position, and I'm going to grab the bottom two MSOs from this step and repeat list and just drag them over onto this last true and false, and position those about where they should go.
Then I'm going to grab the bottom four, position those up here like so, and then repeat the process to get all of them into position the way that I want them. That looks good. Now we're in pretty good shape here. The trouble is all the answers are wrong. We want to find the ones that are right and make those work with a green checkmark instead of the red X. On this first multiple choice question, the top answer is actually the correct one. Select the green checkmark that's off here on the side, copy that to the clipboard, command or control C, then select this first multi-state object.
Select the end state and choose the paste into state icon down in the bottom right corner of the object states panel. That will paste the green checkmark into the state that I had selected, the end state. So now I have the green checkmark and the red X. So now over here in the Layers panel, I'm going to flip open Answer 1, flip open end, and I can find the other path in that end state, which is the red X. Select that and then hit the Delete key to delete the X out of there.
So now I've provided the correct icon for the correct answer. So now we just need to repeat that for the other questions. On the second question, the third answer is right, so I'm going to select that multi-state object, select the end state, click on the paste into state icon, locate that over in my Layers panel, flip that open, select the red X path, hit the Delete key, and then just repeat that for the other three questions.
Once you've completed that, now would be a good time to check your work. Go back to your EPUB Interactivity Preview panel, click the play button, and test to make sure this works as expected. We have one more thing we want to add here however. I'd like to add a Start Over button so that when somebody taps Start Over, all the icons are cleared off the quiz. So close the panel. You can actually delete this extra green check mark if you'd like. Then draw a clear frame over the Start Over artwork.
We want to choose an action for that button, and it should be the Go To State action, and we want to go to the start state of Answer 1. So it's going to look at the Answer 1 MSO, and it's going to change that back to its start state. And then we need to add a second action. So we again choose Go To State, and this needs to also go to the start state, but the start state of Answer 2. Then we add yet another Go To State action, and that one should be Answer 3.
This is why it's nice that it automatically numbers things correctly because I can just look down this column here and see whether I've got each one. So when you're finished when you've added one for every answer, it should say Answer 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, et cetera. Once you've got all those in there, then preview your work, and you should see that the Start Over button clears out all of the answers once you tap on it. Using this method, the user can look back at their results and see how many incorrect attempts they made before they get the correct answer.
If you want to get really fancy, the second state for each answer could contain another box with more descriptive information about why the answer is right or wrong.
- Creating animated navigation buttons
- Building interactive slideshows
- Creating reveal buttons
- Adding multiple choice and branching quizzes
- Creating a scrolling panorama
- Embedding video
- Creating buttons to send email