Progressbar is supposed to stop


Author
Message
Kairi
Kairi
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 2, Visits: 8
Hello, i need help. English is not my first language so please apologize for any mistakes.

I want to programm a training for self-esteem and i need a progress bar. I already programmed the progressbar: it rises if you give a correct answer but i want it to fall if you give a wrong answer and i want it to stop rising at a specific point. Right now it rises out of the screen.

I attached the file. I appreciate any help.


Attachments
SWAP EG.iqx (86 views, 18.00 KB)
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: 101K
Kairi - 7/28/2023
Hello, i need help. English is not my first language so please apologize for any mistakes.

I want to programm a training for self-esteem and i need a progress bar. I already programmed the progressbar: it rises if you give a correct answer but i want it to fall if you give a wrong answer and i want it to stop rising at a specific point. Right now it rises out of the screen.

I attached the file. I appreciate any help.


You need to be more specific. You don't explain by how *much* you want the bar to rise or fall. You don't explain at what "speciic point [you] want it to stop rising." You don't explain at what size or level or position the bar should start at.

Also, you should at a minimum explain the reasoning behind any code you share. Name the relevant elements exactly as they are called in the script. Explain what you did and why.

Kairi
Kairi
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 2, Visits: 8
Dave - 7/29/2023
Kairi - 7/28/2023
Hello, i need help. English is not my first language so please apologize for any mistakes.

I want to programm a training for self-esteem and i need a progress bar. I already programmed the progressbar: it rises if you give a correct answer but i want it to fall if you give a wrong answer and i want it to stop rising at a specific point. Right now it rises out of the screen.

I attached the file. I appreciate any help.


You need to be more specific. You don't explain by how *much* you want the bar to rise or fall. You don't explain at what "speciic point [you] want it to stop rising." You don't explain at what size or level or position the bar should start at.

Also, you should at a minimum explain the reasoning behind any code you share. Name the relevant elements exactly as they are called in the script. Explain what you did and why.

Thank you for your reply.
I am not very familiar with Inquisit, so i dont really know how much i want it to rise or fall. i got the code from my boss and i am supposed to change some things, but it is my first time working with inquisit and i am not really sure where and how i should change something
My script says right now:
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarSizeY = values.ChangeBarSizeY + 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarPositionY = values.ChangeBarPositionY - 0.50]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG >251) values.ChangeColorR = values.ChangeColorR - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG <251) values.ChangeColorG = values.ChangeColorG + 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarSizeY = values.ChangeBarSizeY - 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarPositionY = values.ChangeBarPositionY + 0.5]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR >251) values.ChangeColorG = values.ChangeColorG - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR <251) values.ChangeColorR = values.ChangeColorR + 3.00]

So, the bar changes -10 and +10, but i think 0.5 would be enough to rise and fall.

the script for the bar is the following:
<values>
/fixationduration = 500
/fixation_posttrialpause = 100
/target_posttrialpause = 0
/targetduration = 3000
/wordtype = 0
/positiveword = ""
/negativeword = ""
/ChangeBarSizeY = 0
/ChangeBarPositionY = 0
/ChangeColorR = 0
/ChangeColorG = 0
/select = 0
</values>


<expressions >
/BarSizeY = 39% + values.ChangeBarSizeY
/BarPositionY = 61 + values.ChangeBarPositionY
/ColorR = 255 + values.ChangeColorR
/ColorG = 255 + values.ChangeColorG
/MaxBarSizeY = 100
</expressions>

<shape bar>
/ shape = rectangle
/ erase = false
/ color = (expressions.ColorR ,expressions.ColorG ,0)
/ position = (96, expressions.BarPositionY)
/ size = (50,900)
</shape>

The way the bar starts right now is ok. I want it to start there.
There are no levels. The participants see a sentence and after the sentence they see a word. every sentence has a positive and a negative word. The sentences are situations and the words are interpretations of these situations. for example:
Sentence: A friend comments on your decision.
positive: supporting
negative: criticizing
The answer is correct if the participant says
a) that the positive word and the sentence are connected.
b) that the negative word and the sentence are not connected.
The answer is wrong of the participant says otherwise.
If the answer is correct they see a positive smiley
and if the answer is wrong they see a negative smiley.

