# Error config file for BerryPy

###########
# General #
###########

# every condition needs to be on a new line
# the format is the following:
# <condName>; <columnName>: <columnValue(s)>
#
# <condName>: a condition name chosen by you (please only use letters, numbers and underscores; do not start with a number)
# <columnName>: a column name from the PsychoPy csv output files
# <columnValue(s)>: this needs to match one or more values in the corresponding column
#
# if a condition is defined by multiple columns, add more columns:
#  <condName>; <columnName>: <columnValue(s)>; <columnName>: <columnValue(s)>
#
# lines beginning with # are comments and will be ignored
#
# separators are relevant
# - use semicolons to separate condition names and relevant columns
# - use colons to separate column names from column values
# - use commas to separate multiple values (these values will be combined using a logical OR)
#   - e.g.: switch; trlType: switch; response.corr: 1,2
# spaces are not relevant
#
# note that the default comparison operator is equal (==)
# i.e., "response.corr: 1" means a trial will be included if the accuracy equals 1
# however, you can define other comparison operators; these are:
# >, <, >=, <=, !=
# these alternative comparison operators require the following syntax:
# <columnName>: [operator]<columnValue>
# e.g.: "trials.thisN: [>=]10" would exclude the first 10 trials (i.e., trials 0 to 9)
# do *not* use these operators in combination with multiple values: 
# e.g.: "trials.thisN: [>=]10, [<=]100"  # no!

##########################
# Accuracies/error rates #
##########################

# you need to specify (a) which values form the numerator and (b) which values form the denominator
#
# Let's assume we have two types of values in the accuracy column
# 0 = incorrect response
# 1 = correct response
# To calculate the percentage of incorrect responses:
# (...); response.corr: 0/0,1
# Note the forward slash! This is crucial and needs to be there!
#
# Let's assume we have three types of values in the accuracy column
# 0 = timeout (no response)
# 1 = incorrect response
# 2 = correct response
# To calculate the percentage of incorrect responses:
# errorRate; response.corr: 1/0,1,2
# To calculate the total error rate (timeouts + incorrect responses):
# errorRateTotal; response.corr: 0,1/0,1,2

#######################
# String-based ratios #
#######################

# the values provided can also be strings, allowing the computation of ratios more generally
#
# Let's assume we have two types of congruency in a column called "congruency"
# con = congruent trial
# incon = incongruent trial
# To calculate the percentage of congruent trials:
# percentCongr; congruency: con/con,incon

#########################
# define conditions here:

##################################################
# error rates for congruent and incongruent trials
# percentage of incorrect congruent trials of all congruent trials (ignoring time-outs)
err_con; congr: 1; newAcc: 1/1,2; flankerDist: 2
# percentage of incorrect incongruent trials of all incongruent trials (ignoring time-outs)
err_incon; congr: 2; newAcc: 1/1,2; flankerDist: 2

##############################################################
# percentage of congruent and incongruent trials before errors
# short RSI before the pre-error trial
percent_preError_con_shortRsi; nextAcc: 1; prevAcc: 2; rsi: 250; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_preError_incon_shortRsi; nextAcc: 1; prevAcc: 2; rsi: 250; congr: 2/1,2; newAcc: 2; flankerDist: 2
# long RSI before the pre-error trial
percent_preError_con_longRsi; nextAcc: 1; prevAcc: 2; rsi: 700; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_preError_incon_longRsi; nextAcc: 1; prevAcc: 2; rsi: 700; congr: 2/1,2; newAcc: 2; flankerDist: 2

#####################################################################
# percentage of congruent and incongruent trials after correct trials
# short RSI before the post-correct trial
percent_postCorrect_con_shortRsi; prevAcc: 2; rsi: 250; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_postCorrect_incon_shortRsi; prevAcc: 2; rsi: 250; congr: 2/1,2; newAcc: 2; flankerDist: 2
# long RSI before the post-correct trial
percent_postCorrect_con_longRsi; prevAcc: 2; rsi: 700; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_postCorrect_incon_longRsi; prevAcc: 2; rsi: 700; congr: 2/1,2; newAcc: 2; flankerDist: 2

##############################################################
# percentage of congruent and incongruent trials after errors
# short RSI before the post-error trial
percent_postError_con_shortRsi; nextAcc: 2; prevAcc: 1; rsi: 250; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_postError_incon_shortRsi; nextAcc: 2; prevAcc: 1; rsi: 250; congr: 2/1,2; newAcc: 2; flankerDist: 2
# long RSI before the post-error trial
percent_postError_con_longRsi; nextAcc: 2; prevAcc: 1; rsi: 700; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_postError_incon_longRsi; nextAcc: 2; prevAcc: 1; rsi: 700; congr: 2/1,2; newAcc: 2; flankerDist: 2

############################################################################
# what is the percentage of con vs. incon post-error trials at the long RSI? 
# (now including *all* post-error trials, even if they are incorrect or followed by an incorrect trial
percent_postError_con_longRsi_allTrials; congr: 1/1,2; rsi: 700; prevAcc: 1; flankerDist: 2
percent_postError_incon_longRsi_allTrials; congr: 2/1,2; rsi: 700; prevAcc: 1; flankerDist: 2

