Howdy, Stranger!

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

Supported by

Counting correct answers

edited June 2016 in OpenSesame

I've a "simple" problem, but I did'nt find a solution yet being new at Python.
I just want to have the feedback not as accuracy ( in %) but as a simple counting of correct answer to have a clear feedback for children (you have N good answers).
Thanks for help.


  • edited 6:35PM

    Hi Tom,

    OpenSesame 3.1 has a responses object that contains the entire response history. So you can use that to, among things, determine how many correct responses were given:

    # Get a list of correctness values, but exclude those that are None (i.e.
    # when correctness was undefined, for example during instruction screens)
    l_correct = [correct for correct in responses.correct if correct is not None]
    # Get the sum of all correctness values, that is, the total number of correct
    # responses
    n_correct = sum(l_correct)
    print('n_correct = %d' % n_correct)

    See also:

    OpenSesame 3.1 is still in testing, but I think that it's stable enough now that you can use it if you need this functionality.


Sign In or Register to comment.