The participants have to options:
1) press "S" for " no, the sentences and word are not connected"
2) press "L" for "yes, the sentence and word are connected"
They see 30 sentences that are presented at one time with the positive word and one time with the negative word, in total 60 sentences per training. The sentences are randomly presented.
We want them to learn to answer correctly so we want a bar that rises when they give a correct answer and falls if they give the wrong answer. I dont really know at what "specific point" the bar should stop. We want the bar to stop, so the participant knows they can not improve, so it should be a goal for them to keep the bar on top. I just dont want the bar to go out of the screen.

I got the code of my boss who did a similar experiment before. They made a bar too, but there was no option to stop the bar. i copied the code for the bar and for this experiment we decided that the bar should stop, but i cant figure out how i can do that.

If you need any more information,  I will gladly give it to you 


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: 101K
Kairi - 7/29/2023
Dave - 7/29/2023
Kairi - 7/28/2023
Hello, i need help. English is not my first language so please apologize for any mistakes.

I want to programm a training for self-esteem and i need a progress bar. I already programmed the progressbar: it rises if you give a correct answer but i want it to fall if you give a wrong answer and i want it to stop rising at a specific point. Right now it rises out of the screen.

I attached the file. I appreciate any help.


You need to be more specific. You don't explain by how *much* you want the bar to rise or fall. You don't explain at what "speciic point [you] want it to stop rising." You don't explain at what size or level or position the bar should start at.

Also, you should at a minimum explain the reasoning behind any code you share. Name the relevant elements exactly as they are called in the script. Explain what you did and why.

Thank you for your reply.
I am not very familiar with Inquisit, so i dont really know how much i want it to rise or fall. i got the code from my boss and i am supposed to change some things, but it is my first time working with inquisit and i am not really sure where and how i should change something
My script says right now:
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarSizeY = values.ChangeBarSizeY + 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarPositionY = values.ChangeBarPositionY - 0.50]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG >251) values.ChangeColorR = values.ChangeColorR - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG <251) values.ChangeColorG = values.ChangeColorG + 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarSizeY = values.ChangeBarSizeY - 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarPositionY = values.ChangeBarPositionY + 0.5]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR >251) values.ChangeColorG = values.ChangeColorG - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR <251) values.ChangeColorR = values.ChangeColorR + 3.00]

So, the bar changes -10 and +10, but i think 0.5 would be enough to rise and fall.

the script for the bar is the following:
<values>
/fixationduration = 500
/fixation_posttrialpause = 100
/target_posttrialpause = 0
/targetduration = 3000
/wordtype = 0
/positiveword = ""
/negativeword = ""
/ChangeBarSizeY = 0
/ChangeBarPositionY = 0
/ChangeColorR = 0
/ChangeColorG = 0
/select = 0
</values>


<expressions >
/BarSizeY = 39% + values.ChangeBarSizeY
/BarPositionY = 61 + values.ChangeBarPositionY
/ColorR = 255 + values.ChangeColorR
/ColorG = 255 + values.ChangeColorG
/MaxBarSizeY = 100
</expressions>

<shape bar>
/ shape = rectangle
/ erase = false
/ color = (expressions.ColorR ,expressions.ColorG ,0)
/ position = (96, expressions.BarPositionY)
/ size = (50,900)
</shape>

The way the bar starts right now is ok. I want it to start there.
There are no levels. The participants see a sentence and after the sentence they see a word. every sentence has a positive and a negative word. The sentences are situations and the words are interpretations of these situations. for example:
Sentence: A friend comments on your decision.
positive: supporting
negative: criticizing
The answer is correct if the participant says
a) that the positive word and the sentence are connected.
b) that the negative word and the sentence are not connected.
The answer is wrong of the participant says otherwise.
If the answer is correct they see a positive smiley
and if the answer is wrong they see a negative smiley.

