Data recording for each trial in duplicates


Data recording for each trial in duplicates

Author
Message
SCHAMP
SCHAMP
New Member
New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)

Group: Forum Members
Posts: 7, Visits: 23
Hi, 
I'm an absolute beginner in Inquisit 5 trying to have participants make ratings of different faces. 
I've used the available Face Emotions script (Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC) as a basis to make a script which presents people with a total of 20 different faces under 'Happy' and 'Anger' emotion trials, and records info about the face gender, identity, whether they ID the emotion correctly, and how intense they report the emotion. 
The script is working, however when I run it the raw data produced is coming out with duplicate table rows for each trial (40 trials instead of 20). 
Parts of my script are included below. If anyone can see anything that would make the data come out in duplicates I would be very grateful! 
Thanks

************************************************************************
Parameters:

<parameters>
/group = 1
/pictureheight = 50%
/stimulusduration = 30
/ITI = 0
/emotionid_instruction = "To what extent did the face show:"
/intensity_instruction = "What was the intensity of the displayed emotion?"
</parameters>

************************************************************************
Angry Faces:

<item anger>
/1 = "1F_an_100.png"
/2 = "2F_an_100.png"
/3 = "3F_an_100.png"
/4 = "4F_an_100.png"
/5 = "5M_an_100.png"
/6 = "6M_an_100.png"
/7 = "7M_an_100.png"
/8 = "8M_an_100.png"
/9 = "9M_an_100.png"
/10 = "10F_an_100.png"
</item>

Happy Faces:


<item happiness>
/1 = "1F_ha_100.png"
/2 = "2F_ha_100.png"
/3 = "3F_ha_100.png"
/4 = "4F_ha_100.png"
/5 = "5M_ha_100.png"
/6 = "6M_ha_100.png"
/7 = "7M_ha_100.png"
/8 = "8M_ha_100.png"
/9 = "9M_ha_100.png"
/10 = "10F_ha_100.png"
</item>

Practise faces:

<item practiceitems>
/1 = "Practice1.png"
/2 = "Practice2.png"
</item>

******************************************************************
Expressions:

<expressions>

/gender = {
if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
1;
} else if (values.encoder == 3) {
1;
} else if (values.encoder == 4) {
1;
} else if (values.encoder == 5) {
2;
} else if (values.encoder == 6) {
2;
} else if (values.encoder == 7) {
2;
} else if (values.encoder == 8) {
2;
} else if (values.encoder == 9) {
2;
} else if (values.encoder == 10) {
1;
} else {"practice"};

}

/identity = {

if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
2;
} else if (values.encoder == 3) {
3;
} else if (values.encoder == 4) {
4;
} else if (values.encoder == 5) {
5;
} else if (values.encoder == 6) {
6;
} else if (values.encoder == 7) {
7;
} else if (values.encoder == 8) {
8;
} else if (values.encoder == 9) {
9;
} else if (values.encoder == 10) {
10;
} else {"practice"};

}
</expressions>

*********************************************************************
Instructions:

<instruct>
/ fontstyle = ("Arial", 2.80%, false, false, false, false, 5, 1)
/ txcolor = black
</instruct>

<page intro>
Welcome!

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensly that expression is being shown

^^^^^To practice the task, continue on to 2 practice trials.
</page>

<page practiceend>
You have reached the end of practice and the actual task is about to begin.
The actual task is just like practice:

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensely that expression is being shown

^^^^^To start the task, press the <SPACEBAR>
</page>


<page end>
You have reached the end of the task.
^^Thank you!
</page>

******************************************************************************
DEFAULTS

Script requires Inquisit 5.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
</defaults>

****************************************************************************
Data:

