Millisecond Forums

recommendation

https://forums.millisecond.com/Topic34325.aspx

By peter - 5/13/2022

Hi Everyone, I'm trying to design a version of the buzz wire task. Participants will be shown a curving line and asked to follow it with the mouse. When they stray  off the line they hear a buzz. 

Can anyone recommend a script form the library that I can use as a starting off point for building this task or recommend some code that will make this possible.
Many thanks in advance for any help you can give.

Peter
By Dave - 5/13/2022

peter - 5/13/2022
Hi Everyone, I'm trying to design a version of the buzz wire task. Participants will be shown a curving line and asked to follow it with the mouse. When they stray  off the line they hear a buzz. 

Can anyone recommend a script form the library that I can use as a starting off point for building this task or recommend some code that will make this possible.
Many thanks in advance for any help you can give.

Peter

You won't have much luck finding anything in the library that fits the bill. I'm not even sure this can be done.
By Dave - 5/16/2022

Dave - 5/13/2022
peter - 5/13/2022
Hi Everyone, I'm trying to design a version of the buzz wire task. Participants will be shown a curving line and asked to follow it with the mouse. When they stray  off the line they hear a buzz. 

Can anyone recommend a script form the library that I can use as a starting off point for building this task or recommend some code that will make this possible.
Many thanks in advance for any help you can give.

Peter

You won't have much luck finding anything in the library that fits the bill. I'm not even sure this can be done.

I've been pondering this over the weekend, and the closest you can get is something like this:

<block myblock>
/ onblockbegin = [
    mouse.x = 0px;
    mouse.y = 0.5px*display.canvasheight;
]
/ screencolor = black
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=bg, segment1, segment2, segment3, segment4, segment5, goal]
/ inputdevice = mouseover
/ validresponse = (goal, segment5, segment4, segment3, segment2, segment1, bg)
/ isvalidresponse = [
    if (trial.mytrial.response == "bg" || trial.mytrial.response == "goal") {
        return true;
    } else {
        return false;
    };
]
/ responsemessage = ("bg", systembeep, 500)
/ branch = [
    if (trial.mytrial.response == "bg") {
        mouse.x = 0px;
        mouse.y = 0.5px*display.canvasheight;
        return trial.mytrial;
    } else if (trial.mytrial.response == "goal") {
        return trial.end;
    } else {
        return trial.mytrial;
    };
]
</trial>

<trial end>
/ stimulusframes = [1=goal_reached]
/ validresponse = (0)
/ trialduration = 1000
</trial>

<shape bg>
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<shape segment1>
/ shape = rectangle
/ size = (200px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = 0px
/ vposition = 0.5px*display.canvasheight
/ erase = false
</shape>

<shape segment2>
/ shape = rectangle
/ size = (20px, 100px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment1.hposition + shape.segment1.widthpx
/ vposition = shape.segment1.vposition
/ erase = false
</shape>

<shape segment3>
/ shape = rectangle
/ size = (50px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = shape.segment2.hposition + shape.segment2.widthpx
/ vposition = shape.segment2.vposition + shape.segment2.heightpx - shape.segment3.heightpx
/ erase = false
</shape>

<shape segment4>
/ shape = rectangle
/ size = (20px, 350px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment3.hposition + shape.segment3.widthpx
/ vposition = shape.segment3.vposition + shape.segment3.heightpx - shape.segment4.heightpx
/ erase = false
</shape>

<shape segment5>
/ shape = rectangle
/ size = (500px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = shape.segment4.hposition + shape.segment4.widthpx
/ vposition = shape.segment4.vposition
/ erase = false
</shape>

<shape goal>
/ shape = circle
/ size = (20px, 20px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment5.hposition + shape.segment5.widthpx - shape.goal.widthpx/2
/ vposition = shape.segment5.vposition + shape.segment5.heightpx - shape.goal.heightpx
/ erase = false
</shape>

<text goal_reached>
/ items = ("Goal Reached!")
/ txcolor = green
/ txbgcolor = black
/ erase = false
</text>
By peter - 5/16/2022

Dave - 5/16/2022
Dave - 5/13/2022
peter - 5/13/2022
Hi Everyone, I'm trying to design a version of the buzz wire task. Participants will be shown a curving line and asked to follow it with the mouse. When they stray  off the line they hear a buzz. 

Can anyone recommend a script form the library that I can use as a starting off point for building this task or recommend some code that will make this possible.
Many thanks in advance for any help you can give.

Peter

You won't have much luck finding anything in the library that fits the bill. I'm not even sure this can be done.

I've been pondering this over the weekend, and the closest you can get is something like this:

<block myblock>
/ onblockbegin = [
    mouse.x = 0px;
    mouse.y = 0.5px*display.canvasheight;
]
/ screencolor = black
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=bg, segment1, segment2, segment3, segment4, segment5, goal]
/ inputdevice = mouseover
/ validresponse = (goal, segment5, segment4, segment3, segment2, segment1, bg)
/ isvalidresponse = [
    if (trial.mytrial.response == "bg" || trial.mytrial.response == "goal") {
        return true;
    } else {
        return false;
    };
]
/ responsemessage = ("bg", systembeep, 500)
/ branch = [
    if (trial.mytrial.response == "bg") {
        mouse.x = 0px;
        mouse.y = 0.5px*display.canvasheight;
        return trial.mytrial;
    } else if (trial.mytrial.response == "goal") {
        return trial.end;
    } else {
        return trial.mytrial;
    };
]
</trial>

<trial end>
/ stimulusframes = [1=goal_reached]
/ validresponse = (0)
/ trialduration = 1000
</trial>

<shape bg>
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<shape segment1>
/ shape = rectangle
/ size = (200px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = 0px
/ vposition = 0.5px*display.canvasheight
/ erase = false
</shape>

<shape segment2>
/ shape = rectangle
/ size = (20px, 100px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment1.hposition + shape.segment1.widthpx
/ vposition = shape.segment1.vposition
/ erase = false
</shape>

<shape segment3>
/ shape = rectangle
/ size = (50px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = shape.segment2.hposition + shape.segment2.widthpx
/ vposition = shape.segment2.vposition + shape.segment2.heightpx - shape.segment3.heightpx
/ erase = false
</shape>

<shape segment4>
/ shape = rectangle
/ size = (20px, 350px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment3.hposition + shape.segment3.widthpx
/ vposition = shape.segment3.vposition + shape.segment3.heightpx - shape.segment4.heightpx
/ erase = false
</shape>

<shape segment5>
/ shape = rectangle
/ size = (500px, 20px)
/ color = blue
/ halign = left
/ valign = top
/ hposition = shape.segment4.hposition + shape.segment4.widthpx
/ vposition = shape.segment4.vposition
/ erase = false
</shape>

<shape goal>
/ shape = circle
/ size = (20px, 20px)
/ color = green
/ halign = left
/ valign = top
/ hposition = shape.segment5.hposition + shape.segment5.widthpx - shape.goal.widthpx/2
/ vposition = shape.segment5.vposition + shape.segment5.heightpx - shape.goal.heightpx
/ erase = false
</shape>

<text goal_reached>
/ items = ("Goal Reached!")
/ txcolor = green
/ txbgcolor = black
/ erase = false
</text>

Wow that's awesome thanks for having figuring that out. I am pretty sure I can pop in some overlapping circles to bring in some curves as well, 
Thanks again for all the effort you welt to. You are a legend.
Peter