Page 1 of 1

What am I doing wrong here?

Posted: Wed Apr 24, 2013 6:32 am
by shawnblc
What am I doing wrong here?

Code: Select all


on mouseUp
   if grpA1 = correctAnswer then
  add 5 to field "fldCorrect"
else
   add 5 to field "fldWrong"
   end if
end mouseUp


Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 6:36 am
by Simon
Need to know what grpA1 and correctAnswer is.
Otherwise it's perfect. :D


Simon

Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 6:42 am
by shawnblc

Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 7:06 am
by Simon
Button Next:

Code: Select all

global gScore,correctAnswer
on mouseUp
   put the hilitedButtonName of group "grpA1" into gScore
   put 2 into correctAnswer
   go next
end mouseUp
Button Grade Quiz

Code: Select all

global gScore,correctAnswer
on mouseUp
   if gScore = correctAnswer then
  add 5 to field "fldCorrect"
else
   add 5 to field "fldWrong"
   end if
end mouseUp
Ok, so you have to store information somewhere that is what the globals are for. correctAnswer and gScore must be filled before you do a comparison. (if gScore = correctAnswer then)

I suggest you go through the video's here:
http://runrev.com/developers/documentat ... rs-course/

Have Fun!
Simon

Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 7:09 am
by shawnblc
Ah, I think I understand what you're saying. I'll give it another whirl and continue my LC education. It's a rather slow process for me.

Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 3:17 pm
by Randy Hengst
I'd be happy to take a look, too. But the link to your stack didn't work.

be well,
randy

Re: What am I doing wrong here?

Posted: Wed Apr 24, 2013 5:43 pm
by shawnblc
Randy Hengst wrote:I'd be happy to take a look, too. But the link to your stack didn't work.

be well,
randy
Simon's input helped greatly.

I took the stack down, will update it later.