+x+x+x+x+x+x+x+x+x+x> I could code this as
>
> <list corrrect_answer_trial01>
> / items = ("green")
> </list>
Yes, that is one way to do it. And then you could have a list of lists tied to values.current_list (many such lists already exist in the script, cf. <list masterlist>, <list list_colornames_left>, <list list_colornames_right>, etc.)
<list list_correct_answer>
/ items = (list.corrrect_answer_trial01.item.1,
...,
list.corrrect_answer_trial22.item.1)
/ selectionmode = values.current_list
</list>
and make use of that just like you already make use of the other lists set up in exactly the same way.
Hi Dave,
This is the logic I implemented
if (values.current_list == 1 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial01 == 1;
} else if (values.current_list == 1 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial01 == 0;
} else if (values.current_list == 2 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial02 == 1;
} else if (values.current_list == 2 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial02 == 0;
} else if (values.current_list == 3 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial03 == 1;
} else if (values.current_list == 3 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial03 == 0;
} else if (values.current_list == 4 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial04 == 1;
} else if (values.current_list == 4 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial04 == 0;
} else if (values.current_list == 5 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial05 == 1;
} else if (values.current_list == 5 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial05 == 0;
} else if (values.current_list == 6 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial06 == 1;
} else if (values.current_list == 6 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial06 == 0;
} else if (values.current_list == 7 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial07 == 1;
} else if (values.current_list == 7 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial07 == 0;
} else if (values.current_list == 8 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial08 == 1;
} else if (values.current_list == 8 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial08 == 0;
} else if (values.current_list == 9 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial09 == 1;
} else if (values.current_list == 9 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial09 == 0;
} else if (values.current_list == 10 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial10 == 1;
} else if (values.current_list == 10 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial10 == 0;
Then I output values.accuracy_trial1-22 in the summary sheet. All zeros my logic must be wrong
if (values.current_list == 1 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial01
== 1;
} else if (values.current_list == 1 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial01
== 0;
} else if (values.current_list == 2 && trial.trial_choose.response == "responseoption_trialdecide_color1"){
values.accuracy_trial02
== 1;
} else if (values.current_list == 2 && trial.trial_choose.response == "responseoption_trialdecide_color2"){
values.accuracy_trial02
== 0;
....
Wrong operator.
thank you
Hi Dave,
Stopping and starting timer for every trial, does this look about right?
*logic to start-timing*
if (values.current_list == 1;)
{clock.timer_1.start}
else if (values.current_list == 2;)
{clock.timer_2.start}
*logic to stop timing*
if ((trial.trial_choose.response == "responseoption_trialdecide_color1" || trial.trial_choose.response == "responseoption_trialdecide_color2") && values.current_list == 1)
{
clock.timer_1.stop
}
else if ((trial.trial_choose.response == "responseoption_trialdecide_color1" || trial.trial_choose.response == "responseoption_trialdecide_color2") && values.current_list == 2)
{
clock.timer_2.stop
}
output
timer_1,
timer_2
etc.
sincerely,
David
That's not an answerable question based on an out-of-context code snippet.
Sorry, I should have formulated my question better. My apologies.
If I want to time each trial, and output how long each trial took, would I use
<clock>
/ mode = stopwatch
/ resetrate = block
/ format = "mm:ss"
</clock>
I do not know how to time a trial, and output it
What do you mean by "time" a trial? The clock stimulus is there to display a timer on-screen., it has nothing to do with logging. It's also not clear what you mean by "trial". Are you referring to a single instance of a <trial>? Are you referring to a <block> of X trials, which in the script at hand represents a single "game round" in the task?
Hi Dave,
I would like to time each "game round" (1 - 22). And output "time to decision" for each round.
Each game round is a block. <block boxtask_pressure9> is for the 9-box rounds, <block boxtask_pressure64> is for the 64-box rounds. The block ends when a decision is made. So you simply store the respective block's elapsedtime property in the appropriate value /onblockend. Elapsedtime is in milliseconds, so divide by 1000 to get seconds.
https://www.millisecond.com/support/docs/v6/html/language/properties/elapsedtime.htmhttps://www.millisecond.com/support/docs/v6/html/language/attributes/onblockend.htm
Hi Dave,
Storing elapsed time using /onblockend
/ onblockend = [
if (values.current_list == 1)
{
script.elapsedtime.elapsedtime = values.trial01_timer
}
else if (values.current_list == 2)
{
script.elapsedtime.elapsedtime = values.trial02_timer
}
else if (values.current_list == 3)
{
script.elapsedtime.elapsedtime = values.trial03_timer
}
else if (values.current_list == 4)
{
script.elapsedtime.elapsedtime = values.trial04_timer
}
else if (values.current_list == 5)
{
script.elapsedtime.elapsedtime = values.trial05_timer
}
else if (values.current_list == 6)
{
script.elapsedtime.elapsedtime = values.trial06_timer
}
else if (values.current_list == 7)
{
script.elapsedtime.elapsedtime = values.trial07_timer
}
else if (values.current_list == 8)
{
script.elapsedtime.elapsedtime = values.trial08_timer
}
else if (values.current_list == 9)
{
script.elapsedtime.elapsedtime = values.trial09_timer
}
else if (values.current_list == 10)
{
script.elapsedtime.elapsedtime = values.trial10_timer
}
else if (values.current_list == 11)
{
script.elapsedtime.elapsedtime = values.trial11_timer
}
else if (values.current_list == 12)
{
script.elapsedtime.elapsedtime = values.trial12_timer
}
else if (values.current_list == 13)
{
script.elapsedtime.elapsedtime = values.trial13_timer
}
else if (values.current_list == 14)
{
script.elapsedtime.elapsedtime = values.trial14_timer
}
else if (values.current_list == 15)
{
script.elapsedtime.elapsedtime = values.trial15_timer
}
else if (values.current_list == 16)
{
script.elapsedtime.elapsedtime = values.trial16_timer
}
else if (values.current_list == 17)
{
script.elapsedtime.elapsedtime = values.trial17_timer
}
else if (values.current_list == 18)
{
script.elapsedtime.elapsedtime = values.trial18_timer
}
else if (values.current_list == 19)
{
script.elapsedtime.elapsedtime = values.trial19_timer
}
else if (values.current_list == 20)
{
script.elapsedtime.elapsedtime = values.trial20_timer
}
else if (values.current_list == 21)
{
script.elapsedtime.elapsedtime = values.trial21_timer
}
else if (values.current_list == 22)
{
script.elapsedtime.elapsedtime = values.trial22_timer
};
However I am using it inside of
<expt>
</expt>
Should I be using it instead inside the pressure 64 and pressure 9 block?