Coding Help Family Feud Game

Good morning,

My student is trying to create a Family Feud like game where the user can enter the answer and the text input turns green after it checks and determines the correct answer has been chosen.

I’m not sure if text inputs are able to do this or if data sets are the correct way to go either.

Any advice is appreciated.

Johnna Costanza


I don’t think the text input itself can change colors as it is just designed to allow a user to input text. You could take the input and store it as a variable and then output it to a different element in the color you desire. You may even be able to superimpose it over the input box to make it look like the original text turned green, but I haven’t done that and would have to play around with it.

Easier might be to make a green indicator pop up after the user types it in and clicks on a button to verify the answers. There are a lot of directions you could take this, but if your student starts trying one and has problems, check back in with us and we can try and help. To this point, I don’t see that they’ve started down any path to check the answers and/or indicate which ones are correct yet or not.

In regards to data sets, it would be a little more complex, but could save time if they plan on adding more than the basic three questions that are there now. If they just plan on having those three questions, it may be easier to hard code the checks, but adding a database would give them a lot more flexibility to change answers.

If this is a student in CS Discoveries, either way, they are doing more than the CSD curriculum teaches and expects, so kudos to them!