Learning to criterion


Author
Message
raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
Hi Dave,

I'm adapting a task I've already created to include the ability to drop any stimuli that have been learnt to a specific criterion.
What is the best way to go about this? After looking on the forums and language reference, I can't seem to find any reference to criterion elements.

Thanks in advance!

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: 103K
raven - 9/24/2024
Hi Dave,

I'm adapting a task I've already created to include the ability to drop any stimuli that have been learnt to a specific criterion.
What is the best way to go about this? After looking on the forums and language reference, I can't seem to find any reference to criterion elements.

Thanks in advance!

Based on your description I have no idea what you want to do. I'm also unclear what you mean by "criterion elements" -- there is no such thing.

Provide a detailed explanation of what you aim to do, along with relevant example code.
raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank 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: 103K
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,
Thanks for the help, much appreciated.
There seems to be an issue that when Stimulus B is learned to criterion, but not A, it goes to the Stimulus A branch block, not B.
Is there something wrong with the logic of the code here or is it something else:
<block start_block>
/ trials=[1-10=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.correctCount >= 5) block.branch_block_a]
/ branch=[if (trial.b_trial.correctCount >= 5) block.branch_block_b]
</block>


Thanks!


raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
raven - 10/21/2024
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,
Thanks for the help, much appreciated.
There seems to be an issue that when Stimulus B is learned to criterion, but not A, it goes to the Stimulus A branch block, not B.
Is there something wrong with the logic of the code here or is it something else:
<block start_block>
/ trials=[1-10=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.correctCount >= 5) block.branch_block_a]
/ branch=[if (trial.b_trial.correctCount >= 5) block.branch_block_b]
</block>


Thanks!


Hi Dave,
Please ignore my previous reply, I managed to figure it out.
Thanks again!

raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,

If one stimulus has been learned, say Stimulus A, I'd like to bring in another stimulus, say Stimulus C (i.e., trial.c_trial).
Is there a wa to achieve this without disrupting the flow of the program?

Thanks!
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: 103K
raven - 10/21/2024
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,

If one stimulus has been learned, say Stimulus A, I'd like to bring in another stimulus, say Stimulus C (i.e., trial.c_trial).
Is there a wa to achieve this without disrupting the flow of the program?

Thanks!

The same approach I already showed you applies. /skip the c trial as long as either the a and b trials have not been learned. Don't skip it as soon as either has been learned.
raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
Dave - 10/21/2024
raven - 10/21/2024
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,

If one stimulus has been learned, say Stimulus A, I'd like to bring in another stimulus, say Stimulus C (i.e., trial.c_trial).
Is there a wa to achieve this without disrupting the flow of the program?

Thanks!

The same approach I already showed you applies. /skip the c trial as long as either the a and b trials have not been learned. Don't skip it as soon as either has been learned.

Ok, that makes sense, thanks! :)
raven
raven
Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)Partner Member (505 reputation)
Group: Forum Members
Posts: 52, Visits: 110
raven - 10/21/2024
Dave - 10/21/2024
raven - 10/21/2024
Dave - 10/20/2024
raven - 10/20/2024
Hi Dave,

Basically, if participants press the correct key to criterion (60% accuracy) at the end of one block, I want to start a different block where the first stimulus that has been learned to criterion is no longer there, but the stimuli remain, until they are also learned to criterion.

The issues I can't seem to resolve, and am hoping you can help with, are as follows:

1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

3. Is there a better way to achieve what I'm trying to do? For example, is there a criterion function in Inquisit?

Below is the code that I have been working with.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.start_block]
</expt>

<block start_block>
/ trials=[1-5=noreplace(trial.a_trial, trial.b_trial)]
/ branch=[if (trial.a_trial.percentCorrect >= 60) block.branch_block_a]
/ branch=[if (trial.b_trial.percentCorrect >= 60) block.branch_block_b]
</block>

<trial a_trial>
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        trial.feedback_screen
    }
    ]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_a>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_a>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_a>
