# picklesmhr/sin-project-2025 architecture

> Architecture diagram of the GitHub repository picklesmhr/sin-project-2025, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/picklesmhr/sin-project-2025
- Repository: https://github.com/picklesmhr/sin-project-2025

## Overview

This repository supports a browser-based Speech-in-Noise experiment: participants complete practice and pre-test, then a condition-dependent training or break phase, followed by post-test. The README describes adaptive SNR, typed sentence transcription, word-level scoring, and treatment feedback/replay. The experiment HTML and its trial/scoring code are not present in the supplied tree, so those documented stages have no source path and their internal wiring is uncertain. The available PHP endpoint accepts CSV data and writes participant files; the excerpt does not establish how the experiment invokes it.

Main entry points: [`jspsych/jspsych.js`](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/jspsych.js) (jsPsych runtime), [`jspsych/plugin-browser-check.js`](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-browser-check.js) (Browser check), [`jspsych/plugin-preload.js`](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-preload.js) (Media preload), [`jspsych/plugin-audio-keyboard-response.js`](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-audio-keyboard-response.js) (Audio response trials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiment["Experiment flow"]
  node_sin_entry["SIN experiment"]
  node_practice["Practice"]
  node_pretest["Pre-test"]
  node_condition["Condition phase"]
  node_treatment_training["Training"]
  node_control_break["Break"]
  node_posttest["Post-test"]
  node_adaptive_task["Adaptive SIN task"]
  node_typed_scoring["Typed word scoring"]
end

subgraph group_engine["jsPsych runtime"]
  node_jspsych_runtime["jsPsych runtime<br/>[jspsych.js]"]
end

subgraph group_plugins["Trial plugins"]
  node_browser_check["Browser check"]
  node_preload["Media preload<br/>[plugin-preload.js]"]
  node_audio_trials["Audio response trials"]
  node_text_response["Text survey trial"]
end

subgraph group_persistence["Data persistence"]
  node_save_endpoint["CSV save endpoint<br/>[save_data.php]"]
  node_result_files[("CSV result files<br/>[save_data.php]")]
end

node_participant(("Participant"))

node_participant -->|"starts"| node_sin_entry
node_sin_entry -->|"runs on"| node_jspsych_runtime
node_sin_entry -->|"begins with"| node_practice
node_practice -->|"continues to"| node_pretest
node_pretest -->|"branches by condition"| node_condition
node_condition -->|"treatment selects"| node_treatment_training
node_condition -->|"control selects"| node_control_break
node_treatment_training -->|"continues to"| node_posttest
node_control_break -->|"continues to"| node_posttest
node_adaptive_task -->|"scores response"| node_typed_scoring
node_browser_check -->|"runs as trial"| node_jspsych_runtime
node_preload -->|"runs as trial"| node_jspsych_runtime
node_audio_trials -->|"runs as trial"| node_jspsych_runtime
node_text_response -->|"runs as trial"| node_jspsych_runtime
node_save_endpoint -->|"writes CSV"| node_result_files

click node_jspsych_runtime "https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/jspsych.js"
click node_browser_check "https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-browser-check.js"
click node_preload "https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-preload.js"
click node_audio_trials "https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-audio-keyboard-response.js"
click node_text_response "https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-survey-text.js"
click node_save_endpoint "https://github.com/picklesmhr/sin-project-2025/blob/main/save_data.php"
click node_result_files "https://github.com/picklesmhr/sin-project-2025/blob/main/save_data.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sin_entry,node_practice,node_pretest,node_condition,node_treatment_training,node_control_break,node_posttest,node_adaptive_task,node_typed_scoring toneBlue
class node_jspsych_runtime toneAmber
class node_browser_check,node_preload,node_audio_trials,node_text_response toneMint
class node_save_endpoint,node_result_files toneRose
class node_participant toneIndigo
```

## Components

### Experiment flow

- **SIN experiment**
- **Practice**
- **Pre-test**
- **Condition phase**
- **Training**
- **Break**
- **Post-test**
- **Adaptive SIN task**
- **Typed word scoring**

### jsPsych runtime

- [jsPsych runtime](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/jspsych.js): `jspsych/jspsych.js`

### Trial plugins

- [Browser check](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-browser-check.js): `jspsych/plugin-browser-check.js`
- [Media preload](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-preload.js): `jspsych/plugin-preload.js`
- [Audio response trials](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-audio-keyboard-response.js): `jspsych/plugin-audio-keyboard-response.js`
- [Text survey trial](https://github.com/picklesmhr/sin-project-2025/blob/main/jspsych/plugin-survey-text.js): `jspsych/plugin-survey-text.js`

### Data persistence

- [CSV save endpoint](https://github.com/picklesmhr/sin-project-2025/blob/main/save_data.php): `save_data.php`
- [CSV result files](https://github.com/picklesmhr/sin-project-2025/blob/main/save_data.php): `save_data.php`

### Other components

- **Participant**

## Connections

- Participant → SIN experiment: starts
- SIN experiment → jsPsych runtime: runs on
- SIN experiment → Practice: begins with
- Practice → Pre-test: continues to
- Pre-test → Condition phase: branches by condition
- Condition phase → Training: treatment selects
- Condition phase → Break: control selects
- Training → Post-test: continues to
- Break → Post-test: continues to
- Adaptive SIN task → Typed word scoring: scores response
- Browser check → jsPsych runtime: runs as trial
- Media preload → jsPsych runtime: runs as trial
- Audio response trials → jsPsych runtime: runs as trial
- Text survey trial → jsPsych runtime: runs as trial
- CSV save endpoint → CSV result files: writes CSV
