I'm creating a multiple choice quiz with 3 responses in which I want the user to receive a specific response for each correct answer and for each incorrect choice. I can make the quiz work for the correct response and the first incorrect response. But the second incorrect response defaults to the first incorrect response. How can I code the if/then blocks to pick up each incorrect response? Or is there a better way to do this?
Different ways to use conditional statements are discussed in Programming Your App to Make Decisions , The link may help you solve your coding issue.
Perhaps Vivian. However no one can provide specific advice without seeing a sample of your code. It is unclear what you mean by
You need a way to encode and decode a file with questions, answers, responses to answers, and scores for answers. You don't want to hard code those into blocks. Here is a sample test file for you to start:
Q1,"What is the square root of 4?"
Q1A1,16,0,"No, 16 is the square of 4. You get 0 points."
Q1A2,2,1,"Correct, 2 is a square root of 4. You get 1 point"
Q1A3,"2 and -2",2,"Excellent, you found both square roots of 4"
Q2,"What Greek letter is most used when working with circles?"
Q2A1,"Pie",0,"No, you must be hungry."
Q2A2,"e",0,"Sorry, that's for logarithms"
Q2A3,"Pi",1,"Correct!. Pi is the ratio of a circle's circumference to its diameter."
Column 1 of this Comma Separated Values (CSV) table is a unique key that you can build up with the text JOIN block and your current question and answer numbers. Use that unique key with the lookup in pairs list block to look up questions and answers from the table.
I added a score column (column 3) to allow multiple correct answers of varying value.
This design allows you to reuse the same screen components for different questions and answers.
Thanks, Steve, for your help. I'm re-reading that chapter now.
Thanks, ABG. Your code is a bit beyond my understanding, but I'm working at it. Really appreciate the help.
for another quiz sample.