Join Keith Gilbert for an in-depth discussion in this video Create a branching quiz, part of InDesign: Fixed-Layout EPUB Interactive Techniques & Publish Online.
- Another interesting way to present complex information is to ask the user a series of interview-style questions, and then present custom results based on those questions. This can be done with a single multi-state object controlled by buttons. Like most interaction, the key to making this work is proper planning. It's useful to sketch out your questions as a branching flow chart before you begin working in InDesign. Here's the sketch I drew up of what I'm trying to accomplish. This sketch is a quick way for me to discover that I'm going to need an eight-state multi-state object.
We will need one state for each of the seven questions, plus another state that hides the quiz. This sketch also tells me that I'm able to pull this off entirely with yes or no questions. While you can ask other types of questions, this is far less confusing to create if all the questions are yes or no. In the Exercise Files folder, open 04_02_quiz_begin. If you look on the Layers panel and flip open the MSO layer, you'll see that I've created eight layers here, and only the start layer is visible.
But if you display the own equipment layer, you'll see that that has a bunch of artwork on it. And look at a few of the layers, and you'll discover that each object on a layer is a group of objects, and I've named each group within this layer something that makes sense. You're going to find that these names are really important. Whatever system you come up with is going to really help you navigate around setting up the buttons later on. The first thing we want to do is display all of these objects, and then select the start object and shift-click to select each of the other groups on the MSO layer.
Once you've got everything selected, go ahead and make a multi-state object out of those. And you'll see in the Object States panel that each of the states was named after the group name that was in the Layers panel. That's pretty handy. So that we can see all of our states at once, so we don't have to do so much scrolling around, I'm going to go up to the Object States panel menu, choose Panel Options, and tell it that I don't care about seeing thumbnails. That way I can see all of the states at once in the small space that I've got.
I'm going to name the multi-state object as quiz mso, and then State 1, I'm going to rename as hidden. And then if you click through the states, you should see the thing starting to take shape here a little bit. Now we need to start wiring up some of the buttons to help us move from state to state. I'm going to go to the own equipment state, and we're going to wire up the yes or no buttons here. Now this is where being familiar with your subject matter, and having your sketch in front of you, really helps.
Without any of that, it's pretty confusing. In this movie, I'm only going to wire up the no side of this branch, just so we don't have to do quite so many buttons. So I'm going to select this frame that's over the NO icon, and we want to wire this up with a Go To State action, and it's going to go to a state, the quiz mso, and the state that we want it to go to is the one that says own no, asset on balance sheet.
And then I'm going to hit the "Esc" key a few times to climb back up and get the parent MSO selected, and I'm going to go to the own no, asset on balance sheet state, and I'm going to set up the yes and no here. So I'm going to select the YES frame, and that's also going to go to a state, and that's going to go to the result finance lease state. And then I'm going to select the NO frame, and set that up with a Go To State, and that's going to go to the result operating lease.
I'm going to go back to the parent MSO again, and I'm go down to the result finance lease state, and wire up this RETURN TO START button. Double-click on that, do a Go To State, and tell it that that should go to the own equipment state. In other words, go back to the first question. And I need to go back up to the parent MSO and do the same thing on the operating lease state. We're going to Go To State, and that's going to go to the own equipment also.
Now all that's left is I need to wire up these close boxes in the upper right-hand corner. We want a button there that will allow the user just to dismiss the quiz entirely, no matter where they are within the quiz. So I'm going to do that first on this operating lease box, so I'll just double-click, and that should be a Go To State action that goes to the hidden state. In other words, none of these states being visible at all. Go back to the parent MSO, do the same thing to the result finance lease, select the frame, Go To State, hidden.
Go back to the parent, need to do the same one on own no asset on balance sheet, select that, Go To State, hidden. And then finally, on the own your equipment state, I just select the frame here, Go To State, hidden. There we go. So I've just wired up, kind of, the right-hand side of the original tree in my original sketch. You can do the left half of the tree on your own.
And then I'm going to preview this in my EPUB Interactivity Preview panel. And as long as I answer "no" for the first question, this should function. But looks like I made a mistake. I didn't wire up the very first button, so I can't even get into the multi-state object. So let's take a look at that. So I need to go to the hidden state, and this is what I forgot. I forgot to wire up the first button. So I'm going to double-click to select this frame within that state, and this one needs to Go To State, and just go to the first question, the one that asks whether you want to own equipment or not.
Now if I preview this, it should work. So if I click on the red button, it takes me to the first question. As long as I answer "no" to this question, it goes to the right side of the decision tree, and everything should work fine. So I'm going to say "no", and then I can answer either "yes" or "no" here, and it comes down to giving me the advice. I can return to the start. I can go through it with some different questions. I can test this close box up here to make sure it dismisses.
Looks like everything's functioning properly. So it's kind of complicated in the sense that you've got to keep this entire flow chart in your head. Again, having that on paper in front of you is really helpful. But at least all of the buttons are wired up exactly the same. They all have a Go To State action, and then they just go to the proper state. So the only mistake you can really make is choosing the wrong state from this list right here. This technique can become quite time consuming if you have too many levels of branching, but the finished effect is quite nice, and will no doubt inspire your reader to spend some time with your content, and that's what it's all about.
- 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