Skip to content

Adaptive Semantic Judgment Task

The Adaptive Semantic Judgment Task is an interactive cognitive assessment tool developed using JsPsych at the DNP.

Table of Contents

Prerequisites

  1. Browser with text-to-speech capability. (Google Chrome has one packaged with it)
  2. Node.js and npm (if building from source)

Quick Start

  1. Download the latest release from GitHub releases
  2. Extract the files and navigate to the dist directory
  3. Start a local server: python -m http.server
  4. Open your browser to http://localhost:8000

Installation

  1. Go to the releases page
  2. Download the latest release
  3. Extract the archive - you'll find index.html in the dist directory

Option 2: Build from Source

  1. Clone the repository: git clone https://github.com/DouglasNeuroInformatics/AdaptiveSemanticJudgementTask.git
  2. Install dependencies: npm install
  3. Build the project: npm run build
  4. The built files will be in the dist directory

Running Locally

The recommended way to run this task locally is with a local HTTP server of your choice.

Using Python 3:

cd path/to/dist/directory
python -m http.server 8000

Configuration

Experiment Settings

Configure the task by editing src/experimentSettings.ts before building:

export const experimentSettings = {
  advancementSchedule: 2, // Number of correct answers needed to increase difficulty
  regressionSchedule: 1, // Number of incorrect answers needed to decrease difficulty
  language: "en", // Language: "en" or "fr"
  seed: 42, // Random seed (null for random)
  initialDifficulty: 1, // Starting difficulty level
  numberOfLevels: 9, // Total difficulty levels available
};
Parameter Type Description Default Valid Values
advancementSchedule number Correct answers to advance level 2 1+
regressionSchedule number Incorrect answers to regress level 1 1+
language string Task language "en" "en", "fr"
seed number|null Random seed for reproducibility null Any integer or null
initialDifficulty number Starting difficulty 1 1 to numberOfLevels
numberOfLevels number Total difficulty levels 9 1+

Integration with Open Data Capture

This task integrates with Open Data Capture for research data collection.

Setup in ODC Playground

  1. Visit the ODC Playground
  2. Upload a zip archive of all files from the src directory
  3. Or use our pre-configured instrument
  4. Upload bundle to your instance of ODC via the menu available on the playground

For more information on instruments, see the ODC documentation.

Customizing Stimuli

Stimuli Structure

Edit src/stimuliList.ts to customize word pairs. Each stimulus object requires:

interface Stimulus {
  stimulus: string; // First word shown
  prompt: string; // Second word (shown after delay)
  difficultyLevel: number; // Difficulty level (1 to numberOfLevels)
  language: "en" | "fr"; // Language identifier
  relation: "related" | "unrelated"; // Semantic relationship
}

example stimulus

{
  "stimulus": "dog",
  "prompt": "cat",
  "difficultyLevel": 1,
  "language": "en",
  "relation": "related"
}

Data output

Field Type Description Example Values
word_pair string The stimulus and prompt words "dog cat", "table freedom"
correctResponse enum The correct semantic relationship "related", "unrelated"
userChoice enum The participant's response "related", "unrelated", "timeout"
difficultyLevel number Difficulty level when trial was presented 1, 2, 3, ..., 9
language string Language of the stimulus pair "en", "fr"
rt number Response time in milliseconds 1250, 2340, 5000

Technical Details

Task Logic

  • Two practice runs precede the main task to reduce variability
  • Stimuli are randomly selected from the current difficulty level and the selected language
  • Adaptive algorithm adjusts difficulty based on performance

Note

Built-in logic prevents more than 2 consecutive related or unrelated pairs To modify the consecutive response limits, edit line 546 in src/adaptiveSemanticJudgmentTask.ts.