Currently I am making a little quiz in Scratch, and I'm having trouble with the answer selection. Let me summarize as non-confusingly as I can: There's a little intro in the beginning when I explain how the quiz works, but I don't think that has anything to do with my problem. Anyway, once the instructions are finished, the Scratchcat comes out and starts asking questions. Right now, I only have the first question programmed to be answered, and I've found a problem with when you try to click on an answer. Allow me to elaborate. There are twelve questions total, with four answer choices per question: choice A, B, C, and D. Whenever one of the answers is chosen, the corresponding Choice variable would switch to "true" for .05 seconds, and then revert back to "false" (basically, if I chose answer B, it would set variable B true for a short period, and then false again). Here's how the question-answer thing works: the Scratchcat will ask a question using the "say" script like this:
repeat until <(Question#) = [12]> say (QuestionString) wait until <<(A) = [true]> or <<(B) = [true]> or <<(C) = [true]> or <(D) = [true]>>>> wait (0.1) secs //this may be superfluous change [Question# v] by [1]...and just so you know, I've made it like this only because I don't want to have a long script going like "if the question# is 3, say this, if the question# is 4, say this..." ...et cetera. The stage changes the QuestionString to match the Question#. That isn't the problem. The problem is that when I testrun the program and select answer A (because that's the only choice I've programmed yet), it cycles through the rest of the A answers, as well as the questions, until it's at the last question and the program is done. What? I clicked it once and then it auto-selects my answers for me! It's weird, I can't figure out why that is. Anyway, there are two scripts that I think may be wrong somewhere and therefore causing the bug: the script I posted above, and the script I posted just below this paragraph. (The first one is from the Scratchcat - aka, the asker- and the one below is from choice A, which is one of the answers)
when [A] clicked forever if <(A) = [false]> if <(Question#) = [1]> change [Result 1 v] by [1]//this is what effects quiz results, prob. doesn't matter end if <(Question#) = [2]> change [Result 2 v] by [1]//same as above, this goes on 'til Question#=12 end set [A v] to [true] wait [0.05] secs set [A v] to [false]If you need an example of the bug (believe me, I am not very good at explaining things, so this may be the case), I am going to upload a test project that shows you what I mean. XP
Offline
You didn't need that huge text wall and you also didn't need to post your project. Anyway, the problem I see is that you put a forever block in answer A and that's probably what's causing all of this. Remove it and your project should work better.
I hope that this helps!
Last edited by ErnieParke (2012-10-30 15:39:41)
Offline
ErnieParke wrote:
You didn't need that huge text wall and you also didn't need to post your project. Anyway, the problem I see is that you put a forever block in answer A and that's probably what's causing all of this. Remove it and your project should work better.
I hope that this helps!
You get a cookie. For being so darn smart. :P
Thank you so much!
Offline