##############################
# error rates after conditions
percentError_after_longRsi_con; prevCongr: 1; prevRsi: 700; newAcc: 1/1,2; flankerDist: 2
percentError_after_longRsi_incon; prevCongr: 2; prevRsi: 700; newAcc: 1/1,2; flankerDist: 2
percentError_after_longRsi_con_prevCorr; prevCongr: 1; prevRsi: 700; newAcc: 1/1,2; prevAcc: 2; flankerDist: 2
percentError_after_longRsi_incon_prevCorr; prevCongr: 2; prevRsi: 700; newAcc: 1/1,2; prevAcc: 2; flankerDist: 2
percentError_after_longRsi_con_prev2Corr; prevCongr: 1; prevRsi: 700; newAcc: 1/1,2; prevAcc: 2; prev2Acc: 2; flankerDist: 2
percentError_after_longRsi_incon_prev2Corr; prevCongr: 2; prevRsi: 700; newAcc: 1/1,2; prevAcc: 2; prev2Acc: 2; flankerDist: 2

percentError_after_shortRsi_con; prevCongr: 1; prevRsi: 250; newAcc: 1/1,2; flankerDist: 2
percentError_after_shortRsi_incon; prevCongr: 2; prevRsi: 250; newAcc: 1/1,2; flankerDist: 2
percentError_after_shortRsi_con_prevCorr; prevCongr: 1; prevRsi: 250; newAcc: 1/1,2; prevAcc: 2; flankerDist: 2
percentError_after_shortRsi_incon_prevCorr; prevCongr: 2; prevRsi: 250; newAcc: 1/1,2; prevAcc: 2; flankerDist: 2
percentError_after_shortRsi_con_prev2Corr; prevCongr: 1; prevRsi: 250; newAcc: 1/1,2; prevAcc: 2; prev2Acc: 2; flankerDist: 2
percentError_after_shortRsi_incon_prev2Corr; prevCongr: 2; prevRsi: 250; newAcc: 1/1,2; prevAcc: 2; prev2Acc: 2; flankerDist: 2



########################
# are pre-error trials more frequently congruent?
# independent of accuracy, independent of the e-2 trial
percent_preError_con_noConstraints; nextAcc: 1; congr: 1/1,2; flankerDist: 2
percent_preError_incon_noConstraints; nextAcc: 1; congr: 2/1,2; flankerDist: 2
# short RSI
percent_preError_con_shortRsi_noConstraints; nextAcc: 1; rsi: 250; congr: 1/1,2; flankerDist: 2
percent_preError_incon_shortRsi_noConstraints; nextAcc: 1; rsi: 250; congr: 2/1,2; flankerDist: 2
# long RSI
percent_preError_con_longRsi_noConstraints; nextAcc: 1; rsi: 700; congr: 1/1,2; flankerDist: 2
percent_preError_incon_longRsi_noConstraints; nextAcc: 1; rsi: 700; congr: 2/1,2; flankerDist: 2

# are correct pre-error trials more frequently congruent?
# pre-error trial must be correct (but not e-2 trial)
percent_preError_con_correct; nextAcc: 1; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_preError_incon_correct; nextAcc: 1; congr: 2/1,2; newAcc: 2; flankerDist: 2
# short RSI
percent_preError_con_shortRsi_correct; nextAcc: 1; rsi: 250; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_preError_incon_shortRsi_correct; nextAcc: 1; rsi: 250; congr: 2/1,2; newAcc: 2; flankerDist: 2
# long RSI
percent_preError_con_longRsi_correct; nextAcc: 1; rsi: 700; congr: 1/1,2; newAcc: 2; flankerDist: 2
percent_preError_incon_longRsi_correct; nextAcc: 1; rsi: 700; congr: 2/1,2; newAcc: 2; flankerDist: 2

# are pre-error trials more frequently congruent?
# e-2 trial must be correct (but not pre-error trial itself)
percent_preError_con_prevCorrect; nextAcc: 1; congr: 1/1,2; prevAcc: 2; flankerDist: 2
percent_preError_incon_prevCorrect; nextAcc: 1; congr: 2/1,2; prevAcc: 2; flankerDist: 2
# short RSI
percent_preError_con_shortRsi_prevCorrect; nextAcc: 1; rsi: 250; congr: 1/1,2; prevAcc: 2; flankerDist: 2
percent_preError_incon_shortRsi_prevCorrect; nextAcc: 1; rsi: 250; congr: 2/1,2; prevAcc: 2; flankerDist: 2
# long RSI
percent_preError_con_longRsi_prevCorrect; nextAcc: 1; rsi: 700; congr: 1/1,2; prevAcc: 2; flankerDist: 2
percent_preError_incon_longRsi_prevCorrect; nextAcc: 1; rsi: 700; congr: 2/1,2; prevAcc: 2; flankerDist: 2