The participants have to options:
1) press "S" for " no, the sentences and word are not connected"
2) press "L" for "yes, the sentence and word are connected"
They see 30 sentences that are presented at one time with the positive word and one time with the negative word, in total 60 sentences per training. The sentences are randomly presented.
We want them to learn to answer correctly so we want a bar that rises when they give a correct answer and falls if they give the wrong answer. I dont really know at what "specific point" the bar should stop. We want the bar to stop, so the participant knows they can not improve, so it should be a goal for them to keep the bar on top. I just dont want the bar to go out of the screen.

I got the code of my boss who did a similar experiment before. They made a bar too, but there was no option to stop the bar. i copied the code for the bar and for this experiment we decided that the bar should stop, but i cant figure out how i can do that.

If you need any more information,  I will gladly give it to you 


> So, the bar changes -10 and +10, but i think 0.5 would be enough to rise and fall.

The bar changes by -10 and +10 of what? What's the unit supposed to be here? (Same goes if you change to 0.5 -- 0.5 of what?)

What the code does, as you posted it, is not really changing the bar size. It just moves the bar around, per

/BarPositionY = 61 + values.ChangeBarPositionY

where the y position is 61 (again, of what? Percentage of screen height?) plus whatever the change is.

The bar has a fixed size of

/ size = (50,900)

where it is again unclear what the unit is supposed to be. I don't see how you expect that to work across different display sizes, where 900 of whatever unit (e.g. pixels) may or may not be available in height at all.

You have not answered my question regarding when and on what basis you want the bar's size (or more accurately: position, in the code as it exists) to change anymore.

Perhaps you can talk to your boss, figure out precisely what he wants, and then we might make some headway. What you provided so far is insufficient to give you any concrete advice. It is not clear what you (or your boss) want.

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: 101K
Dave - 7/31/2023
Kairi - 7/29/2023
Dave - 7/29/2023
Kairi - 7/28/2023
Hello, i need help. English is not my first language so please apologize for any mistakes.

I want to programm a training for self-esteem and i need a progress bar. I already programmed the progressbar: it rises if you give a correct answer but i want it to fall if you give a wrong answer and i want it to stop rising at a specific point. Right now it rises out of the screen.

I attached the file. I appreciate any help.


You need to be more specific. You don't explain by how *much* you want the bar to rise or fall. You don't explain at what "speciic point [you] want it to stop rising." You don't explain at what size or level or position the bar should start at.

Also, you should at a minimum explain the reasoning behind any code you share. Name the relevant elements exactly as they are called in the script. Explain what you did and why.

Thank you for your reply.
I am not very familiar with Inquisit, so i dont really know how much i want it to rise or fall. i got the code from my boss and i am supposed to change some things, but it is my first time working with inquisit and i am not really sure where and how i should change something
My script says right now:
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarSizeY = values.ChangeBarSizeY + 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 1) values.ChangeBarPositionY = values.ChangeBarPositionY - 0.50]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG >251) values.ChangeColorR = values.ChangeColorR - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==1 && expressions.ColorG <251) values.ChangeColorG = values.ChangeColorG + 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarSizeY = values.ChangeBarSizeY - 10]
/ ontrialend = [if (trial.poswordtraining_posFB.correct == 0) values.ChangeBarPositionY = values.ChangeBarPositionY + 0.5]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR >251) values.ChangeColorG = values.ChangeColorG - 3.00]
/ ontrialend = [if (trial.poswordtraining_posFB.correct ==0 && expressions.ColorR <251) values.ChangeColorR = values.ChangeColorR + 3.00]

So, the bar changes -10 and +10, but i think 0.5 would be enough to rise and fall.

the script for the bar is the following:
<values>
/fixationduration = 500
/fixation_posttrialpause = 100
/target_posttrialpause = 0
/targetduration = 3000
/wordtype = 0
/positiveword = ""
/negativeword = ""
/ChangeBarSizeY = 0
/ChangeBarPositionY = 0
/ChangeColorR = 0
/ChangeColorG = 0
/select = 0
</values>


<expressions >
/BarSizeY = 39% + values.ChangeBarSizeY
/BarPositionY = 61 + values.ChangeBarPositionY
/ColorR = 255 + values.ChangeColorR
/ColorG = 255 + values.ChangeColorG
/MaxBarSizeY = 100
</expressions>

