Millisecond Forums

Progress bar in a block

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

By Rebecca17 - 1/29/2019

How can I implement, that the width of a progress bar depends on the number (1-6) of the current item?
My idea is the following, but it doesn't work:

<shape progressbar>
/ shape = rectangle
/ color = grey
/ position = (50%, 10%)
/ size = (0%, 5%)
/ width = 80% * (text.WS.currentitemnumber/25)

<block WS>
/ trials = [1-6 = WS]
</block>

<trial WS>
/ stimulusframes = [1 = WSF]
</trial>

<text WS>
/ items = WS
/ select = sequence (1,2,3,4,5,6)
/ position = (50%, 30%)
</text>

<item WS>
/1 = "Wort1"
/2 = "Wort2"
/3 = "Wort3"
/4 = "Wort4"
/5 = "Wort5"
/6 = "Wort6"
</item>
By Dave - 1/29/2019

Rebecca17 - Wednesday, January 30, 2019
How can I implement, that the width of a progress bar depends on the number (1-6) of the current item?
My idea is the following, but it doesn't work:

<shape progressbar>
/ shape = rectangle
/ color = grey
/ position = (50%, 10%)
/ size = (0%, 5%)
/ width = 80% * (text.WS.currentitemnumber/25)

<block WS>
/ trials = [1-6 = WS]
</block>

<trial WS>
/ stimulusframes = [1 = WSF]
</trial>

<text WS>
/ items = WS
/ select = sequence (1,2,3,4,5,6)
/ position = (50%, 30%)
</text>

<item WS>
/1 = "Wort1"
/2 = "Wort2"
/3 = "Wort3"
/4 = "Wort4"
/5 = "Wort5"
/6 = "Wort6"
</item>

<shape progressbar>
/ shape = rectangle
/ color = grey
/ position = (50%, 10%)
/ size = (0%, 5%)
/ erase = false
</shape>

<block WS>
/ trials = [1-6 = WS]
</block>

<trial WS>
/ ontrialbegin = [
shape.progressbar.width = 80% * (text.WS.nextindex/25);
]
/ stimulusframes = [1 = WS, progressbar]
/ validresponse = (57)
</trial>

<text WS>
/ items = WS
/ select = sequence (1,2,3,4,5,6)
/ position = (50%, 30%)
</text>

<item WS>
/1 = "Wort1"
/2 = "Wort2"
/3 = "Wort3"
/4 = "Wort4"
/5 = "Wort5"
/6 = "Wort6"
</item>