Access response history
responses object contains the history of the responses that were
collected during the experiment.
responses object is created automatically when the experiment starts.
In addition to the functions listed below, the following semantics are supported:
# Loop through all responses, where last-given responses come first # Each response has correct, response, response_time, item, and feedback # attributes. for response in responses: print(response.correct) # Print the two last-given respones print('last_two responses:') print(responses[:2])
add(response=None, correct=None, response_time=None, item=None, feedback=True)
Adds a response.
- response The response value, for example, 'space' for the spacebar, 0 for: joystick button 0, etc.
- correct: The correctness of the response.
- response_time: The response_time.
- item: The item that collected the response.
- feedback: Indicates whether the response should be included in feedback on accuracy and average response time.
responses.add(response_time=500, correct=1, response='left')
Clears all responses.
Sets the feedback status of all responses to False, so that only new responses will be included in feedback.