Millisecond Forums

several quick questions

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

By vpillaud - 9/17/2014

Hi all,
I've been browsing the forum but I still haven't found a solution for several little problems I am experiencing. I hope somebody will be able to help me out.

First, I'd like to direct participants to either a block or another one as a function of their choice. They start by doing task 1 then task 2 and then, I'd like them to decide between 1 and 2 to further do it again as a function of their choice. So far I've tried to implement:

<trial choice>
/ stimulusframes = [1=choice]
/ validresponse = ("1", "2")
/ responsetrial = ("k", task1)
/ responsetrial = ("d", task2)
</trial>

<slider choice>
/ caption = "Please indicate the task you would like for Stage 3
"
/ labels = (
    "task1", "task2")
/ range = (1, 2)
/ slidersize = (60%, 5%)
/ showtooltips = false
</slider>

But this simply doesnt work. Also, I don't really know what to indicate in the design of the task. So far, it was

<block task>
/ trials = [1-2=instructions; 3-5=task1; 6=instructions; 7-9=task2; 10=choice
</block>

But then I don't know what to write as the 11th step is depending on the choice. Is there a way to specify that it'll be either Task 1 or Task 2 here ?

The second question I have is regarding the number of trials. In the example provided I can modify the number of trials by putting 3-5=task1 or 3-555=task1. I'd like to know if there is a way to restrict the length of a block to a fixed amount of time instead of using a specified number of trials. For example, I'd like them to fill as many items as they can in 2mn and then to switch to task 2. Is there a way to do that ?

The final question I had was to know how to display a performance feedback on both tasks. Ideally, this would just present the sum of good answers (or an average percent) after each answer on task 1 and then the same on task 2 but this may be too complicated.

Thanks for your help,
Regards,
Vincent.

By Dave - 9/17/2014

#1a: A <slider> is not a stimulus and thus cannot be displayed via a <trial>'s /stimulusframes. You need to put the <slider> on a <surveypage> (which is in itself a special kind of <trial>) by using its /questions attribute.

#1b: Run the <surveypage> via a <block> at the 11th position. From that <block> /branch to either <block task1> or <block task2> depending on the <slider> response given. A simplified example summing up 1a and 1b:

<expt>
/ blocks = [1=task1block; 2=task2block; 3-6=choiceblock]
</expt>

<block task1block>
/ trials = [1=mytrial]
</block>

<block task2block>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%script.currentblock%>")
</text>

<block choiceblock>
/ trials = [1=choicepage]
/ branch = [if(slider.choicequestion.response=="1") block.task1block]
/ branch = [if(slider.choicequestion.response=="2") block.task2block]
</block>

<surveypage choicepage>
/ questions = [1=choicequestion]
</surveypage>

<slider choicequestion>
/ labels = ("Do Task 1", "Do Task 2")
/ range = (1,2)
</slider>

#2: You can specify a /timeout attribute at the <block>-level, which will determine the maximum allowable time for the block. If the block runs out of trials prior to the timeout, it will terminate. Thus you need to make sure the block runs enough trials.

#3: For simple feedback, you can use the <block> element's /blockfeedback attribute, details for which you can find in the documentation. For more elaborate feedback, set up <values>, <expressions>, etc. to calculate your performance statistics of choice and display the results at the end of the block either via an instructions <page> (/postinstructions) or standard <text>, <trial> etc. elements (see e.g. http://www.millisecond.com/forums/FindPost14025.aspx ).
By vpillaud - 9/17/2014

thanks for this quick answer. Let's try this out !

By vpillaud - 9/18/2014

excellent, so far everything worked well.

I thought I'd add a clock in some of the blocks (to allow participants to know the remaining time). I've tried /onblockbegin= ["<%clock.timer.remainingtime%>"] in the block where I want to display a clock and specified the clock attributes by such code elsewhere
<clock timer>
/mode = timer
/resetrate = block
/timeout = 10000
/erase = false
/txcolor = block
/position = (80%,20%)
/format = "mm:ss"
</clock>

but this doesnt display anything.... Also, I'd ideally would like to display a screen beforehand ("the task will start by pressure the SPACEBAR"), and then the countdown clock to start (and then to timeout).

Can you please indicate me a way to proceed ?

Thanks so much for your previous answer.
By Dave - 9/18/2014

The <clock> element is a *stimulus* element just like <text>, <picture>, <video>, etc.

You cannot display stimuli via /onblockbegin or the like. You do so via a <block>'s /bgstim or <trial> elements' /stimulustimes or -frames.

As for your second question: Set up a <block> that runs a single <trial> requiring a spacebar response. Run that block before the "actual" block.
By vpillaud - 9/22/2014

the bgstim command worked perfectly, thats really nice.

Concerning the second point I raised, I arrived to the same conclusion as you did (which was adding a block with only one stimulus than switching to the timed block). In fact, there remains a problem here:
They decide between task 1 and task 2 and are successfully directed to one of both accordingly but I don't know how to add an instruction screen that won't be timed and that still will vary as a function of their choice.

So far, the branching is:
<block choice>
/trials = [1= choice]
/branch = [if(slider.choice.response=="1") block.task1]
/branch = [if(slider.choice.response=="2") block.task2]
</block>

and the experiment branching is
<expt>
/blocks = [1=instructions; 2=task1; 3=task2; 4=choice; 5=demo...]

I dont know if I should add a block in the <expt> (but if then, how to make it variating as a function of the decision ?) or in the branching of the choice, by writing /branch = [if(slider.choice.response=="1") block.screen; block.task1] (which doesnt seem to work so far..)

Is there a way to deal with this ?

Thanks a million for the help you provided so far,
that has really been helpful.
Vince.
By Dave - 9/22/2014

/branch to one of two <block>s presenting the applicable instructions based on the slider-choice

<block choice>
/trials = [1= choice]
/branch = [if(slider.choice.response=="1") block.task1instructions]
/branch = [if(slider.choice.response=="2") block.task2instructions]
</block>

From the respective instructions-<block>, /branch to the applicable task-<block>:

<block task1instructions>
...
/ branch = [block.task1]
</block>

<block task2instructions>
...
/ branch = [block.task2]
</block>
By vpillaud - 9/22/2014

good idea. thanks a million for being that responsive.
By vpillaud - 9/25/2014

Hi,
another problem appeared: while displaying the slider where participants have to decide between task 1 and task 2 for stage 3, the button that appears on the screen to validate the choice is labelled "finish". This is problematic as the study is not over yet..

To cope with this, I thought of displaying a screenshot instead of a slider (as this would remove the button) but now, the branching does not work anymore.
The command line was:
/branch = [if(slider.choice.response=="1") block.task1instructions]

As a reminder, a slider was displayed in a surveypage named as "choice" originally. I've now removed this surveypage and replaced it by a trial page named as "choice" where a screenshot is presented. I've specified two validresponse keys in order to branch depending on the key that will be pressed.

Can you please tell me what to write when the branching is depending on a trial ? Ive tried trial.choice.response but this didn't work.

By Dave - 9/25/2014

You don't need to fiddle around with branching or some screenshot. All you need to do is change the button's label via the <surveypage>'s /finishlabel attribute.
By vpillaud - 9/25/2014

that would be faster this way indeed, thanks. Can I still present a screenshot above the slider instead of writing some text ? (this is just to make the instructions more visible).
Couldn't find another way to proceed apart from the "text" command that need to be put in the "caption"...
By Dave - 9/25/2014

Set up an <image> element and display it via the <surveypage>'s /questions attribute -- works the same as the <caption> element.
By vpillaud - 9/25/2014

Hm, I'm stuck on this one-

So far, I've got a surveypage that displays a question labeled as "choice", the latter is set up as a slider question.
I used the <picture> command to display the previous screenshots (they were then defined in a related <item> command); i was not using the image command as you were suggesting (but I think they work in a similar way).

The remaining problem is how to display the image in the slider question since it requires some text in the caption and putting "choice.png" instead didnt work. I haven't been able to find anything relevant by browsing the question's attributes.


By Dave - 9/25/2014

<surveypage mypage>
/ questions = [1=myimage; 2=myslider]
...
</surveypage>

<image myimage>
/ items = ("myscreenshot.jpg")
...
</image>

<slider myslider>
...
</slider>

Plus: I'm not entirely sure what exactly you mean by "display the image in the slider question", but you cannot display an image /in/ a slider.
By vpillaud - 9/25/2014

I wanted to display a screenshot instead of using the caption command. Ideally, this would present a screenshot and the slider right below the screenshot (so all within the same screen).
By Dave - 9/25/2014

Well, that'll work just fine with what I outlined in my previous reply.