I made a multiple choice math test for my daughter the other day.
My technique was quick and dirty:
four buttons, one or more randomly has the correct answer
if she clicks the wrong button the "wrong" score increases and the wrong button vanishes.
if she clicks the right answer then it is revealed in a field, the right score increases, and the continue button is presented for access to the next question.
You wouldn't want something so obvious for post secondary.
Instead you would have radio buttons, and the score would be tabulated after a final "Finish" or "next" button is pressed.
You would probably want to build an array, the data of each key would be single line items for:
Question
Score Value
Correct Answer
wrong answer 1
wrong answer 2
humorous trick answer
When the card, or stack is loaded you would retrieve a key of the array (for the page of the test for instance),
put the question into a field, maybe show the score value or not in another field.
Then randomize which button gets labeled with which line of answers.
So it is not predictable, and harder to cheat with a crib sheet of numbers or dots
When the "next" or "Finish" button is pressed then poll through
all the questions, if a button with the wrong answer is hilited then move to the next question, if the correct button
is hilited then add the value to the finalscore property/variable.
I believe your radio buttons should be in a group that has its "radioBehavior" set to to true so that only one answer can be picked in a set.
Does this help any? Should I post the stack created by a six year old?
For drag and drop do this, it generally works, in any object.
Code: Select all
on MouseDown
set the lastClick of me to the mouseloc --xy of the mouse
send dragme to me in 300 milliseconds
end MouseDown
on dragMe
if the mouseloc <> the lastclick of me and the mouseloc is within the rect of me then set the loc of me to the mouseloc
if the mouse is down then send dragme to me in 300 milliseconds
else dropMe
end dragMe
on dropMe
put the loc of me -- -- location of the object goes to the message box just to see it work
-- here you could do all sorts of checking to see where the object landed and act on that
end dropMe
mouseDown is a rev command, dragme, and dropme are handlers I made up on the fly.
There may be better ways to do this but this is whats worked for me quickly any time I need to do it.
You could also :
Code: Select all
popup fld "somefield" at the mouseloc
send dragme to fld "somefield"
to make it appear the user picked up some data from text
and have the dragme and dropme scripts inside that object.
Try this stuff out, it should get you on the path.