/ items = ("***** This is the Branch Block A *****
~n
Stimulus A has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = red
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<block branch_block_b>
    / trials = [
    1=noreplace(branch_block_trial_a)
]
</block>

<trial branch_block_trial_b>
/ stimulusframes = [
    1=clearscreen, text.branch_block_text_a
]
/ validresponse = (" ")

</trial>

<text branch_block_text_b>
/ items = ("***** This is the Branch Block B *****
~n
Stimulus B has been learned to criterion")
/ fontstyle = ("Courier", 18pt, true)
/ color = green
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


Thank you!



> 1. The percentage of time that a participant presses the correct key for each stimulus is not displayed correctly on the feedback screen. It should get the value from the percentCorrect property, but that doesn't seem to be working.

There is no such thing as <%num_a_correct%> or <%num_b_correct%>.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


It's <%values.num_a_correct%> and <%values.num_b_correct%> respectively.

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>


> 2. How can I make it so that when one stimulus has been learned to criterion, the others remain until they are all learned?

Use /skip attributes.

<values>
/ num_a_correct = 0;
/ num_b_correct = 0;
</values>

<expt>
/ blocks = [1=block.learning_block]
</expt>

<values>
/ a_learned = false
/ b_learned = false
</values>

<page blocksummary>
^Number of A trials in this block: <%trial.a_trial.trialcount%>
^Percent correct of A trials in this block: <%trial.a_trial.percentcorrect%>
^A learned: <%values.a_learned%>

^Number of B trials in this block: <%trial.b_trial.trialcount%>
^Percent correct of B trials in this block: <%trial.b_trial.percentcorrect%>
^B learned: <%values.b_learned%>
</page>


<block learning_block>
/ postinstructions = (page.blocksummary)
/ onblockend = [
    if (values.num_a_correct >= 60) {
        values.a_learned = true;
    };
    if (values.num_b_correct >= 60) {
        values.b_learned = true;
    }
]
/ trials=[1-20=noreplace(trial.a_trial, trial.b_trial)]
/ branch = [
    if (!values.a_learned || !values.b_learned) { // if either hasn't been learned, run another learning block
        return block.learning_block;
    }
]
</block>

<trial a_trial>
/ skip = [
    values.a_learned;
]
/ ontrialend = [
    values.num_a_correct = trial.a_trial.percentCorrect
]

/ stimulusframes = [1=clearscreen, a_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("a")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text a_trial_stimulus>
/ items = ("Stimulus A")
/ hposition = 50%
</text>

<trial b_trial>
/ skip = [
    values.b_learned;
]

/ ontrialend = [
    values.num_b_correct = trial.b_trial.percentCorrect
]
/ stimulusframes = [1=clearscreen, b_trial_stimulus]
/ inputdevice = keyboard
/ validresponse = ("a", "b")
/ correctresponse = ("b")
/ branch = [
    {
        return trial.feedback_screen
    }
]
</trial>

<text b_trial_stimulus>
/ items = ("Stimulus B")
/ hposition = 50%
</text>

<trial feedback_screen>
/ stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a_correct; 150=num_b_correct]
/ timeout = 1500
</trial>

<text feedback_screen>
/ items = ("Feedback Screen")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 30%)
</text>

<text num_a_correct>
/ items = ("Percentage Stimulus A Correct: <%values.num_a_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 40%)
</text>

<text num_b_correct>
/ items = ("Percentage Stimulus B Correct: <%values.num_b_correct%>")
/ fontstyle = ("Courier", 18pt, true)
/ color = blue
/ size = (80%, 20%)
/ position = (50%, 50%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct
    values.num_a_correct values.num_b_correct trial.a_trial.percentcorrect trial.b_trial.percentcorrect
    values.a_learned, values.b_learned)
</data>



Hi Dave,

If one stimulus has been learned, say Stimulus A, I'd like to bring in another stimulus, say Stimulus C (i.e., trial.c_trial).
Is there a wa to achieve this without disrupting the flow of the program?

Thanks!

The same approach I already showed you applies. /skip the c trial as long as either the a and b trials have not been learned. Don't skip it as soon as either has been learned.

Ok, that makes sense, thanks! :)

Hi Dave,
I have another question.
How would I make it so that there are separate blocks for each phase of learning?
For example, if a participant learns Stimulus A to criterion in Block 1, then there will be a break, after which they will start Block 2 where they would only be presented with Stimulus B and C, until one of them is learned to criterion, etc.
I'm not sure how this can be done using the / skip attribute approach. Or should a different approach be used to achieve this?
Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search