Drag-And-Drop Demo Experiment Run Experiment


Jaap Murre

If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.

It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.

The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.

var score, a, b, c, 
    right = 0, 
    wrong = 0, 
    t = now(), 
    rt = 0;

score = main.addblock("right","bottom",30,20);       

a = main.addblock("center","top",100,25)

Simple mouse test

Drag the green block to the grey area. Press any key to stop."); c = main.addblock("center",30,23,23,"lightgrey"); b = main.addblock("center",70,20,20,"green","","dragged"); b.moveable(); b.on("mousedown",function(event){ // event.preventDefault(); console.log("Mousedown"); }); b.on("mouseup",function() { console.log("Mouseup"); var bs = b.getshape(true), // add true to force recalculation of top etc. cs = c.getshape(); rt += now() - t; if (bs.left >= cs.left && bs.top >= cs.top && (bs.left + bs.width) <= (cs.left + cs.width) && (bs.top + bs.height) <= (cs.top + cs.height)) { a.text("


"); ++right; } else { a.text("


"); ++wrong; } await(1000); b.animate("opacity",1,0,500); b.style("left","40%"); b.style("top","70%"); b.animate("opacity",0,1,500); a.text("Drag the green block to the grey area"); score.text("" + right + "/" + (right+wrong) + " " + (rt/(right+wrong)).toFixed(0) + " ms"); t = now(); }); await("keydown");
This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type