Timeout & repetitive blocks


Author
Message
Elli
Elli
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 1, Visits: 3
Hi,

I am quite new here! I am trying to programme my own script, thus, I have some questions:

1) Is it possible to use the timeout function for the whole experiment? In fact, the duration of the experiment is around 30' and my goal is not to exceed 45' for none of the participants.

2) I am using a sequence of 3 blocks that is going to be repeated 2 more times. So, I end up with 3 sequences of 3 blocks. The problem is that, in the summary data output, only the responses of the first sequense are recorded. How could I fix that?

Thank you in advance for your help!

Best,
Elli
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: 12K, Visits: 98K
Elli - 5/15/2023
Hi,

I am quite new here! I am trying to programme my own script, thus, I have some questions:

1) Is it possible to use the timeout function for the whole experiment? In fact, the duration of the experiment is around 30' and my goal is not to exceed 45' for none of the participants.

2) I am using a sequence of 3 blocks that is going to be repeated 2 more times. So, I end up with 3 sequences of 3 blocks. The problem is that, in the summary data output, only the responses of the first sequense are recorded. How could I fix that?

Thank you in advance for your help!

Best,
Elli

> 1) Is it possible to use the timeout function for the whole experiment? In fact, the duration of the experiment is around 30' and my goal is not to exceed 45' for none of the participants.

You can define a /stop condition at the <expt> level that will terminate the expt after a set amount of time has elapsed.

<expt exampleexpt>
/ stop = [
script.elapsedtime >= 2700000; // stop if 45 mins or more have elapsed
]
...
</expt>


> 2) I am using a sequence of 3 blocks that is going to be repeated 2 more times. So, I end up with 3 sequences of 3 blocks. The problem is that, in the summary data output, only the responses of the first sequense are recorded. How could I fix that?

This depends and what you are logging and what you ultimately want to log. Since you also emailed the same questions to support, I'm answering here for the sake of others, based on the additional information from the email exchange. Metrics like correctcount or errorcount reflect performance in the current block only. That is, if you run two instances of <block a> and log block.a.correctcount to the summary data file, then that will reflect performance of the 2nd instance only. If you want to track performance in both instances separately, you need to define separate variables to do so and store the result in the applicable variable(s) /onblockend. If you want performance across all instances of the given block, then you want totalcorrectcount, not correctcount.

The example below illustrates the differences:

<values>
/ a_blockcount = 0
/ b_blockcount = 0

/ round1_a_correctcount = 0
/ round1_b_correctcount = 0

/ round2_a_correctcount = 0
/ round2_b_correctcount = 0
</values>


<expt example>
/ blocks = [
1 = sequence(a, b);
2 = sequence(a, b);
]
</expt>

<block a>
/ onblockbegin = [
values.a_blockcount += 1;
]
/ onblockend = [
if (values.a_blockcount == 1) {
values.round1_a_correctcount = block.a.correctcount;
} else if (values.a_blockcount == 2) {
values.round2_a_correctcount = block.a.correctcount;
}
]
/ trials = [1-10 = atrial]
</block>

<block b>
/ onblockbegin = [
values.b_blockcount += 1;
]
/ onblockend = [
if (values.b_blockcount == 1) {
values.round1_b_correctcount = block.b.correctcount;
} else if (values.b_blockcount == 2) {
values.round2_b_correctcount = block.b.correctcount;
}
]
/ trials = [1-10 = btrial]
</block>

<trial atrial>
/ stimulusframes = [1=mytext]
/ validresponse = ("A", "B")
/ correctresponse = ("A")
</trial>

<trial btrial>
/ stimulusframes = [1=mytext]
/ validresponse = ("A", "B")
/ correctresponse = ("B")
</trial>

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

<summarydata>
/ columns = (script.startdate script.starttime script.subjectid script.groupid script.sessionid script.elapsedtime
values.a_blockcount values.b_blockcount values.round1_a_correctcount values.round1_b_correctcount values.round2_a_correctcount values.round2_b_correctcount
block.a.correctcount block.b.correctcount block.a.totalcorrectcount block.b.totalcorrectcount)
</summarydata>


https://www.millisecond.com/support/docs/current/html/language/properties/correctcount.htm
https://www.millisecond.com/support/docs/current/html/language/properties/totalcorrectcount.htm

Other performance metric properties function analogously, i.e. there are errorcount and totalerrorcount, there are meanlatency and totalmeanlatency, etc.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search