# Eye-For-AI Replication Package

This replication package contains the data, tools, and scripts necessary to reproduce the results of the Eye-For-AI study. The study's companion web app can be accessed online at [https://eye-for-ai.study](https://eye-for-ai.study) containing additional interactive analysis and visualizations, as well as participants' session playback videos.

## Top-Level Directory Structure

The repository is organized into these main directories:

- [`data/`](./data/): Contains the raw and processed data from the user study.
- [`div-logger-extension/`](./div-logger-extension/): Contains the source code for the Chrome extension used to log interactions.
- [`scripts/`](./scripts/): Contains Python scripts for data processing and analysis.
- [`t-rex-game-main.zip`](./t-rex-game-main.zip): Contains the Chrome Dino game task repository.

## `data`

The `data` directory contains subdirectories for each participant in the study. Each subdirectory is named with a unique participant ID. Within each participant's directory, you will find the following files:

- `div_logs_<participant_id>.json`: Raw suggestion logs from the `div-logger-extension`.
- `html_<participant_id>.json`: Suggestion content (as HTML).
- `IA_Report_<participant_id>.txt`: Interest Area Report (generated by SR Research DataViewer).
- `output_<participant_id>.ias`: Generated Interest Areas for each suggestion.
- `SessionLog_<participant_id>.log`: Interaction Log of the user's session.
- [`participant_task1_finish_times.csv`](./data/participant_task1_finish_times.csv): A CSV file containing the finish times for task 1 for all participants.
- [`fixation_reports`](./data/fixation_reports): Additional Fixation Reports from all participants (generated by SR Research DataViewer).

## `div-logger-extension`

This directory contains the source code for the `div-logger` Chrome extension. This extension was used to collect interaction data from the study participants. The key files are:

- [`manifest.json`](./div-logger-extension/manifest.json): The manifest file for the Chrome extension, which defines its properties and permissions.
- [`background.js`](./div-logger-extension/background.js): The background script for the extension, which handles tasks that run in the background.
- [`content.js`](./div-logger-extension/content.js): A content script that is injected into the Github Codespace (VS Code Web IDE) to log interactions with code suggestion `div` elements.
- [`popup.html`](./div-logger-extension/popup.html) and [`popup.js`](./div-logger-extension/popup.js): The user interface for the extension's popup.

## `scripts`

This directory contains Python scripts used for processing the data collected in the study.

- [`div_and_session_log_to_IA_and_html.py`](./scripts/div_and_session_log_to_IA_and_html.py): This script processes the `div_logs` and `SessionLog` files to generate the `ias` and `html` output files.
- [`div_IA_extender.py`](./scripts/div_IA_extender.py): This script can be used to extend `.ias` interest areas by an error margin.
- [`generate_ia_logs.log`](./scripts/generate_ia_logs.log): A log file generated during the execution of the data processing scripts. 