count the number of tentative in trials


Author
Message
Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

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: 104K
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

Yes but with "/isvalidresponse" when participant press on knob the trial is stopped, but I would like that trial continue even the response is false. 
Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [5000=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
    
]
</trial>


Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>
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
Kevin_Bague - 2/27/2020
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>

It's not stopped if you actually use /isvalidresponse properly.

<block myblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ posttrialpause = 1000
/ ontrialbegin = [
    values.count_tentative = 0;
]
/ stimulusframes = [1=examplestim]
/ validresponse = (2, 3)
/ isvalidresponse = [
    if(trial.example.response == 2) {
        values.count_tentative += 1;
        false;
    } else if (trial.example.response == 3)
    {
        true;
    }
]
/ correctresponse = (3)
/ iscorrectresponse = [
    trial.example.response == 3 && values.count_tentative == 0;
]
</trial>

<text examplestim>
/ items = ("Press 1 or 2. 2 is the correct response")
</text>

<values>
/ count_tentative = 0
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>


Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>

It's not stopped if you actually use /isvalidresponse properly.

<block myblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ posttrialpause = 1000
/ ontrialbegin = [
    values.count_tentative = 0;
]
/ stimulusframes = [1=examplestim]
/ validresponse = (2, 3)
/ isvalidresponse = [
    if(trial.example.response == 2) {
        values.count_tentative += 1;
        false;
    } else if (trial.example.response == 3)
    {
        true;
    }
]
/ correctresponse = (3)
/ iscorrectresponse = [
    trial.example.response == 3 && values.count_tentative == 0;
]
</trial>

<text examplestim>
/ items = ("Press 1 or 2. 2 is the correct response")
</text>

<values>
/ count_tentative = 0
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>


I tried it... but it seeme don't work.... 
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
Kevin_Bague - 2/27/2020
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>

It's not stopped if you actually use /isvalidresponse properly.

<block myblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ posttrialpause = 1000
/ ontrialbegin = [
    values.count_tentative = 0;
]
/ stimulusframes = [1=examplestim]
/ validresponse = (2, 3)
/ isvalidresponse = [
    if(trial.example.response == 2) {
        values.count_tentative += 1;
        false;
    } else if (trial.example.response == 3)
    {
        true;
    }
]
/ correctresponse = (3)
/ iscorrectresponse = [
    trial.example.response == 3 && values.count_tentative == 0;
]
</trial>

<text examplestim>
/ items = ("Press 1 or 2. 2 is the correct response")
</text>

<values>
/ count_tentative = 0
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>


I tried it... but it seeme don't work.... 

What did you try and what doesn't seem to work?
Kevin_Bague
Kevin_Bague
Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)Associate Member (178 reputation)
Group: Forum Members
Posts: 15, Visits: 35
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>

It's not stopped if you actually use /isvalidresponse properly.

<block myblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ posttrialpause = 1000
/ ontrialbegin = [
    values.count_tentative = 0;
]
/ stimulusframes = [1=examplestim]
/ validresponse = (2, 3)
/ isvalidresponse = [
    if(trial.example.response == 2) {
        values.count_tentative += 1;
        false;
    } else if (trial.example.response == 3)
    {
        true;
    }
]
/ correctresponse = (3)
/ iscorrectresponse = [
    trial.example.response == 3 && values.count_tentative == 0;
]
</trial>

<text examplestim>
/ items = ("Press 1 or 2. 2 is the correct response")
</text>

<values>
/ count_tentative = 0
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>


I tried it... but it seeme don't work.... 

What did you try and what doesn't seem to work?

The count of tentative and correct response don't work... I have tried with your script and with my script in which I adapted your script :


<defaults >
/ screencolor = black
</defaults>

*************************************
SON

<item son >
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.son
</sound>

*************************************
FEEDBACK

<item réussi>
/ 1="Réussi !"
</item>

<item échec>
/ 1="Échec !"
</item>

<text réussi>
/ items = réussi
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text échec>
/ items = échec
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.réussi, 5000)
/ errormessage = true(text.échec, 5000)
/ stimulusframes = [1=son]
/ timeout = 5000
/ posttrialpause = 10000
/ validresponse = ("1")
/ isvalidresponse = [
  if(trial.uncontrolable.response =="1") {
   values.count_tentative += 1;
   false}]
        
/ ontrialend = [if (trial.uncontrolable.timeout)
    
]
</trial>
**********************************

<trial controlable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.réussi, 5000)
/ errormessage = true(text.échec, 5000)
/ stimulusframes = [1=son]
/ timeout = 5000
/ posttrialpause = 10000
/ validresponse = ("1")
/ isvalidresponse = [
  if(trial.controlable.response =="2") {
   values.count_tentative += 1;
   false;
  } else if (trial.controlable.response == "1")
  {
   true;
  }
]
/ correctresponse = ("1")
/ iscorrectresponse = [
  trial.controlable.response == "1"
]
/ ontrialend = [if (trial.controlable.timeout)
    
]
</trial>