<data>
/columns = (date, time, subject, trialnum,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Summary Data:

<summarydata>
/columns = (script.subjectid, script.elapsedtime, values.completed, expressions.prop_emotion_accuracy)
/ separatefiles = true
</summarydata>

*************************************************************************
Values:
NB: NOT ALL LISTED WERE INCLUDED IN THIS STUDY

<values>
/completed = 0
/emotion = 0
/intensity = 0
/encoder = 0
/stimulusitem = ""
/emotion_accuracy = 0
/exp_intensity = 0

/sum_emotion_accuracy = 0
/count_emotionprofiles = 0
</values>


***************************************************************************
Expressions:
NB: Not used here

<expressions>
/prop_emotion_accuracy = values.sum_emotion_accuracy/values.count_emotionprofiles
</expressions>

**************************************************************************
Stimuli:

*************************************************
Emotion Stimuli: Test
*************************************************

<picture anger>
/items = anger
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>

<picture happiness>
/items = happiness
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Practice
*************************************************

<picture practice>
/items = practiceitems
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Emotion Profile Questions
*************************************************

<radiobuttons anger>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("2")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<radiobuttons happiness>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("1")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<slider intensity>
/ caption = "<%parameters.intensity_instruction%>"
/labels = ("0","10", "20", "30", "40", "50", "60", "70", "80", "90", "100")
/range = (0, 10)
/required = true
/ defaultresponse = 5
/slidersize = (50%, 3%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = black
</slider>

*************************************************************************
Trials:


**************************
Anger trials
**************************
<trial anger>
/ontrialbegin = [values.emotion = "anger"; values.intensity = 1]
/stimulusframes = [1 = anger]
/ontrialend = [values.stimulusitem = picture.anger.currentitem]
/ontrialend = [values.encoder = picture.anger.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_anger]
/recorddata = false
</trial>

<surveypage emotionprofile_anger>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend= [if (radiobuttons.anger.response == "2") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

**************************
Happiness trials
**************************
<trial happiness>
/ontrialbegin = [values.emotion = "happiness"; values.intensity = 1]
/stimulusframes = [1 = happiness]
/ontrialend = [values.stimulusitem = picture.happiness.currentitem]
/ontrialend = [values.encoder = picture.happiness.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_happiness]
/recorddata = false
</trial>

<surveypage emotionprofile_happiness>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.happiness;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend = [if (radiobuttons.happiness.response == "1") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ ontrialend = [if (values.emotion_accuracy == 1) values.sum_emotion_accuracy += 1]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

*****************************************
shared by all emotion trials
*****************************************
<trial ITI>
/trialduration = parameters.ITI
/recorddata = false
</trial>

**************************
Practice trials
**************************
<trial practice>
/ontrialbegin = [values.emotion = "practice"; values.intensity = "practice"]
/stimulusframes = [1 = practice]
/ontrialend = [values.stimulusitem = picture.practice.currentitem]
/ontrialend = [values.encoder = picture.practice.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.practiceprofile]
/recorddata = false
</trial>

<surveypage practiceprofile>
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/showpagenumbers = false
/showquestionnumbers = false
/branch = [trial.ITI]
/ontrialend = [values.emotion_accuracy = "N/A"]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/recorddata = false
</surveypage>

***********************************************************************************
Blocks:

<block practice>
/postinstructions = (practiceend)
/trials = [1-2 = practice]
</block>

<block FE>
/trials = [1-20 = noreplace(anger, happiness)]
</block>

</block>

***********************************************************************************
Experiment:

<expt>
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1 = practice; 2 = FE]
/onexptend = [values.completed = 1]
</expt>

Dave
Dave
Supreme Being
Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)

Group: Administrators
Posts: 9.4K, Visits: 42K
SCHAMP - Monday, March 25, 2019
Hi, 
I'm an absolute beginner in Inquisit 5 trying to have participants make ratings of different faces. 
I've used the available Face Emotions script (Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC) as a basis to make a script which presents people with a total of 20 different faces under 'Happy' and 'Anger' emotion trials, and records info about the face gender, identity, whether they ID the emotion correctly, and how intense they report the emotion. 
The script is working, however when I run it the raw data produced is coming out with duplicate table rows for each trial (40 trials instead of 20). 
Parts of my script are included below. If anyone can see anything that would make the data come out in duplicates I would be very grateful! 
Thanks

************************************************************************
Parameters:

<parameters>
/group = 1
/pictureheight = 50%
/stimulusduration = 30
/ITI = 0
/emotionid_instruction = "To what extent did the face show:"
/intensity_instruction = "What was the intensity of the displayed emotion?"
</parameters>

************************************************************************
Angry Faces:

<item anger>
/1 = "1F_an_100.png"
/2 = "2F_an_100.png"
/3 = "3F_an_100.png"
/4 = "4F_an_100.png"
/5 = "5M_an_100.png"
/6 = "6M_an_100.png"
/7 = "7M_an_100.png"
/8 = "8M_an_100.png"
/9 = "9M_an_100.png"
/10 = "10F_an_100.png"
</item>

Happy Faces:


<item happiness>
/1 = "1F_ha_100.png"
/2 = "2F_ha_100.png"
/3 = "3F_ha_100.png"
/4 = "4F_ha_100.png"
/5 = "5M_ha_100.png"
/6 = "6M_ha_100.png"
/7 = "7M_ha_100.png"
/8 = "8M_ha_100.png"
/9 = "9M_ha_100.png"
/10 = "10F_ha_100.png"
</item>

Practise faces:

<item practiceitems>
/1 = "Practice1.png"
/2 = "Practice2.png"
</item>

******************************************************************
Expressions:

<expressions>

/gender = {
if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
1;
} else if (values.encoder == 3) {
1;
} else if (values.encoder == 4) {
1;
} else if (values.encoder == 5) {
2;
} else if (values.encoder == 6) {
2;
} else if (values.encoder == 7) {
2;
} else if (values.encoder == 8) {
2;
} else if (values.encoder == 9) {
2;
} else if (values.encoder == 10) {
1;
} else {"practice"};

}

/identity = {

if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
2;
} else if (values.encoder == 3) {
3;
} else if (values.encoder == 4) {
4;
} else if (values.encoder == 5) {
5;
} else if (values.encoder == 6) {
6;
} else if (values.encoder == 7) {
7;
} else if (values.encoder == 8) {
8;
} else if (values.encoder == 9) {
9;
} else if (values.encoder == 10) {
10;
} else {"practice"};

}
</expressions>

*********************************************************************
Instructions:

<instruct>
/ fontstyle = ("Arial", 2.80%, false, false, false, false, 5, 1)
/ txcolor = black
</instruct>

