Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking a multiple drag and drop problem

Status
Not open for further replies.

waleo

Technical User
Jan 25, 2005
1
0
0
GB
Hi, I'm working on a CD-ROM project and I have a problem. I need to create a drag and drop activity where the user drags multiple statements into one of two areas. The interaction will then judge this right or wrong. I can do this when each statement has a unique area to be dragged to (using the parent/child number idea). But I just don't have the knowledge to do a grouped verson (E.g Tags 1 and 3 to area 1, tags 2 and 4 to area 2). I have been told that the answer lies in building a linear list, but if anybody has the time could they respond telling me (step by step) where to put icons, variables etc. Thanks.
 
Here's a way to do it without using lists.

1. in a calculation icon at the beginning of the flowline set up a variable for the total correct. eg,

_correct := 0

2. Set up the display icons (Tag1, Tag2, Tag3, Tag4) and target area responses with a calculation icon (in your case Area01 and Area02)

3. For the Area01 response calculation icon attach the following script;

if ObjectMoved = "Tag1" then
_correct := _correct + 1
end if
if ObjectMoved = "Tag3" then
_correct := _correct + 1
end if
Movable@ObjectMoved := FALSE

4. do the same with the Area02 response. (theres probably a better way to script this but I couldn't get the "or" operator (|) to work properly.)

I added the movable@ObjectMoved := false command to prevent the user from dragging the same object in and out and racking up the _correct variable, once the answers in there, it'll stay in there. I would add a reset button to navigate to the beginning of the flowline to let the users change their answers.

You may want to add a target area response after the area01 and area02 repsonses that covers the entire screen and is set to "On Drop" - Put Back.

To evaluate just look at the _correct variable and ensure that it equals the total of possible correct answers

Theres other ways to do this if you want the functionality to be a little different(eg. having the object be freely moved until the answer is evaluated, or storing the answers in a propertlist), but they are more complicated to setup, post if you want another example.

Hope this helps
 
A better way of writing the if/then statement, in this case, is using the Test Function.

Test(ObjectMoved = "Tag2" | = "Tag4", _correct := _correct + 1)
Movable@ObjectMoved := FALSE


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top