Drag and drop question, help needed


Author
Message
wuaham
wuaham
Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)
Group: Forum Members
Posts: 21, Visits: 109
Christmas is knocking at the door, I am still in trouble, no clue:
1. I wish to randomly display some text (implemented in the script below)
2. Drag and drop each text far away from the center (based on some criteria, basically on any directions - up, down, right, left or whereever)
3. If all texts are moved (or at least touched/clicked to move), text color will change (say white to red) and a Next button will appear (sorry - not implemented) at the bottom of the screen
4. On the next screen, all moved items will remain on the same locations where they were moved earlier and now a final chance will be given to adjust all moves (if participant wish to)
5. If happy on the adjusted positions then click Next
6. Location (x, y in %) of each text along with text name will be saved in the data file
7. Repeat for 3 times and save data on every repetition.

In Inquisit-6 (latest version) on an online experiment, is this something possible please?

Your help will be highly appreciated!

Current texts are hypothetical such as A, B, C D... it could potentially be words/sentences/images (currently only 6, can be more).

Any questions please let me know.

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text D>
/ items = ("D")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text E>
/ items = ("E")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text F>
/ items = ("F")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text centre>
/ items = ("Centre")
/ position = (50%, 50%)
/ size = (20%,20%)
/ txcolor = red
</text>

<counter faceXpos_grid>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter faceYpos_grid>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial example>
/ inputdevice = mouse
/ stimulustimes = [0=clearscreen, centre, text.A, text.B, text.C, text.D, text.E, text.F]
/ validresponse = (anyresponse)
/ ontrialend = [reset(counter.faceXpos_grid),reset(counter.faceYpos_grid);]
/ recorddata = false
</trial>

<block exampleblock>
/ trials = [1-3=example]
/ recorddata = false
</block>

===== End ==========================



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 89K
wuaham - 12/19/2022
Christmas is knocking at the door, I am still in trouble, no clue:
1. I wish to randomly display some text (implemented in the script below)
2. Drag and drop each text far away from the center (based on some criteria, basically on any directions - up, down, right, left or whereever)
3. If all texts are moved (or at least touched/clicked to move), text color will change (say white to red) and a Next button will appear (sorry - not implemented) at the bottom of the screen
4. On the next screen, all moved items will remain on the same locations where they were moved earlier and now a final chance will be given to adjust all moves (if participant wish to)
5. If happy on the adjusted positions then click Next
6. Location (x, y in %) of each text along with text name will be saved in the data file
7. Repeat for 3 times and save data on every repetition.

In Inquisit-6 (latest version) on an online experiment, is this something possible please?

Your help will be highly appreciated!

Current texts are hypothetical such as A, B, C D... it could potentially be words/sentences/images (currently only 6, can be more).

Any questions please let me know.

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text D>
/ items = ("D")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text E>
/ items = ("E")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text F>
/ items = ("F")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text centre>
/ items = ("Centre")
/ position = (50%, 50%)
/ size = (20%,20%)
/ txcolor = red
</text>

<counter faceXpos_grid>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter faceYpos_grid>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial example>
/ inputdevice = mouse
/ stimulustimes = [0=clearscreen, centre, text.A, text.B, text.C, text.D, text.E, text.F]
/ validresponse = (anyresponse)
/ ontrialend = [reset(counter.faceXpos_grid),reset(counter.faceYpos_grid);]
/ recorddata = false
</trial>

<block exampleblock>
/ trials = [1-3=example]
/ recorddata = false
</block>

===== End ==========================



Sorry, I'm confused. I cannot find any drag and drop mechanincs implemented at all in the snippet you posted. Also, "far away from the center (based on some criteria" is so vague as to be inactionable -- so what's the criterion supposed to be?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 89K
Dave - 12/19/2022
wuaham - 12/19/2022
Christmas is knocking at the door, I am still in trouble, no clue:
1. I wish to randomly display some text (implemented in the script below)
2. Drag and drop each text far away from the center (based on some criteria, basically on any directions - up, down, right, left or whereever)
3. If all texts are moved (or at least touched/clicked to move), text color will change (say white to red) and a Next button will appear (sorry - not implemented) at the bottom of the screen
4. On the next screen, all moved items will remain on the same locations where they were moved earlier and now a final chance will be given to adjust all moves (if participant wish to)
5. If happy on the adjusted positions then click Next
6. Location (x, y in %) of each text along with text name will be saved in the data file
7. Repeat for 3 times and save data on every repetition.

In Inquisit-6 (latest version) on an online experiment, is this something possible please?

Your help will be highly appreciated!

