This project implements a Stroop test experiment using the Pygame library in Python. The Stroop test is a psychological task used to measure participants' reaction time when asked to ignore the meaning of words and focus only on the printed color of the words.
- Python 3.x
- Pygame library (install using
pip install pygame)
This script contains the core functionality of the Stroop test experiment. It includes the following:
-
Initialization:
- Import necessary modules (
pygame,sys). - Import the
settingsclass from theSettingsmodule. - Import utility functions from the
Functionsmodule.
- Import necessary modules (
-
Execution of Stroop Test:
- Define the
run_experfunction, set up the Pygame window, display the introduction screen, and start the Stroop test using therun1function from theFunctionsmodule.
- Define the
-
Pygame Window Setup:
- Initialize Pygame and configure the window.
-
Introduction Screen:
- Display an introduction screen with the Stroop test title and instructions.
-
Event Handling and Start of Test:
- Wait for a key press to trigger the start of the Stroop test.
- Call the
run1function to execute the Stroop test.
-
Dependencies:
- Requires Python 3.x and the Pygame library.
This module defines a settings class containing parameters for the Pygame window, such as screen width and height.
This module contains functions used in the Stroop test, including:
run1: Implements the main logic of the Stroop test.textshow: Displays text on the Pygame window.
- Install Python 3.x.
- Install the Pygame library using
pip install pygame. - Run the
Stroop.pyscript.
- Participants are instructed to press any key to start the Stroop test.
- In the first phase, words with colored backgrounds are presented as a reference. Participants press the spacebar after each word.
- After completing the first phase, the average time is recorded, and instructions for the second phase are displayed.
- In the second phase, words with text color as a reference are presented. Participants again press the spacebar after each word.
- After completion, the average time for the second phase is recorded.
- Results are displayed, and the experiment concludes.

