

Stroop (1935) found that participants were slower and less accurate when naming colors on incongruent trials compared to congruent ones
import csv
import datetime
## MAKING THE CSV FILE
def init_csv():
"""Initialize CSV file with headers"""
participant_id = input("Enter participant ID: ")
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"stroop_{participant_id}_{timestamp}.csv"
with open(filename, 'w', newline='') as csvfile:
fieldnames = ["trial", "word_number", "match", "reaction_time", "correct"]
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
return filename
## INPUTTING RESULTS TO CSV
def save_result_to_csv(trial_num, word_num, match_status, rt, correct_status):
"""Save one trial to CSV file"""
with open(csv_filename, 'a', newline='') as csvfile:
fieldnames = ["trial", "word_number", "match", "reaction_time", "correct"]
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writerow({
"trial": trial_num,
"word_number": word_num,
"match": str(match_status),
"reaction_time": rt,
"correct": str(correct_status)
})
We used pygame to code this task, so we had lots of help from LLMs and the Pygame Documentation Webpage
Two 2-Way Repeated Measures ANOVA tests were performed examining the main effects of trial and congruency on reaction time and accuracy, in addition to their interactions on both.