Current texts are hypothetical such as A, B, C D... it could potentially be words/sentences/images (currently only 6, can be more).

Any questions please let me know.

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text D>
/ items = ("D")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text E>
/ items = ("E")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text F>
/ items = ("F")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text centre>
/ items = ("Centre")
/ position = (50%, 50%)
/ size = (20%,20%)
/ txcolor = red
</text>

<counter faceXpos_grid>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter faceYpos_grid>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial example>
/ inputdevice = mouse
/ stimulustimes = [0=clearscreen, centre, text.A, text.B, text.C, text.D, text.E, text.F]
/ validresponse = (anyresponse)
/ ontrialend = [reset(counter.faceXpos_grid),reset(counter.faceYpos_grid);]
/ recorddata = false
</trial>

<block exampleblock>
/ trials = [1-3=example]
/ recorddata = false
</block>

===== End ==========================



Sorry, I'm confused. I cannot find any drag and drop mechanincs implemented at all in the snippet you posted. Also, "far away from the center (based on some criteria" is so vague as to be inactionable -- so what's the criterion supposed to be?

Anyway, save for the ill-defined and thus inactionable "far away from the center" criterion, here's an example that should give you the general idea:

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<shape bg>
/ shape = rectangle
/ color = white
/ size = (100%, 100%)
/ droptarget = true
/ dropposition = (anywhere, anywhere)
/ erase = false
</shape>

<text centre>
/ items = ("+")
/ position = (50%, 50%)
/ size = (20%,20%)
/ vjustify = center
/ txcolor = red
/ erase = false
</text>

<button nextbutton>
/ caption = "NEXT"
/ position = (50%, 90%)
/ size = (8%, 4%)
/ erase = false
</button>

<list x>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ selectionrate = always
</list>

<list y>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ selectionrate = always
</list>

<values>
/ round = 0

/ ax_start = 0%
/ ay_start = 0%
/ bx_start = 0%
/ by_start = 0%
/ cx_start = 0%
/ cy_start = 0%

/ ax_end = 0%
/ ay_end = 0%
/ bx_end = 0%
/ by_end = 0%
/ cx_end = 0%
/ cy_end = 0%

/ amoved = false
/ bmoved = false
/ cmoved = false
</values>


<trial start>
/ ontrialbegin = [
    list.x.reset();
    list.y.reset();
    values.round += 1;
    text.A.hposition = list.x.nextvalue;
    text.A.vposition = list.y.nextvalue;
    text.B.hposition = list.x.nextvalue;
    text.B.vposition = list.y.nextvalue;
    text.C.hposition = list.x.nextvalue;
    text.C.vposition = list.y.nextvalue;
    values.ax_start = text.A.xpct;
    values.ay_start = text.A.ypct;
    values.bx_start = text.B.xpct;
    values.by_start = text.B.ypct;
    values.cx_start = text.C.xpct;
    values.cy_start = text.C.ypct;
    values.amoved = false;
    values.bmoved = false;
    values.cmoved = false;
    text.A.textcolor = black;
    text.B.textcolor = black;
    text.C.textcolor = black;
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (0)
/ recorddata = false
/ trialduration = 0
/ branch = [
    trial.move;
]
</trial>

<trial move>
/ dropsources = (a, b, c)
/ droptargets = (bg)
/ ontrialend = [
    if (trial.move.lastdropsource == "a") {
        values.amoved = true;
        text.A.textcolor = red;
    } else if (trial.move.lastdropsource == "b") {
        values.bmoved = true;
        text.B.textcolor = red;
    } else if (trial.move.lastdropsource == "c") {
        values.cmoved = true;
        text.C.textcolor = red;
    };
]
/ stimulusframes = [1=bg, centre, a, b, c]
/ validresponse = (bg)
/ inputdevice = dragdrop
/ branch = [
    if (values.amoved == false || values.bmoved == false || values.cmoved == false) {
        return trial.move;
    } else {
        return trial.revise;
    };
]
/ recorddata = false
</trial>

<trial revise>
/ dropsources = (a, b, c)
/ droptargets = (bg)
/ stimulusframes = [1=bg, centre, a, b, c, nextbutton]
/ validresponse = (nextbutton, bg)
/ inputdevice = dragdrop
/ branch = [
    if (trial.revise.response != "nextbutton") {
        return trial.revise;
    } else {
        return trial.logdata;
    };
]
/ recorddata = false
</trial>

<trial logdata>
/ ontrialbegin = [
    values.ax_end = text.A.xpct;
    values.ay_end = text.A.ypct;
    values.bx_end = text.B.xpct;
    values.by_end = text.B.ypct;
    values.cx_end = text.C.xpct;
    values.cy_end = text.C.ypct;
]
/ trialduration = 0
</trial>

<block exampleblock>
/ trials = [1-3=start]
</block>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode
    values.round
    values.ax_start values.ay_start values.ax_end values.ay_end
    values.bx_start values.by_start values.bx_end values.by_end
    values.cx_start values.cy_start values.cx_end values.cy_end)