******************

<values>
/ count_tentative = "0"
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>
<block >
/ trials = [1-3=trial.uncontrolable]
</block>








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
Kevin_Bague - 2/27/2020
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/27/2020
Kevin_Bague - 2/27/2020
Dave - 2/26/2020
Kevin_Bague - 2/26/2020
Hello I have a new question today. 

Is it possible to count the number of tentative in trials ?

In my task participants must stop a sound in pushing on a knob. But I would like record the number of tentative for each trial, that is the number of time that they have push on other knob.

Could I include 8 knobs in valid response and only one in correct response ? But how code bad response as 0 and correct as 1 ? 

Thanks 


You can use /isvalidresponse and/or /scorrectresponse logic to count the valid (but incorrect) response attempts.

<defaults >
/ screencolor = black
</defaults>

*************************************
SOUND

<item sound>
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.sound
</sound>

*************************************
FEEDBACK

<item success>
/ 1="Success!"
</item>

<item fail>
/ 1="Fail !"
</item>

<text sucess>
/ items = success
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text fail>
/ items = fail
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.success, 5000)
/ errormessage = true(text.fail, 5000)
/ stimulusframes = [1=sound]
/ timeout = 5000
/ posttrialpause = 10000
/ responseinterrupt = trial
/ isvalidresponse = ["1";"2"
]
/ ontrialend = [if (trial.uncontrolable.timeout > timeout)
 
]
</trial>

It's not stopped if you actually use /isvalidresponse properly.

<block myblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ posttrialpause = 1000
/ ontrialbegin = [
    values.count_tentative = 0;
]
/ stimulusframes = [1=examplestim]
/ validresponse = (2, 3)
/ isvalidresponse = [
    if(trial.example.response == 2) {
        values.count_tentative += 1;
        false;
    } else if (trial.example.response == 3)
    {
        true;
    }
]
/ correctresponse = (3)
/ iscorrectresponse = [
    trial.example.response == 3 && values.count_tentative == 0;
]
</trial>

<text examplestim>
/ items = ("Press 1 or 2. 2 is the correct response")
</text>

<values>
/ count_tentative = 0
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>


I tried it... but it seeme don't work.... 

What did you try and what doesn't seem to work?

The count of tentative and correct response don't work... I have tried with your script and with my script in which I adapted your script :


<defaults >
/ screencolor = black
</defaults>

*************************************
SON

<item son >
/ 1="3000Hz (5s).wav"
</item>

<sound son>
/ items = item.son
</sound>

*************************************
FEEDBACK

<item réussi>
/ 1="Réussi !"
</item>

<item échec>
/ 1="Échec !"
</item>

<text réussi>
/ items = réussi
/ txcolor =black
/ txbgcolor =darkgreen
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>

<text échec>
/ items = échec
/ txcolor =black
/ txbgcolor =crimson
/txcolor = (255,255,255)
/ size = (90%, 90%)
/ fontstyle = ("Times new roman", 50pt, true, false, false, false, 5, 0)
/ position = (50, 50)
</text>
*************************************

<trial uncontrolable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.réussi, 5000)
/ errormessage = true(text.échec, 5000)
/ stimulusframes = [1=son]
/ timeout = 5000
/ posttrialpause = 10000
/ validresponse = ("1")
/ isvalidresponse = [
  if(trial.uncontrolable.response =="1") {
   values.count_tentative += 1;
   false}]
        
/ ontrialend = [if (trial.uncontrolable.timeout)
    
]
</trial>
**********************************

<trial controlable >
/ beginresponseframe = -1
/ beginresponsetime = -1
/ correctmessage = true(text.réussi, 5000)
/ errormessage = true(text.échec, 5000)
/ stimulusframes = [1=son]
/ timeout = 5000
/ posttrialpause = 10000
/ validresponse = ("1")
/ isvalidresponse = [
  if(trial.controlable.response =="2") {
   values.count_tentative += 1;
   false;
  } else if (trial.controlable.response == "1")
  {
   true;
  }
]
/ correctresponse = ("1")
/ iscorrectresponse = [
  trial.controlable.response == "1"
]
/ ontrialend = [if (trial.controlable.timeout)
    
]
</trial>





******************

<values>
/ count_tentative = "0"
</values>

<data>
/ columns = (date time subject group trialnum trialcode response latency correct values.count_tentative)
/ separatefiles = true
</data>
<block >
/ trials = [1-3=trial.uncontrolable]
</block>








You really need to be clearer, please.

(1) "The count of tentative and correct response don't work... I have tried with your script "

Does it work or not work with the script I gave you? I have tested it and it does work for me, 100%.



(2) "... and with my script in which I adapted your script."

I'm sorry, but you did not adapt your script according to the example code I gave you.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search