## Timeout & repetitive blocks

##### Timeout & repetitive blocks
 Author Message Elli posted 2 Weeks Ago ANSWER Group: Forum Members Posts: 1, Visits: 2 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 posted Last Week ANSWER Group: Administrators Posts: 12K, Visits: 91K +x Elli - 5/15/2023Hi,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 level that will terminate the expt after a set amount of time has elapsed./ stop = [script.elapsedtime >= 2700000; // stop if 45 mins or more have elapsed]...> 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 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:/ a_blockcount = 0/ b_blockcount = 0/ round1_a_correctcount = 0/ round1_b_correctcount = 0/ round2_a_correctcount = 0/ round2_b_correctcount = 0/ blocks = [1 = sequence(a, b);2 = sequence(a, b);]/ 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]/ 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]/ stimulusframes = [1=mytext]/ validresponse = ("A", "B")/ correctresponse = ("A")/ stimulusframes = [1=mytext]/ validresponse = ("A", "B")/ correctresponse = ("B")/ items = ("<%script.currentblock%>")/ columns = (script.startdate script.starttime script.subjectid script.groupid script.sessionid script.elapsedtimevalues.a_blockcount values.b_blockcount values.round1_a_correctcount values.round1_b_correctcount values.round2_a_correctcount values.round2_b_correctcountblock.a.correctcount block.b.correctcount block.a.totalcorrectcount block.b.totalcorrectcount)https://www.millisecond.com/support/docs/current/html/language/properties/correctcount.htmhttps://www.millisecond.com/support/docs/current/html/language/properties/totalcorrectcount.htmOther performance metric properties function analogously, i.e. there are errorcount and totalerrorcount, there are meanlatency and totalmeanlatency, etc.

#### Merge Selected

Merge into selected topic...

Merge into merge target...

Merge into a specific topic ID...