Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Help ASAP (http://www.alice.org/community/showthread.php?t=11983)

JMoney 05-16-2018 08:23 AM

Help ASAP
 
1 Attachment(s)
Good Morning! I'm finished my work in regards to what I'm doing (creating an interactive trivia game); however, I want to make the game work by creating a method or function that says when the user clicks on the correct answer, the program will say "Correct Answer" and when it is the wrong answer, it will say "Incorrect Answer". I've been trying to figure it out for DAYS and I'm so tired of working on it to the point where I need some help not because I don't know how to do it, but because I need some guidance on how to get this right. Once I get the correct/incorrect method going, I can finish what I want to do by putting in directions and doing a textual storyboard. Can any of you experts help me? Thanks! All I want is directions/guidance on how to put in a method that tells Alice that when you select the correct box, the program says correct to the user and verbatim for incorrect.

- JMoney

chickentree 05-17-2018 04:05 PM

1 Attachment(s)
[QUOTE=JMoney;58024]Good Morning! I'm finished my work in regards to what I'm doing (creating an interactive trivia game); however, I want to make the game work by creating a method or function that says when the user clicks on the correct answer, the program will say "Correct Answer" and when it is the wrong answer, it will say "Incorrect Answer". I've been trying to figure it out for DAYS and I'm so tired of working on it to the point where I need some help not because I don't know how to do it, but because I need some guidance on how to get this right. Once I get the correct/incorrect method going, I can finish what I want to do by putting in directions and doing a textual storyboard. Can any of you experts help me? Thanks! All I want is directions/guidance on how to put in a method that tells Alice that when you select the correct box, the program says correct to the user and verbatim for incorrect.

- JMoney[/QUOTE]

OKay, First I changed the colors to match their labels and arranged the objects so I could see what was going on.
Next I changed the events to pass a string based on which "square" was clicked.
Then I wrote a function that compared that string to the "activeAns" string to see if it was correct.
All this seems to work OK now for one question, which I think is what you were asking for.
Mark


All times are GMT -5. The time now is 08:55 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.