• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 16. Building a Quiz with Componen... > Catching Errors and Using the Messag...

Catching Errors and Using the Messagebox Component to Display Them

Depending on how much experimentation you did when you tested the movie at the end of the last task, you may have noticed that you can progress all the way through the movie without making any selections. Allowing the user to progress without making a choice is not good for a couple reasons. First, there is no back button, so the user has no way of returning to fill in a skipped question. Second, the quiz is scored based on selection of the correct answer. Not selecting an answer will result in the question being marked as incorrect.

You need to create a mechanism that forces the user to respond to the question before continuing. You've already done something like this in Lesson 7. At the time, you used an if…else setup to determine whether the user entered the correct answers. Here, you'll do much the same thing, except you'll check to make sure the user entered any answer (as opposed to the correct one).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint