PDA

View Full Version : How to: Drag and Drop excercise


narafir
10-19-2008, 09:20 AM
Hello, I am new to Autoplay. I have the following question:

Is it possible to create drag and drop excercises, and if yes how?

For example, let's say that i need to create the following excercise:

Drag and drop the following words to create a proper sentence:

excercise?, can, How, create, i, this,

Then the user should create this sentence to proceed:
How can i create this excercise?

Thank you!

RizlaUK
10-19-2008, 10:39 AM
http://www.indigorose.com/forums/showthread.php?t=13057&highlight=drag+drop

narafir
10-19-2008, 10:44 AM
Thank you for your answer, I have already seen this thread. This takes me halfway, I was wondering how I can test if the user "drops" the item at the right place. Should I create placeholders and work on the OnLeave by testing the X and Y values?? Any ideas??

Great sign btw :)

screwed over
10-19-2008, 11:02 AM
im not sure who wrote it (i think it was worm) anyway, there's an "isinRect" function somewhere on the forums that should help you with detecting if its in the right place.

Centauri Soldier
10-19-2008, 12:02 PM
Welcome to AMS. I have thrown together a sample of the type of program I think that you're looking for.

I used an xml file for the sentence storage and retrieval system. The properties table for the paragraph objects can be altered but I would advise against changing the Width as it set up to correspond with the length of the words dynamically.

The code is basic and mostly uncommented but it works. On the On Mouse Move event on page one you'll find some code that remembers object placement coordinates. I'll leave it to you to figure out how to compare that data and apply it.

i did not proceed any farther because...
1. I don't want to spend anymore time on it today.
2. If worm has already created a function for this unfinished part then that will most likely work as worm is really good at this code thing.
3. I didn't want to have all the fun...I'm sure you want to get your hands dirty;).

I hope this helps and again, welcome to AMS.