Corsi Block- Tapping task with pictures instead text


Author
Message
JackKosno
JackKosno
Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)
Group: Forum Members
Posts: 2, Visits: 3
Dave - Monday, November 07, 2016
JackKosno - Sunday, November 06, 2016
Hello everyone,

I'm trying to change implementation of one of examples, naming Corsi Block task by changing text elements into picture one. Unfortunatelly I have a problem with simulating "yellow" block instead changing bgcollor in text element.

I was trying to use shape element and placing it on selected element with it's width and heinght, but it's going a bit randomly. I was wondering how to change presented pictures on element that replaced pure text elements, or maybe how to implement covering pictures with shape.

Thanks for your help.
Jacek

What you do is:

#1: Change the various "block" <text> elements to <picture> elements.
#2: Have two items for each <picture> elements -- one for the "unmarked" block, one for the "marked" block (a yellow square).
#3: Use values for selection between the two items. When a block is selected / clicked, change the value from 1 to 2.

<values>
...
/block1item = 1
...
</values>

<text 1>
/ items = ("unmarked.jpg", "marked.jpg")
/ select = values.block1item

/ size = (expressions.blocksize, expressions.blocksize)
/ hjustify = center
/ vjustify = center
/ erase = true(transparent)
/ hposition = 1px*(125/expressions.mmtopx)+expressions.leftmargin
/ vposition = 1px*(155/expressions.mmtopx)+expressions.topmargin
</text>

<trial getseq>
/ stimulustimes = [0=board,getready; 1000=board,1,2,3,4,5,6,7,8,9]
...
/ ontrialend = [values.block1item=1; ...]
...
</trial>

<trial showseq>
/ ontrialbegin = [values.highlightedblock=list.blockseq.nextvalue;
    values.tapcount+=1]
/ ontrialbegin = [if(values.highlightedblock==1)values.block1item=2;...]
...
</trial>

<trial recallseq>
/ inputdevice = mouse
/ stimulusframes = [1=board,1,2,3,4,5,6,7,8,9,reset,done]
/ validresponse = (1,2,3,4,5,6,7,8,9,reset,done)
/ ontrialend = [if(trial.recallseq.response=="1")
    values.block1item=2 else values.block1item=1
;...]
...
</trial>

and so forth. The 2nd picture item -- "marked.jpg" -- should have the same dimensions as the regular "unmarked" block image(s).

Hope this helps.

Thank you very much for response, this solution is working perfectly :) 
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: 13K, Visits: 104K
JackKosno - Sunday, November 06, 2016
Hello everyone,

I'm trying to change implementation of one of examples, naming Corsi Block task by changing text elements into picture one. Unfortunatelly I have a problem with simulating "yellow" block instead changing bgcollor in text element.

I was trying to use shape element and placing it on selected element with it's width and heinght, but it's going a bit randomly. I was wondering how to change presented pictures on element that replaced pure text elements, or maybe how to implement covering pictures with shape.

Thanks for your help.
Jacek

What you do is:

#1: Change the various "block" <text> elements to <picture> elements.
#2: Have two items for each <picture> elements -- one for the "unmarked" block, one for the "marked" block (a yellow square).
#3: Use values for selection between the two items. When a block is selected / clicked, change the value from 1 to 2.

<values>
...
/block1item = 1
...
</values>

<picture 1>
/ items = ("unmarked.jpg", "marked.jpg")
/ select = values.block1item

/ size = (expressions.blocksize, expressions.blocksize)
/ hposition = 1px*(125/expressions.mmtopx)+expressions.leftmargin
/ vposition = 1px*(155/expressions.mmtopx)+expressions.topmargin
</picture>

<trial getseq>
/ stimulustimes = [0=board,getready; 1000=board,1,2,3,4,5,6,7,8,9]
...
/ ontrialend = [values.block1item=1; ...]
...
</trial>

<trial showseq>
/ ontrialbegin = [values.highlightedblock=list.blockseq.nextvalue;
    values.tapcount+=1]
/ ontrialbegin = [if(values.highlightedblock==1)values.block1item=2;...]
...
</trial>

<trial recallseq>
/ inputdevice = mouse
/ stimulusframes = [1=board,1,2,3,4,5,6,7,8,9,reset,done]
/ validresponse = (1,2,3,4,5,6,7,8,9,reset,done)
/ ontrialend = [if(trial.recallseq.response=="1")
    values.block1item=2 else values.block1item=1
;...]
...
</trial>

and so forth. The 2nd picture item -- "marked.jpg" -- should have the same dimensions as the regular "unmarked" block image(s).

Hope this helps.

Edited 8 Years Ago by Dave
JackKosno
JackKosno
Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)Respected Member (311 reputation)
Group: Forum Members
Posts: 2, Visits: 3
Hello everyone,

I'm trying to change implementation of one of examples, naming Corsi Block task by changing text elements into picture one. Unfortunatelly I have a problem with simulating "yellow" block instead changing bgcollor in text element.

I was trying to use shape element and placing it on selected element with it's width and heinght, but it's going a bit randomly. I was wondering how to change presented pictures on element that replaced pure text elements, or maybe how to implement covering pictures with shape.

Thanks for your help.
Jacek
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search