Millisecond Forums

Image Rating Task

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

By ldobb - 4/5/2016

Hello there!

I'm setting up a task where participants view an image for a few seconds and then answer two followup surveypage/slider questions about the image. I have two categories of images. I'm currently trying to figure out how, using values and expressions, I can generate a value for "average slider rating" on each question in each category as well as average latency for each question/category.

Here is what I've started with - please not that it's a complete mess, I'm basically just trying things out until I figure out how to best score this. All feedback is greatly appreciated.


<picture alc>
/ items = (
"1P_1.jpg","1P_2.jpg","1P_3.jpg","1P_4.jpg","1P_5.jpg",
"1P_6.jpg","1P_7.jpg","1P_8.jpg","1P_9.jpg","1P_10.jpg",
"1P_11.jpg","1P_12.jpg","1P_13.jpg","1P_14.jpg","1P_15.jpg",
"1P_16.jpg","1P_17.jpg","1P_18.jpg")
/ select = noreplace
/ size = (90%, 90%)
</picture>

<picture nonalc>
/ items = ("2P_1.jpg","2P_2.jpg",
"2P_3.jpg","2P_4.jpg","2P_5.jpg","2P_6.jpg","2P_7.jpg",
"2P_8.jpg","2P_9.jpg","2P_10.jpg","2P_11.jpg","2P_12.jpg",
"2P_13.jpg","2P_14.jpg","2P_15.jpg","2P_16.jpg","2P_17.jpg","2P_18.jpg")
/ select = noreplace
/ size = (90%, 90%)
</picture>

<trial alc>
/ stimulustimes = [0 = alc]
/ validresponse = (0)
/ correctresponse = (0)
/ trialduration = 3000
/ branch = [if(trial.alc.correct) surveypage.pic_surv1]
/ ontrialbegin = [values.category = 1]
</trial>

<values>
/ category = 0
/ alcenjrating = 0
</values>

<expressions>
/ meanalcscore = trial.alc.response
/ alclatenjoy = [if (values.category == 1) meanlatency (surveypage.pic_surv1)]
/ nonalclatenjoy = [if (values.category == 2) meanlatency (surveypage.pic_surv1)]
</expressions>

<trial nonalc>
/ stimulustimes = [0 = nonalc]
/ validresponse = (0)
/ correctresponse = (0)
/ trialduration = 3000
/ branch = [if(trial.nonalc.correct) surveypage.pic_surv1]
/ ontrialbegin = [values.category = 2]
</trial>

<surveypage pic_surv1>
/ branch = [if(slider.stim_slider1.response = true) surveypage.pic_surv2]
/ questions = [1 = stim_slider1]
/ stimulusframes = [1 = slider_q1, slider_l1, slider_r1, slider_remind]
/ showpagenumbers = false
/ showquestionnumbers = false
/ finishlabel = "Submit"
/ navigationbuttonfontstyle = ("Arial", 2.5%, true)
/ nextbuttonposition = (46.75%, 70%)
/ ontrialbegin = [if (values.category == 1) values.category = 1 || if (values.category == 2) values.category = 2]
/ ontrialend = [if (values.category == 1) values.alcenjrating = surveypage.pic_surv1.response]
</surveypage>

<surveypage pic_surv2>
/ questions = [1 = stim_slider2]
/ stimulusframes = [1 = slider_q2, slider_l2, slider_r2, slider_remind]
/ showpagenumbers = false
/ showquestionnumbers = false
/ finishlabel = "Submit"
/ navigationbuttonfontstyle = ("Arial", 2.5%, true)
/ nextbuttonposition = (46.75%, 70%)
</surveypage>

<slider stim_slider1>
/ range = (0, 100)
/ increment = 1
/ slidersize = (100%, 50%)
/ position = (10%, 50%)
/ showtooltips = false
</slider>

<slider stim_slider2>
/ range = (0, 100)
/ increment = 1
/ slidersize = (100%, 50%)
/ position = (10%, 50%)
/ showtooltips = false
</slider>

<text slider_q1>
/ items = ("How much would you ENJOY drinking this beverage?")
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 4%, true)
/ position = (50%, 40%)
</text>

<text slider_q2>
/ items = ("How much do you WANT this beverage right now?")
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 4%, true)
/ position = (50%, 40%)
</text>

<text slider_remind>
/ items = ("Drag the slider along the line to select your response.")
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 2%, true)
/ position = (50%, 45%)
/ txcolor = (64, 64, 64)
</text>

<text slider_l1>
/ items = ("I would not enjoy it at all.")
/ fontstyle = ("Arial", 2.25%, true)
/ position = (10%, 56%)
</text>

<text slider_r1>
/ items = ("I would enjoy this a lot.")
/ fontstyle = ("Arial", 2.25%, true)
/ position = (90%, 56%)
</text>

<text slider_l2>
/ items = ("I do not want this beverage at all right now.")
/ fontstyle = ("Arial", 2.25%, true)
/ position = (15%, 56%)
</text>

<text slider_r2>
/ items = ("I really want this beverage right now.")
/ fontstyle = ("Arial", 2.25%, true)
/ position = (85%, 56%)
</text>