<page intro>
Welcome!

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensly that expression is being shown

^^^^^To practice the task, continue on to 2 practice trials.
</page>

<page practiceend>
You have reached the end of practice and the actual task is about to begin.
The actual task is just like practice:

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensely that expression is being shown

^^^^^To start the task, press the <SPACEBAR>
</page>


<page end>
You have reached the end of the task.
^^Thank you!
</page>

******************************************************************************
DEFAULTS

Script requires Inquisit 5.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
</defaults>

****************************************************************************
Data:

<data>
/columns = (date, time, subject, trialnum,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Summary Data:

<summarydata>
/columns = (script.subjectid, script.elapsedtime, values.completed, expressions.prop_emotion_accuracy)
/ separatefiles = true
</summarydata>

*************************************************************************
Values:
NB: NOT ALL LISTED WERE INCLUDED IN THIS STUDY

<values>
/completed = 0
/emotion = 0
/intensity = 0
/encoder = 0
/stimulusitem = ""
/emotion_accuracy = 0
/exp_intensity = 0

/sum_emotion_accuracy = 0
/count_emotionprofiles = 0
</values>


***************************************************************************
Expressions:
NB: Not used here

<expressions>
/prop_emotion_accuracy = values.sum_emotion_accuracy/values.count_emotionprofiles
</expressions>

**************************************************************************
Stimuli:

*************************************************
Emotion Stimuli: Test
*************************************************

<picture anger>
/items = anger
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>

<picture happiness>
/items = happiness
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Practice
*************************************************

<picture practice>
/items = practiceitems
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Emotion Profile Questions
*************************************************

<radiobuttons anger>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("2")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<radiobuttons happiness>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("1")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<slider intensity>
/ caption = "<%parameters.intensity_instruction%>"
/labels = ("0","10", "20", "30", "40", "50", "60", "70", "80", "90", "100")
/range = (0, 10)
/required = true
/ defaultresponse = 5
/slidersize = (50%, 3%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = black
</slider>

*************************************************************************
Trials:


**************************
Anger trials
**************************
<trial anger>
/ontrialbegin = [values.emotion = "anger"; values.intensity = 1]
/stimulusframes = [1 = anger]
/ontrialend = [values.stimulusitem = picture.anger.currentitem]
/ontrialend = [values.encoder = picture.anger.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_anger]
/recorddata = false
</trial>

<surveypage emotionprofile_anger>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend= [if (radiobuttons.anger.response == "2") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

**************************
Happiness trials
**************************
<trial happiness>
/ontrialbegin = [values.emotion = "happiness"; values.intensity = 1]
/stimulusframes = [1 = happiness]
/ontrialend = [values.stimulusitem = picture.happiness.currentitem]
/ontrialend = [values.encoder = picture.happiness.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_happiness]
/recorddata = false
</trial>

<surveypage emotionprofile_happiness>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.happiness;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend = [if (radiobuttons.happiness.response == "1") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ ontrialend = [if (values.emotion_accuracy == 1) values.sum_emotion_accuracy += 1]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

*****************************************
shared by all emotion trials
*****************************************
<trial ITI>
/trialduration = parameters.ITI
/recorddata = false
</trial>

**************************
Practice trials
**************************
<trial practice>
/ontrialbegin = [values.emotion = "practice"; values.intensity = "practice"]
/stimulusframes = [1 = practice]
/ontrialend = [values.stimulusitem = picture.practice.currentitem]
/ontrialend = [values.encoder = picture.practice.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.practiceprofile]
/recorddata = false
</trial>

<surveypage practiceprofile>
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/showpagenumbers = false
/showquestionnumbers = false
/branch = [trial.ITI]
/ontrialend = [values.emotion_accuracy = "N/A"]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/recorddata = false
</surveypage>

***********************************************************************************
Blocks:

<block practice>
/postinstructions = (practiceend)
/trials = [1-2 = practice]
</block>

<block FE>
/trials = [1-20 = noreplace(anger, happiness)]
</block>

</block>

***********************************************************************************
Experiment:

<expt>
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1 = practice; 2 = FE]
/onexptend = [values.completed = 1]
</expt>

Each of your <surveypage>s (i.e. trials) has two questions on it. Each question gets its own line in the data file, i.e. two rows per trial. That is the expected result. You can see this clearly if you log trialcode and response to the data file:

<data>
/columns = (date, time, subject, trialnum, trialcode, response,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Also note that trialnum is identical in the two rows that make up one "trial."


SCHAMP
SCHAMP
New Member
New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)

Group: Forum Members
Posts: 7, Visits: 23
Dave - Monday, March 25, 2019
SCHAMP - Monday, March 25, 2019
Hi, 
I'm an absolute beginner in Inquisit 5 trying to have participants make ratings of different faces. 
I've used the available Face Emotions script (Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC) as a basis to make a script which presents people with a total of 20 different faces under 'Happy' and 'Anger' emotion trials, and records info about the face gender, identity, whether they ID the emotion correctly, and how intense they report the emotion. 
The script is working, however when I run it the raw data produced is coming out with duplicate table rows for each trial (40 trials instead of 20). 
Parts of my script are included below. If anyone can see anything that would make the data come out in duplicates I would be very grateful! 
Thanks

************************************************************************
Parameters:

<parameters>
/group = 1
/pictureheight = 50%
/stimulusduration = 30
/ITI = 0
/emotionid_instruction = "To what extent did the face show:"
/intensity_instruction = "What was the intensity of the displayed emotion?"
</parameters>

************************************************************************
Angry Faces:

<item anger>
/1 = "1F_an_100.png"
/2 = "2F_an_100.png"
/3 = "3F_an_100.png"
/4 = "4F_an_100.png"
/5 = "5M_an_100.png"
/6 = "6M_an_100.png"
/7 = "7M_an_100.png"
/8 = "8M_an_100.png"
/9 = "9M_an_100.png"
/10 = "10F_an_100.png"
</item>

Happy Faces:


<item happiness>
/1 = "1F_ha_100.png"
/2 = "2F_ha_100.png"
/3 = "3F_ha_100.png"
/4 = "4F_ha_100.png"
/5 = "5M_ha_100.png"
/6 = "6M_ha_100.png"
/7 = "7M_ha_100.png"
/8 = "8M_ha_100.png"
/9 = "9M_ha_100.png"
/10 = "10F_ha_100.png"
</item>

Practise faces:

<item practiceitems>
/1 = "Practice1.png"
/2 = "Practice2.png"
</item>

******************************************************************
Expressions:

<expressions>

/gender = {
if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
1;
} else if (values.encoder == 3) {
1;
} else if (values.encoder == 4) {
1;
} else if (values.encoder == 5) {
2;
} else if (values.encoder == 6) {
2;
} else if (values.encoder == 7) {
2;
} else if (values.encoder == 8) {
2;
} else if (values.encoder == 9) {
2;
} else if (values.encoder == 10) {
1;
} else {"practice"};

}

/identity = {

if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
2;
} else if (values.encoder == 3) {
3;
} else if (values.encoder == 4) {
4;
} else if (values.encoder == 5) {
5;
} else if (values.encoder == 6) {
6;
} else if (values.encoder == 7) {
7;
} else if (values.encoder == 8) {
8;
} else if (values.encoder == 9) {
9;
} else if (values.encoder == 10) {
10;
} else {"practice"};

}
</expressions>

*********************************************************************
Instructions:

<instruct>
/ fontstyle = ("Arial", 2.80%, false, false, false, false, 5, 1)
/ txcolor = black
</instruct>

<page intro>
Welcome!

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensly that expression is being shown

^^^^^To practice the task, continue on to 2 practice trials.
</page>

<page practiceend>
You have reached the end of practice and the actual task is about to begin.
The actual task is just like practice:

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensely that expression is being shown

^^^^^To start the task, press the <SPACEBAR>
</page>


<page end>
You have reached the end of the task.
^^Thank you!
</page>

******************************************************************************
DEFAULTS

Script requires Inquisit 5.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
</defaults>

****************************************************************************
Data:

<data>
/columns = (date, time, subject, trialnum,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Summary Data:

<summarydata>
/columns = (script.subjectid, script.elapsedtime, values.completed, expressions.prop_emotion_accuracy)
/ separatefiles = true
</summarydata>

*************************************************************************
Values:
NB: NOT ALL LISTED WERE INCLUDED IN THIS STUDY

<values>
/completed = 0
/emotion = 0
/intensity = 0
/encoder = 0
/stimulusitem = ""
/emotion_accuracy = 0
/exp_intensity = 0

/sum_emotion_accuracy = 0
/count_emotionprofiles = 0
</values>


***************************************************************************
Expressions:
NB: Not used here

<expressions>
/prop_emotion_accuracy = values.sum_emotion_accuracy/values.count_emotionprofiles
</expressions>

**************************************************************************
Stimuli:

*************************************************
Emotion Stimuli: Test
*************************************************

<picture anger>
/items = anger
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>

<picture happiness>
/items = happiness
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Practice
*************************************************

<picture practice>
/items = practiceitems
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Emotion Profile Questions
*************************************************

<radiobuttons anger>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("2")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<radiobuttons happiness>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("1")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<slider intensity>
/ caption = "<%parameters.intensity_instruction%>"
/labels = ("0","10", "20", "30", "40", "50", "60", "70", "80", "90", "100")
/range = (0, 10)
/required = true
/ defaultresponse = 5
/slidersize = (50%, 3%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = black
</slider>

*************************************************************************
Trials:


**************************
Anger trials
**************************
<trial anger>
/ontrialbegin = [values.emotion = "anger"; values.intensity = 1]
/stimulusframes = [1 = anger]
/ontrialend = [values.stimulusitem = picture.anger.currentitem]
/ontrialend = [values.encoder = picture.anger.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_anger]
/recorddata = false
</trial>

<surveypage emotionprofile_anger>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend= [if (radiobuttons.anger.response == "2") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

**************************
Happiness trials
**************************
<trial happiness>
/ontrialbegin = [values.emotion = "happiness"; values.intensity = 1]
/stimulusframes = [1 = happiness]
/ontrialend = [values.stimulusitem = picture.happiness.currentitem]
/ontrialend = [values.encoder = picture.happiness.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_happiness]
/recorddata = false
</trial>

<surveypage emotionprofile_happiness>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.happiness;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend = [if (radiobuttons.happiness.response == "1") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ ontrialend = [if (values.emotion_accuracy == 1) values.sum_emotion_accuracy += 1]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

*****************************************
shared by all emotion trials
*****************************************
<trial ITI>
/trialduration = parameters.ITI
/recorddata = false
</trial>

**************************
Practice trials
**************************
<trial practice>
/ontrialbegin = [values.emotion = "practice"; values.intensity = "practice"]
/stimulusframes = [1 = practice]
/ontrialend = [values.stimulusitem = picture.practice.currentitem]
/ontrialend = [values.encoder = picture.practice.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.practiceprofile]
/recorddata = false
</trial>

<surveypage practiceprofile>
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/showpagenumbers = false
/showquestionnumbers = false
/branch = [trial.ITI]
/ontrialend = [values.emotion_accuracy = "N/A"]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/recorddata = false
</surveypage>

***********************************************************************************
Blocks:

<block practice>
/postinstructions = (practiceend)
/trials = [1-2 = practice]
</block>

<block FE>
/trials = [1-20 = noreplace(anger, happiness)]
</block>

</block>

***********************************************************************************
Experiment:

<expt>
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1 = practice; 2 = FE]
/onexptend = [values.completed = 1]
</expt>

Each of your <surveypage>s (i.e. trials) has two questions on it. Each question gets its own line in the data file, i.e. two rows per trial. That is the expected result. You can see this clearly if you log trialcode and response to the data file:

<data>
/columns = (date, time, subject, trialnum, trialcode, response,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Also note that trialnum is identical in the two rows that make up one "trial."


Thank you so much! 
I've coded the responses to each of the separate questions in each trial to appear under the values.emotion_accuracy and values.exp_intensity columns, which it looks like is the part that id being "duplicated" by having 1 row per question response. Is there any way to make the data record as a single trial ignoring those 'raw' responses under the response column but keeping the coded responses under values.emotion_accuracy and values.exp_intensity? 

Thanks again. 



Dave
Dave
Supreme Being
Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)

Group: Administrators
Posts: 9.4K, Visits: 42K
SCHAMP - Monday, March 25, 2019
Dave - Monday, March 25, 2019
SCHAMP - Monday, March 25, 2019
Hi, 
I'm an absolute beginner in Inquisit 5 trying to have participants make ratings of different faces. 
I've used the available Face Emotions script (Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC) as a basis to make a script which presents people with a total of 20 different faces under 'Happy' and 'Anger' emotion trials, and records info about the face gender, identity, whether they ID the emotion correctly, and how intense they report the emotion. 
The script is working, however when I run it the raw data produced is coming out with duplicate table rows for each trial (40 trials instead of 20). 
Parts of my script are included below. If anyone can see anything that would make the data come out in duplicates I would be very grateful! 
Thanks

************************************************************************
Parameters:

<parameters>
/group = 1
/pictureheight = 50%
/stimulusduration = 30
/ITI = 0
/emotionid_instruction = "To what extent did the face show:"
/intensity_instruction = "What was the intensity of the displayed emotion?"
</parameters>

************************************************************************
Angry Faces:

<item anger>
/1 = "1F_an_100.png"
/2 = "2F_an_100.png"
/3 = "3F_an_100.png"
/4 = "4F_an_100.png"
/5 = "5M_an_100.png"
/6 = "6M_an_100.png"
/7 = "7M_an_100.png"
/8 = "8M_an_100.png"
/9 = "9M_an_100.png"
/10 = "10F_an_100.png"
</item>

Happy Faces:


<item happiness>
/1 = "1F_ha_100.png"
/2 = "2F_ha_100.png"
/3 = "3F_ha_100.png"
/4 = "4F_ha_100.png"
/5 = "5M_ha_100.png"
/6 = "6M_ha_100.png"
/7 = "7M_ha_100.png"
/8 = "8M_ha_100.png"
/9 = "9M_ha_100.png"
/10 = "10F_ha_100.png"
</item>

Practise faces:

<item practiceitems>
/1 = "Practice1.png"
/2 = "Practice2.png"
</item>

******************************************************************
Expressions:

<expressions>

/gender = {
if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
1;
} else if (values.encoder == 3) {
1;
} else if (values.encoder == 4) {
1;
} else if (values.encoder == 5) {
2;
} else if (values.encoder == 6) {
2;
} else if (values.encoder == 7) {
2;
} else if (values.encoder == 8) {
2;
} else if (values.encoder == 9) {
2;
} else if (values.encoder == 10) {
1;
} else {"practice"};

}

/identity = {

if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
2;
} else if (values.encoder == 3) {
3;
} else if (values.encoder == 4) {
4;
} else if (values.encoder == 5) {
5;
} else if (values.encoder == 6) {
6;
} else if (values.encoder == 7) {
7;
} else if (values.encoder == 8) {
8;
} else if (values.encoder == 9) {
9;
} else if (values.encoder == 10) {
10;
} else {"practice"};

}
</expressions>

*********************************************************************
Instructions:

<instruct>
/ fontstyle = ("Arial", 2.80%, false, false, false, false, 5, 1)
/ txcolor = black
</instruct>

<page intro>
Welcome!

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensly that expression is being shown

^^^^^To practice the task, continue on to 2 practice trials.
</page>

<page practiceend>
You have reached the end of practice and the actual task is about to begin.
The actual task is just like practice:

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensely that expression is being shown

^^^^^To start the task, press the <SPACEBAR>
</page>


<page end>
You have reached the end of the task.
^^Thank you!
</page>

******************************************************************************
DEFAULTS

Script requires Inquisit 5.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
</defaults>

****************************************************************************
Data:

<data>
/columns = (date, time, subject, trialnum,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Summary Data:

<summarydata>
/columns = (script.subjectid, script.elapsedtime, values.completed, expressions.prop_emotion_accuracy)
/ separatefiles = true
</summarydata>

*************************************************************************
Values:
NB: NOT ALL LISTED WERE INCLUDED IN THIS STUDY

<values>
/completed = 0
/emotion = 0
/intensity = 0
/encoder = 0
/stimulusitem = ""
/emotion_accuracy = 0
/exp_intensity = 0

/sum_emotion_accuracy = 0
/count_emotionprofiles = 0
</values>


***************************************************************************
Expressions:
NB: Not used here

<expressions>
/prop_emotion_accuracy = values.sum_emotion_accuracy/values.count_emotionprofiles
</expressions>

**************************************************************************
Stimuli:

*************************************************
Emotion Stimuli: Test
*************************************************

<picture anger>
/items = anger
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>

<picture happiness>
/items = happiness
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Practice
*************************************************

<picture practice>
/items = practiceitems
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Emotion Profile Questions
*************************************************

<radiobuttons anger>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("2")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<radiobuttons happiness>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("1")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<slider intensity>
/ caption = "<%parameters.intensity_instruction%>"
/labels = ("0","10", "20", "30", "40", "50", "60", "70", "80", "90", "100")
/range = (0, 10)
/required = true
/ defaultresponse = 5
/slidersize = (50%, 3%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = black
</slider>

*************************************************************************
Trials:


**************************
Anger trials
**************************
<trial anger>
/ontrialbegin = [values.emotion = "anger"; values.intensity = 1]
/stimulusframes = [1 = anger]
/ontrialend = [values.stimulusitem = picture.anger.currentitem]
/ontrialend = [values.encoder = picture.anger.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_anger]
/recorddata = false
</trial>

<surveypage emotionprofile_anger>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend= [if (radiobuttons.anger.response == "2") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

**************************
Happiness trials
**************************
<trial happiness>
/ontrialbegin = [values.emotion = "happiness"; values.intensity = 1]
/stimulusframes = [1 = happiness]
/ontrialend = [values.stimulusitem = picture.happiness.currentitem]
/ontrialend = [values.encoder = picture.happiness.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_happiness]
/recorddata = false
</trial>

<surveypage emotionprofile_happiness>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.happiness;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend = [if (radiobuttons.happiness.response == "1") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ ontrialend = [if (values.emotion_accuracy == 1) values.sum_emotion_accuracy += 1]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

*****************************************
shared by all emotion trials
*****************************************
<trial ITI>
/trialduration = parameters.ITI
/recorddata = false
</trial>

**************************
Practice trials
**************************
<trial practice>
/ontrialbegin = [values.emotion = "practice"; values.intensity = "practice"]
/stimulusframes = [1 = practice]
/ontrialend = [values.stimulusitem = picture.practice.currentitem]
/ontrialend = [values.encoder = picture.practice.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.practiceprofile]
/recorddata = false
</trial>

<surveypage practiceprofile>
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/showpagenumbers = false
/showquestionnumbers = false
/branch = [trial.ITI]
/ontrialend = [values.emotion_accuracy = "N/A"]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/recorddata = false
</surveypage>

***********************************************************************************
Blocks:

<block practice>
/postinstructions = (practiceend)
/trials = [1-2 = practice]
</block>

<block FE>
/trials = [1-20 = noreplace(anger, happiness)]
</block>

</block>

***********************************************************************************
Experiment:

<expt>
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1 = practice; 2 = FE]
/onexptend = [values.completed = 1]
</expt>

Each of your <surveypage>s (i.e. trials) has two questions on it. Each question gets its own line in the data file, i.e. two rows per trial. That is the expected result. You can see this clearly if you log trialcode and response to the data file:

<data>
/columns = (date, time, subject, trialnum, trialcode, response,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Also note that trialnum is identical in the two rows that make up one "trial."


Thank you so much! 
I've coded the responses to each of the separate questions in each trial to appear under the values.emotion_accuracy and values.exp_intensity columns, which it looks like is the part that id being "duplicated" by having 1 row per question response. Is there any way to make the data record as a single trial ignoring those 'raw' responses under the response column but keeping the coded responses under values.emotion_accuracy and values.exp_intensity? 

Thanks again. 



Yeah, that is possible. As in the original script you based this on, you can set the <surveypage>s' /recorddata attribute to false and have the a diifferent <trial> write a single row of data to the data file instead. In the original script <surveypage dailyoccurence> serves that purpose; you don't use that one, but you can have <trial ITI> perform that function instead -- simply set its /recorddata attribute to true.

SCHAMP
SCHAMP
New Member
New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)New Member (38 reputation)

Group: Forum Members
Posts: 7, Visits: 23
Dave - Tuesday, March 26, 2019
SCHAMP - Monday, March 25, 2019
Dave - Monday, March 25, 2019
SCHAMP - Monday, March 25, 2019
Hi, 
I'm an absolute beginner in Inquisit 5 trying to have participants make ratings of different faces. 
I've used the available Face Emotions script (Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC) as a basis to make a script which presents people with a total of 20 different faces under 'Happy' and 'Anger' emotion trials, and records info about the face gender, identity, whether they ID the emotion correctly, and how intense they report the emotion. 
The script is working, however when I run it the raw data produced is coming out with duplicate table rows for each trial (40 trials instead of 20). 
Parts of my script are included below. If anyone can see anything that would make the data come out in duplicates I would be very grateful! 
Thanks

************************************************************************
Parameters:

<parameters>
/group = 1
/pictureheight = 50%
/stimulusduration = 30
/ITI = 0
/emotionid_instruction = "To what extent did the face show:"
/intensity_instruction = "What was the intensity of the displayed emotion?"
</parameters>

************************************************************************
Angry Faces:

<item anger>
/1 = "1F_an_100.png"
/2 = "2F_an_100.png"
/3 = "3F_an_100.png"
/4 = "4F_an_100.png"
/5 = "5M_an_100.png"
/6 = "6M_an_100.png"
/7 = "7M_an_100.png"
/8 = "8M_an_100.png"
/9 = "9M_an_100.png"
/10 = "10F_an_100.png"
</item>

Happy Faces:


<item happiness>
/1 = "1F_ha_100.png"
/2 = "2F_ha_100.png"
/3 = "3F_ha_100.png"
/4 = "4F_ha_100.png"
/5 = "5M_ha_100.png"
/6 = "6M_ha_100.png"
/7 = "7M_ha_100.png"
/8 = "8M_ha_100.png"
/9 = "9M_ha_100.png"
/10 = "10F_ha_100.png"
</item>

Practise faces:

<item practiceitems>
/1 = "Practice1.png"
/2 = "Practice2.png"
</item>

******************************************************************
Expressions:

<expressions>

/gender = {
if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
1;
} else if (values.encoder == 3) {
1;
} else if (values.encoder == 4) {
1;
} else if (values.encoder == 5) {
2;
} else if (values.encoder == 6) {
2;
} else if (values.encoder == 7) {
2;
} else if (values.encoder == 8) {
2;
} else if (values.encoder == 9) {
2;
} else if (values.encoder == 10) {
1;
} else {"practice"};

}

/identity = {

if (values.encoder == 1) {
1;
} else if (values.encoder == 2) {
2;
} else if (values.encoder == 3) {
3;
} else if (values.encoder == 4) {
4;
} else if (values.encoder == 5) {
5;
} else if (values.encoder == 6) {
6;
} else if (values.encoder == 7) {
7;
} else if (values.encoder == 8) {
8;
} else if (values.encoder == 9) {
9;
} else if (values.encoder == 10) {
10;
} else {"practice"};

}
</expressions>

*********************************************************************
Instructions:

<instruct>
/ fontstyle = ("Arial", 2.80%, false, false, false, false, 5, 1)
/ txcolor = black
</instruct>

<page intro>
Welcome!

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensly that expression is being shown

^^^^^To practice the task, continue on to 2 practice trials.
</page>

<page practiceend>
You have reached the end of practice and the actual task is about to begin.
The actual task is just like practice:

^^You will be presented with pictures of people showing different facial expressions at different intensities. You will see
each facial expression for <%parameters.stimulusduration/1000%> seconds. Then you will be asked
to
^^^1) Identify which facial expression is being shown
^^2) Rate how intensely that expression is being shown

^^^^^To start the task, press the <SPACEBAR>
</page>


<page end>
You have reached the end of the task.
^^Thank you!
</page>

******************************************************************************
DEFAULTS

Script requires Inquisit 5.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "5.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
</defaults>

****************************************************************************
Data:

<data>
/columns = (date, time, subject, trialnum,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Summary Data:

<summarydata>
/columns = (script.subjectid, script.elapsedtime, values.completed, expressions.prop_emotion_accuracy)
/ separatefiles = true
</summarydata>

*************************************************************************
Values:
NB: NOT ALL LISTED WERE INCLUDED IN THIS STUDY

<values>
/completed = 0
/emotion = 0
/intensity = 0
/encoder = 0
/stimulusitem = ""
/emotion_accuracy = 0
/exp_intensity = 0

/sum_emotion_accuracy = 0
/count_emotionprofiles = 0
</values>


***************************************************************************
Expressions:
NB: Not used here

<expressions>
/prop_emotion_accuracy = values.sum_emotion_accuracy/values.count_emotionprofiles
</expressions>

**************************************************************************
Stimuli:

*************************************************
Emotion Stimuli: Test
*************************************************

<picture anger>
/items = anger
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>

<picture happiness>
/items = happiness
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Practice
*************************************************

<picture practice>
/items = practiceitems
/select = noreplace
/size = (100%, parameters.pictureheight)
/position = (50%, 50%)
</picture>


*************************************************
Emotion Profile Questions
*************************************************

<radiobuttons anger>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("2")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<radiobuttons happiness>
/ options=("Happiness", "Anger")
/optionvalues = ("1", "2")
/validresponse = ("1", "2")
/correctresponse = ("1")
/ fontstyle = ("Arial", 1.5%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ required=true
/ orientation = vertical
</radiobuttons>

<slider intensity>
/ caption = "<%parameters.intensity_instruction%>"
/labels = ("0","10", "20", "30", "40", "50", "60", "70", "80", "90", "100")
/range = (0, 10)
/required = true
/ defaultresponse = 5
/slidersize = (50%, 3%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = black
</slider>

*************************************************************************
Trials:


**************************
Anger trials
**************************
<trial anger>
/ontrialbegin = [values.emotion = "anger"; values.intensity = 1]
/stimulusframes = [1 = anger]
/ontrialend = [values.stimulusitem = picture.anger.currentitem]
/ontrialend = [values.encoder = picture.anger.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_anger]
/recorddata = false
</trial>

<surveypage emotionprofile_anger>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend= [if (radiobuttons.anger.response == "2") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

**************************
Happiness trials
**************************
<trial happiness>
/ontrialbegin = [values.emotion = "happiness"; values.intensity = 1]
/stimulusframes = [1 = happiness]
/ontrialend = [values.stimulusitem = picture.happiness.currentitem]
/ontrialend = [values.encoder = picture.happiness.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.emotionprofile_happiness]
/recorddata = false
</trial>

<surveypage emotionprofile_happiness>
/ ontrialbegin = [values.count_emotionprofiles += 1]
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.happiness;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/ontrialend = [if (radiobuttons.happiness.response == "1") values.emotion_accuracy = 1 else values.emotion_accuracy = 0]
/ ontrialend = [if (values.emotion_accuracy == 1) values.sum_emotion_accuracy += 1]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/branch = [trial.ITI]
/showpagenumbers = false
/showquestionnumbers = false
/recorddata = true
</surveypage>

*****************************************
shared by all emotion trials
*****************************************
<trial ITI>
/trialduration = parameters.ITI
/recorddata = false
</trial>

**************************
Practice trials
**************************
<trial practice>
/ontrialbegin = [values.emotion = "practice"; values.intensity = "practice"]
/stimulusframes = [1 = practice]
/ontrialend = [values.stimulusitem = picture.practice.currentitem]
/ontrialend = [values.encoder = picture.practice.currentitemnumber]
/timeout = parameters.stimulusduration
/branch = [surveypage.practiceprofile]
/recorddata = false
</trial>

<surveypage practiceprofile>
/caption = "<%parameters.emotionid_instruction%>"
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ txcolor = black
/questions = [1=radiobuttons.anger;2=slider.intensity]
/itemspacing = 5
/ nextbuttonposition = (90%, 90%)
/showbackbutton = false
/showpagenumbers = false
/showquestionnumbers = false
/branch = [trial.ITI]
/ontrialend = [values.emotion_accuracy = "N/A"]
/ontrialend = [values.exp_intensity = slider.intensity.response]
/recorddata = false
</surveypage>

***********************************************************************************
Blocks:

<block practice>
/postinstructions = (practiceend)
/trials = [1-2 = practice]
</block>

<block FE>
/trials = [1-20 = noreplace(anger, happiness)]
</block>

</block>

***********************************************************************************
Experiment:

<expt>
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1 = practice; 2 = FE]
/onexptend = [values.completed = 1]
</expt>

Each of your <surveypage>s (i.e. trials) has two questions on it. Each question gets its own line in the data file, i.e. two rows per trial. That is the expected result. You can see this clearly if you log trialcode and response to the data file:

<data>
/columns = (date, time, subject, trialnum, trialcode, response,
values.emotion, expressions.gender, expressions.identity,
values.stimulusitem, values.emotion_accuracy, values.exp_intensity)
/separatefiles = true
</data>

Also note that trialnum is identical in the two rows that make up one "trial."


Thank you so much! 
I've coded the responses to each of the separate questions in each trial to appear under the values.emotion_accuracy and values.exp_intensity columns, which it looks like is the part that id being "duplicated" by having 1 row per question response. Is there any way to make the data record as a single trial ignoring those 'raw' responses under the response column but keeping the coded responses under values.emotion_accuracy and values.exp_intensity? 

Thanks again. 



Yeah, that is possible. As in the original script you based this on, you can set the <surveypage>s' /recorddata attribute to false and have the a diifferent <trial> write a single row of data to the data file instead. In the original script <surveypage dailyoccurence> serves that purpose; you don't use that one, but you can have <trial ITI> perform that function instead -- simply set its /recorddata attribute to true.

Wonderful thank you!! 
GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search