Reply To: DragDrop features

PennController for IBEX Forums Support DragDrop features Reply To: DragDrop features

#8413
mwf2120
Participant

Hi! I am relatively new to Pcibex and am trying to do the following: log coordinate location of images (between 2 and 5 depending on set randomization) that are dragged and dropped to another canvas. The figures (images) can be placed anywhere and in any order on the new canvas. I’d really like to record x and y coordinates where participants place each figure. I’ve been able to implement the drag and drop approach, and to collect coordinate data for clicks, but coordinate data collection fails when I try to drag and drop (probably because the images are “clicked” in one place and “unclicked” in another). Is there a better way to do this? Thanks so much!

Drag and drop sample approach:

newTrial(“Set_2”,
newCanvas(“figlist”, “72vw”,”58vh”)
.css(“padding”,”1em”)
.color(“lightgray”)
.print(“left at 5vw”, “middle at 50vh”)
,
newCanvas(“grid”, “72vw”, “58vh”)
.css(“padding”, “1em”)
.color(“yellow”)
.print(“left at 20vw”, “middle at 50vh”)
,
newSelector(“figures”)
,
newImage(“man”, “man_small.png”).selector(“figures”).print(getCanvas(“figlist”)),
newImage(“boy”, “boy_small.png”).selector(“figures”).print(getCanvas(“figlist”))
,
getSelector(“figures”).shuffle()
.log()
,
newDragDrop(“dd”)
.addDrag(getImage(“man”))
.addDrag(getImage(“boy”))
.addDrop(getCanvas(“figlist”))
.log()
,
newTimer(5000).start()
.wait()
)

Thanks for any help!