By ldobb - 4/5/2016

Just to outline my objectives: 
- I would like there to be an average slider response for both questions divided by category (this is what I was trying to get at by assigning category values)
- It would also be great if those could come with an average latency, which seems to be a bit more straightforward in Inquisit
- I think that since I used a lot of branching/responsetrial type of stuff, I'm concerned I won't be able to understand what a certain value/response is referring to....agh.

I've combed the boards and the tutorials, but please let me know if there is a similar template I can work with. This has been very helpful in the past.
By Dave - 4/5/2016

Just sum the the ratings and latencies up by category and divide by N.

<values>
/ currentcategory = ""

/ cat_a_q1_sum = 0
/ cat_a_q2_sum = 0
/ cat_a_rt_sum = 0
/ cat_a_n = 0

/ cat_b_q1_sum = 0
/ cat_b_q2_sum = 0
/ cat_b_rt_sum = 0
/ cat_b_n = 0

</values>

<expressions>
/ cat_a_q1_meanrating = (values.cat_a_q1_sum/values.cat_a_n)
/ cat_a_q2_meanrating = (values.cat_a_q2_sum/values.cat_a_n)
/ cat_a_meanrt = (values.cat_a_rt_sum/values.cat_a_n)

/ cat_b_q1_meanrating = (values.cat_b_q1_sum/values.cat_b_n)
/ cat_b_q2_meanrating = (values.cat_b_q2_sum/values.cat_b_n)
/ cat_b_meanrt = (values.cat_b_rt_sum/values.cat_b_n)
</expressions>

<block myblock>
/ trials = [1-8 = noreplace(cat_a_trial, cat_b_trial)]
</block>

<trial cat_a_trial>
/ ontrialbegin = [values.currentcategory = "a"]
/ stimulusframes = [1=a_stim]
/ validresponse = (0)
/ trialduration = 3000
/ branch = [surveypage.rating]
</trial>

<trial cat_b_trial>
/ ontrialbegin = [values.currentcategory = "b"]
/ stimulusframes = [1=b_stim]
/ validresponse = (0)
/ trialduration = 3000
/ branch = [surveypage.rating]
</trial>

<text a_stim>
/ items = ("A1", "A2", "A3", "A4")
</text>

<text b_stim>
/ items = ("B1", "B2", "B3", "B4")
</text>


<surveypage rating>
/ ontrialend = [if (values.currentcategory == "a") {values.cat_a_n += 1;
    values.cat_a_q1_sum += slider.q1.response;
    values.cat_a_q2_sum += slider.q2.response;
    values.cat_a_rt_sum += surveypage.rating.latency; };
    ]
/ ontrialend = [if (values.currentcategory == "b") {values.cat_b_n += 1;
    values.cat_b_q1_sum += slider.q1.response;
    values.cat_b_q2_sum += slider.q2.response;
    values.cat_b_rt_sum += surveypage.rating.latency; };
    ]
/ questions = [1=q1; 2=q2]
</surveypage>

<slider q1>
/ caption = "Q1"
/ range = (0, 100)
</slider>

<slider q2>
/ caption = "Q2"
/ range = (0, 100)
</slider>

<data>
/ columns = [date time subject group blocknum blockcode trialnum trialcode stimulusitem response latency values.currentcategory
    values.cat_a_n values.cat_a_q1_sum values.cat_a_q2_sum values.cat_a_rt_sum
    values.cat_b_n values.cat_b_q1_sum values.cat_b_q2_sum values.cat_b_rt_sum
    expressions.cat_a_q1_meanrating expressions.cat_a_q2_meanrating expressions.cat_a_meanrt
    expressions.cat_b_q1_meanrating expressions.cat_b_q2_meanrating expressions.cat_b_meanrt
    ]
/ separatefiles = true
</data>


By ldobb - 4/5/2016

Dave, thank you so much for your response. You've been a tremendous help!

Quick question: if I want there to be text elements in my surveypages that are defined elsewhere, how would I do this? Stimulusframes? Even if there are 2 questions?
By ldobb - 4/5/2016

Maybe I could have a <survey> with each question as a page. Can you branch from a trial to a survey?
By ldobb - 4/5/2016

Okay, I now understand that <survey> is a type of <block> and <surveypage> a type of <trial>. However, if I have two questions that I want answered on separate pages, but I need them to follow the display of each image, how do I do this? 
By Dave - 4/5/2016

To display elements on a <surveypage>, you use the page's /stimulusframes. Ideally, though, you should avoid that and use <caption> elements displayed via the page's /questions attribute instead.

You cannot /branch from a <trial> to a <survey>. A <survey> is a special type of <block>, and branches generally need to be at the same "level": I.e., you can /branch from a <trial> to another <trial> (a <surveypage> is a type of <trial>), but not to a <block>. Conversely, a <block> can /branch to another <block>, but not to a <trial>.
By ldobb - 4/5/2016

I see what you mean. How does a surveypage's stimulusframes correspond to its questions, though?
By Dave - 4/5/2016

It doesn't. Those are two entirely separate things.

If you need different messages tied to different sets of questions, set up separate <surveypage>s.