/ separatefiles = true
</data>

wuaham
wuaham
Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)
Group: Forum Members
Posts: 21, Visits: 109
Dave - 12/19/2022
Dave - 12/19/2022
wuaham - 12/19/2022
Christmas is knocking at the door, I am still in trouble, no clue:
1. I wish to randomly display some text (implemented in the script below)
2. Drag and drop each text far away from the center (based on some criteria, basically on any directions - up, down, right, left or whereever)
3. If all texts are moved (or at least touched/clicked to move), text color will change (say white to red) and a Next button will appear (sorry - not implemented) at the bottom of the screen
4. On the next screen, all moved items will remain on the same locations where they were moved earlier and now a final chance will be given to adjust all moves (if participant wish to)
5. If happy on the adjusted positions then click Next
6. Location (x, y in %) of each text along with text name will be saved in the data file
7. Repeat for 3 times and save data on every repetition.

In Inquisit-6 (latest version) on an online experiment, is this something possible please?

Your help will be highly appreciated!

Current texts are hypothetical such as A, B, C D... it could potentially be words/sentences/images (currently only 6, can be more).

Any questions please let me know.

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text D>
/ items = ("D")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text E>
/ items = ("E")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text F>
/ items = ("F")
/ fontstyle = ("Arial", 30pt, true)
/ vposition = counter.faceYpos_grid.selectedvalue
/ hposition = counter.faceXpos_grid.selectedvalue
</text>

<text centre>
/ items = ("Centre")
/ position = (50%, 50%)
/ size = (20%,20%)
/ txcolor = red
</text>

<counter faceXpos_grid>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter faceYpos_grid>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial example>
/ inputdevice = mouse
/ stimulustimes = [0=clearscreen, centre, text.A, text.B, text.C, text.D, text.E, text.F]
/ validresponse = (anyresponse)
/ ontrialend = [reset(counter.faceXpos_grid),reset(counter.faceYpos_grid);]
/ recorddata = false
</trial>

<block exampleblock>
/ trials = [1-3=example]
/ recorddata = false
</block>

===== End ==========================



Sorry, I'm confused. I cannot find any drag and drop mechanincs implemented at all in the snippet you posted. Also, "far away from the center (based on some criteria" is so vague as to be inactionable -- so what's the criterion supposed to be?

Anyway, save for the ill-defined and thus inactionable "far away from the center" criterion, here's an example that should give you the general idea:

========Start of script ================

<text A>
/ items = ("A")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<text B>
/ items = ("B")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<text C>
/ items = ("C")
/ fontstyle = ("Arial", 30pt, true)
/ dropsource = true
/ erase = false
</text>

<shape bg>
/ shape = rectangle
/ color = white
/ size = (100%, 100%)
/ droptarget = true
/ dropposition = (anywhere, anywhere)
/ erase = false
</shape>

<text centre>
/ items = ("+")
/ position = (50%, 50%)
/ size = (20%,20%)
/ vjustify = center
/ txcolor = red
/ erase = false
</text>

<button nextbutton>
/ caption = "NEXT"
/ position = (50%, 90%)
/ size = (8%, 4%)
/ erase = false
</button>

<list x>
/ items = (9.7%,10.8%,10.05%,9.6%,10.5%,10.7%,9.5%,10.4%,10.8%,19.8%,19.74%,20.3%,19.3%,19.4%,20.4%,19.8%,20.26%,19.7%,30.8%,30.3%,29.1%,29.7%,29.1%,30.3%,29.4%,30.4%,29.2%,40.5%,39.8%,39.1%,40.7%,39.8%,40.5%,39.8%,39.5%,
60.8%,59.7%,60.7%,59.4%,60.6%,60.8%,59.2%,59.1%,60.3%,70.5%,69.6%,69.7%,70.7%,70.6%,70.3%,70.4%,70.7%,69.1%,80.2%,80.5%,79.7%,80.2%,80.8%,80.7%,79.2%,79.6%,79.8%,90.2%,89.8%,90.9%,90.2%,89.3%,90.8%,89.8%,89.1%,89.5%)
/ selectionrate = always
</list>

