Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How create a array for collecting previous responses.

Hello everyone.
I am trying to use Opensesame to implement a pc language related assessment.
I need to stop the test when participants accuracy is below 25% in the last 8 trials (6 out of 8).

Also, the starting point of the test depends on participants age. Children start at trial 1, while adults start at trial 50. However, if adults give incorrect responses in the first 8 trials, they must go to another set (namely trial 49), going on that alternative set until they give a correct answer, then they continue as normal.

I have been trying the following:

import numpy as np

followed by

if var.get('response') == var.get('correct_response'):
if x>=8:
for i in rage(x-8,x):
if b<=2:

But it is not working,
I could definitely use some help. Thanks in advance.
Young Hou


  • Hi,

    To fix your code, consider this:

    var.resp_history = [] # has to be defined in the beginning of the block or the experiment. Wherever you want to start counting from
    var.correct =  var.response == var.correct_response
    if len(var.resp_history) > 7:
        no_correct = sum(var.resp_history[-8:])
        if no_correct < 7:
             # initialize trial 49, I don't quite know how you intend to do that

    Does that help?


Sign In or Register to comment.