<shape bar>
/ shape = rectangle
/ erase = false
/ color = (expressions.ColorR ,expressions.ColorG ,0)
/ position = (96, expressions.BarPositionY)
/ size = (50,900)
</shape>

The way the bar starts right now is ok. I want it to start there.
There are no levels. The participants see a sentence and after the sentence they see a word. every sentence has a positive and a negative word. The sentences are situations and the words are interpretations of these situations. for example:
Sentence: A friend comments on your decision.
positive: supporting
negative: criticizing
The answer is correct if the participant says
a) that the positive word and the sentence are connected.
b) that the negative word and the sentence are not connected.
The answer is wrong of the participant says otherwise.
If the answer is correct they see a positive smiley
and if the answer is wrong they see a negative smiley.

The participants have to options:
1) press "S" for " no, the sentences and word are not connected"
2) press "L" for "yes, the sentence and word are connected"
They see 30 sentences that are presented at one time with the positive word and one time with the negative word, in total 60 sentences per training. The sentences are randomly presented.
We want them to learn to answer correctly so we want a bar that rises when they give a correct answer and falls if they give the wrong answer. I dont really know at what "specific point" the bar should stop. We want the bar to stop, so the participant knows they can not improve, so it should be a goal for them to keep the bar on top. I just dont want the bar to go out of the screen.

I got the code of my boss who did a similar experiment before. They made a bar too, but there was no option to stop the bar. i copied the code for the bar and for this experiment we decided that the bar should stop, but i cant figure out how i can do that.

If you need any more information,  I will gladly give it to you 


> So, the bar changes -10 and +10, but i think 0.5 would be enough to rise and fall.

The bar changes by -10 and +10 of what? What's the unit supposed to be here? (Same goes if you change to 0.5 -- 0.5 of what?)

What the code does, as you posted it, is not really changing the bar size. It just moves the bar around, per

/BarPositionY = 61 + values.ChangeBarPositionY

where the y position is 61 (again, of what? Percentage of screen height?) plus whatever the change is.

The bar has a fixed size of

/ size = (50,900)

where it is again unclear what the unit is supposed to be. I don't see how you expect that to work across different display sizes, where 900 of whatever unit (e.g. pixels) may or may not be available in height at all.

You have not answered my question regarding when and on what basis you want the bar's size (or more accurately: position, in the code as it exists) to change anymore.

Perhaps you can talk to your boss, figure out precisely what he wants, and then we might make some headway. What you provided so far is insufficient to give you any concrete advice. It is not clear what you (or your boss) want.

For what it's worth, if one wanted to actually manipulate the bar's height, within a defined min.- max. range, one would do something like this:

<values>
/ barheight = 50% // initial height of the bar
/ stepsize = 1.5% // amount by which the bar's height is in- or decreased based on correct vs. incorrect response
/ maxbarheight = 99.5% // maximum bar height
/ minbarheight = 0.5% // minimum bar height
</values>

<block exampleblock>
/ trials = [1-200 = trial.exampletrial]
</block>

<trial exampletrial>
/ ontrialend = [
    // if we have a correct response
    if (trial.exampletrial.correct) {
        // increase bar height by defined step size
        values.barheight += values.stepsize;
        // make sure bar height does not exceed allowable maximum height
        values.barheight = min(values.barheight, values.maxbarheight);
    // otherwise
        } else {
        // decrease bar height by defined step size
        values.barheight -= values.stepsize;
        // make sure bar height doesn't fall below allowable minimum height
        values.barheight = max(values.barheight, values.minbarheight);
    };
]
/ stimulusframes = [1=clearscreen, text.exampletext, shape.bar]
/ validresponse = ("L", "S")
/ correctresponse = ("L")
</trial>

<text exampletext>
/ items = (
    "
    L = correct response, bar grows
    S = wrong response, bar shrinks
    
    The current bar height is <%values.barheight%>.
    ")
/ erase = false
</text>

<shape bar>
/ shape = rectangle
/ color = cadetblue
/ height = values.barheight
/ width = 4%
/ position = (90%, 99.75%)
/ valign = bottom
/ erase = false
</shape>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search