Hey guys just getting going programming...

Working on my test application....because of my limited knowledge I am starting really simple.


var Question1 = ("This is the first question.")

var Question2 = ("This is the second question.")

var Question3 = ("This is the third question")

var Question4 = ("This is the fourth question")


var Answer1 = True

var Answer2 = False



So I have a data matrx for my questions, then one for my answers.


I need to compare the answers to the questions...


any advice?


I'm after I randomly generate the question how do I compare to the answers?


It's like I need to get the numbers from my question variables to match up to my answer variables?
Just a noob tryiing to figure it out one line at a time. Shalom./

Replies

You should change the syntax, getting rid of parenthesis


var Question1 = "This is the first question."


Then, instead of data matrix, it would be better to define struct, holding the question and its answer.


May have a look at this other thread with similar question:

https://forums.developer.apple.com/thread/119020

Thanks for teaching me the proper terminology. Shalom.

If this is just a true/false quiz, you're not working with variables. You're just testing to see if 'True' or 'False' is true, not assigning a variable or constant. Your check is binary...the user's selection is either true or it isn't.


This of course differs if you have multiple choice, but that's not your question.