<list y>
/ items = (9.8%, 20.5%, 30.8%, 39.2%, 60.3%, 69.1%, 80.6% 89.5%,10.6%, 20.2%, 30.9%, 40.6%, 49.2%, 59.2%, 70.6%, 79.5%, 89.6%, 9.5%, 19.1%, 29.7%, 40.4%, 59.7%, 70.8%, 80.5%, 90.3%, 9.2%, 19.5%, 29.1%, 39.8%, 60.2%, 70.3%, 79.3%, 89.1%,
9.2%, 19.7%, 30.1%, 40.8%, 60.7%, 70.3%, 79.4%, 89.1%, 9.1%, 20.6%, 30.2%, 39.8%, 59.2%, 70.6%, 79.2%, 90.3%, 10.4%, 20.4%, 30.8%, 39.8%, 60.2%, 70.2%, 79.5%, 89.3%, 10.2%, 20.8%, 30.8%, 40.2%, 49.3%, 59.7%, 70.2%, 79.7%, 89.2%, 9.5%, 20.7%, 29.4%, 39.5%, 49.8%, 59.2%, 70.2%, 80.2%, 90.8%)
/ selectionrate = always
</list>

<values>
/ round = 0

/ ax_start = 0%
/ ay_start = 0%
/ bx_start = 0%
/ by_start = 0%
/ cx_start = 0%
/ cy_start = 0%

/ ax_end = 0%
/ ay_end = 0%
/ bx_end = 0%
/ by_end = 0%
/ cx_end = 0%
/ cy_end = 0%

/ amoved = false
/ bmoved = false
/ cmoved = false
</values>


<trial start>
/ ontrialbegin = [
    list.x.reset();
    list.y.reset();
    values.round += 1;
    text.A.hposition = list.x.nextvalue;
    text.A.vposition = list.y.nextvalue;
    text.B.hposition = list.x.nextvalue;
    text.B.vposition = list.y.nextvalue;
    text.C.hposition = list.x.nextvalue;
    text.C.vposition = list.y.nextvalue;
    values.ax_start = text.A.xpct;
    values.ay_start = text.A.ypct;
    values.bx_start = text.B.xpct;
    values.by_start = text.B.ypct;
    values.cx_start = text.C.xpct;
    values.cy_start = text.C.ypct;
    values.amoved = false;
    values.bmoved = false;
    values.cmoved = false;
    text.A.textcolor = black;
    text.B.textcolor = black;
    text.C.textcolor = black;
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (0)
/ recorddata = false
/ trialduration = 0
/ branch = [
    trial.move;
]
</trial>

<trial move>
/ dropsources = (a, b, c)
/ droptargets = (bg)
/ ontrialend = [
    if (trial.move.lastdropsource == "a") {
        values.amoved = true;
        text.A.textcolor = red;
    } else if (trial.move.lastdropsource == "b") {
        values.bmoved = true;
        text.B.textcolor = red;
    } else if (trial.move.lastdropsource == "c") {
        values.cmoved = true;
        text.C.textcolor = red;
    };
]
/ stimulusframes = [1=bg, centre, a, b, c]
/ validresponse = (bg)
/ inputdevice = dragdrop
/ branch = [
    if (values.amoved == false || values.bmoved == false || values.cmoved == false) {
        return trial.move;
    } else {
        return trial.revise;
    };
]
/ recorddata = false
</trial>

<trial revise>
/ dropsources = (a, b, c)
/ droptargets = (bg)
/ stimulusframes = [1=bg, centre, a, b, c, nextbutton]
/ validresponse = (nextbutton, bg)
/ inputdevice = dragdrop
/ branch = [
    if (trial.revise.response != "nextbutton") {
        return trial.revise;
    } else {
        return trial.logdata;
    };
]
/ recorddata = false
</trial>

<trial logdata>
/ ontrialbegin = [
    values.ax_end = text.A.xpct;
    values.ay_end = text.A.ypct;
    values.bx_end = text.B.xpct;
    values.by_end = text.B.ypct;
    values.cx_end = text.C.xpct;
    values.cy_end = text.C.ypct;
]
/ trialduration = 0
</trial>

<block exampleblock>
/ trials = [1-3=start]
</block>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode
    values.round
    values.ax_start values.ay_start values.ax_end values.ay_end
    values.bx_start values.by_start values.bx_end values.by_end
    values.cx_start values.cy_start values.cx_end values.cy_end)
/ separatefiles = true
</data>

Thank you for the answer.  Apologize for not making it more clear - forgot to mention that I didn't implement drag and drop part. I believe it serves the purpose and be able to adjust the script now the way we want. It's a great help indeed. Take care and Merry Christmas.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search