Hi all,
I posted it earlier but could not get it to work. I am creating a random
Answers to a question. But my problem is it works only if it is a 1 line
answers. My problem is that my answers are on 2 lines. What can be done to
make it work on multiple line answers.
Here is a sample of what my answers look. These should be randomly
Displayed.
A. This is a answer that will fit on 2 lines and
has to work.
B. Line 2 of answer
C. Line 3 of answer
D. Line 4 of answer which also can be on 2 or
more lines.
Here is the code!! It works if the answers are on 1 line.
property mySp, correctAnswer
on beginSprite me
mySp = sprite(me.spriteNum)
set the lineHeight of field "q1answer" to 30
correctLine = 1
sendAllSprites(#mixUpLines, correctLine)
end
on mixUpLines me, correctLine
correctAnswer = "Lima"
answerList = []
repeat with n = 1 to mySp.member.lineCount
randomNum = random(answerList.count+1)
addAt answerList, randomNum, mySp.member.line[n]
end repeat
newText = EMPTY
repeat with n = 1 to answerList.count
put answerList[n] after newText
if n < answerList.count then put RETURN after newText
end repeat
mySp.member.text = newText
end
on mouseUp me
if mySp.member.line[the mouseLine] = correctAnswer then
alert "Correct!"
else
alert "You should have picked"&"E&correctAnswer"E
end if
end
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]