Survey Templates
This page explains how survey templates work in PRISM — what they are, how they are structured, where they live, and how to create or extend them.
What Is a Survey Template?
A survey template is a JSON sidecar file that defines the structure and metadata of a questionnaire. Every survey data file (.tsv) must have a matching _survey.json sidecar. The sidecar does two jobs:
Instrument definition — item texts, response levels, reverse coding, scoring rules.
Administration record — how the instrument was actually collected in this dataset (language, platform, respondent, method).
PRISM keeps these two concerns in the same file shape but separates them into dedicated blocks (Study vs Technical), so validation and downstream tools always know where to look.
Two Contexts: Official Library vs. Project Copy
PRISM uses the same JSON structure in two different contexts. It is important to understand the difference:
Official library template |
Project copy |
|
|---|---|---|
Location |
|
|
Purpose |
Canonical instrument definition |
Administration record for one dataset |
Contains |
Item texts, levels, |
Same, plus |
Editable by |
Repository maintainers (via draft/PR workflow) |
Researchers (per dataset) |
TaskName required? |
No |
Yes |
When you add a survey to a project, PRISM copies the official template into code/library/survey/ and you fill in the Technical block to record how you actually ran the study. BIDS apps, validators, and reporting tools only read the project copy.
Template Structure
Minimal valid template (data already collected, no official library entry)
{
"Metadata": {
"SchemaVersion": "1.1.1",
"CreationDate": "2026-01-15"
},
"Technical": {
"StimulusType": "Questionnaire",
"FileFormat": "tsv",
"Language": "en",
"Respondent": "self"
},
"Study": {
"TaskName": "mymeasure",
"OriginalName": "My Custom Measure"
},
"MM01": {
"Description": "How are you feeling right now?"
}
}
Full example with i18n, scoring, and administration details
{
"Metadata": {
"SchemaVersion": "1.1.1",
"CreationDate": "2026-03-01"
},
"Technical": {
"StimulusType": "Questionnaire",
"FileFormat": "tsv",
"Language": "de",
"Respondent": "self",
"AdministrationMethod": "online",
"SoftwarePlatform": "LimeSurvey",
"SoftwareVersion": "6.3"
},
"I18n": {
"Languages": ["en", "de"],
"DefaultLanguage": "de",
"TranslationMethod": "forward-backward"
},
"Study": {
"TaskName": "pss",
"OriginalName": {
"en": "Perceived Stress Scale",
"de": "Wahrgenommene Stressskala"
},
"ShortName": "PSS-10",
"Authors": ["Cohen, S.", "Kamarck, T.", "Mermelstein, R."],
"Year": 1983,
"DOI": "https://doi.org/10.2307/2136404",
"LicenseID": "CC-BY-4.0",
"ItemCount": 10,
"Instructions": {
"en": "The questions ask about your feelings and thoughts during the LAST MONTH.",
"de": "Die Fragen beziehen sich auf Ihre Gefühle und Gedanken im LETZTEN MONAT."
}
},
"Scoring": {
"ScoringMethod": "sum",
"ScoreRange": {"min": 0, "max": 40},
"ReverseCodedItems": ["PSS04", "PSS05", "PSS07", "PSS08"]
},
"PSS01": {
"Description": {
"en": "Been upset because of something that happened unexpectedly?",
"de": "Über etwas aufgewühlt, das unerwartet passiert ist?"
},
"Levels": {
"0": {"en": "Never", "de": "Nie"},
"1": {"en": "Almost never", "de": "Fast nie"},
"2": {"en": "Sometimes", "de": "Manchmal"},
"3": {"en": "Fairly often", "de": "Öfters"},
"4": {"en": "Very often", "de": "Sehr oft"}
}
}
}
Key Fields Reference
Study block
Field |
Type |
Description |
|---|---|---|
|
string |
Required in project copies. The short identifier used in filenames (e.g., |
|
string | i18n object |
Required. Full canonical name of the instrument. |
|
string | i18n object |
Common abbreviation (e.g., |
|
array |
List of instrument authors. |
|
integer |
Publication year (1900–2100). |
|
string |
Digital Object Identifier ( |
|
string |
Formatted citation string. |
|
string |
SPDX license identifier (e.g., |
|
string | i18n object |
License terms in plain text. |
|
string |
URL to the instrument’s original source. |
|
integer |
Total number of items. Replaces legacy |
|
string | i18n object |
Instructions shown to participants. |
|
string | i18n object |
Psychological construct measured (e.g., |
|
string | i18n object |
Instrument description or abstract. |
|
object |
Named variants of the instrument (see survey versioning). |
Backward compatibility:
Abbreviationis still accepted as a synonym forShortName, andNumberOfItemsforItemCount. Official library templates use the canonical names. Project-local templates that have not yet been migrated continue to work.
Technical block
Field |
Required |
Description |
|---|---|---|
|
Yes |
Always |
|
Yes |
Always |
|
Yes |
BCP-47 language code actually administered (e.g., |
|
Yes |
Who filled it in: |
|
Recommended |
|
|
Recommended |
Software used: |
|
Optional |
Version of the software platform. |
|
Optional |
Input modality: |
I18n block (optional)
Field |
Description |
|---|---|
|
List of BCP-47 codes available in the template (e.g., |
|
Which language to use when compiling or exporting (e.g., |
|
Translation/validation approach (e.g., |
Item definitions
Every top-level key that is not Study, Technical, Metadata, I18n, or Scoring is treated as an item (question). Items use uppercase codes with a numeric suffix, e.g. PSS01.
Field |
Required |
Description |
|---|---|---|
|
Yes |
Question text. String or i18n object. |
|
No |
Response options as |
|
No |
Numeric bounds. Use instead of |
|
No |
|
|
No |
|
|
No |
Ontology URI for the measured concept. |
|
No |
Conditional display logic (e.g., |
Creating a New Template
Option A — Excel import (recommended for new instruments)
The fastest way. Use the Excel template:
examles/excel_import/survey_import_example.xlsx
Fill in the General sheet with survey-level metadata (one row per field), and the Items sheet with one row per question. Then import via PRISM Studio → Tools → Import Survey.
Key columns in Items:
Column |
Description |
|---|---|
|
Unique item code (e.g., |
|
Item text (language suffix optional) |
|
Response scale labels, pipe-separated: |
|
Numeric bounds for open-ended items |
|
Marks items specific to a session/run |
Key rows in General:
Field |
Description |
|---|---|
|
Full instrument name per language |
|
Common abbreviation |
|
Author list (semicolon-separated) |
|
DOI string |
|
APA-style citation |
|
Space- or comma-separated language codes (e.g., |
|
Default export language (e.g., |
|
Participant instructions per language |
|
|
|
e.g., |
Option B — JSON directly
Write the JSON by hand or copy an existing official template:
cp official/library/survey/survey-pss.json official/library/survey/survey-myinstrument.json
# Edit Study metadata and item codes
Validate immediately:
python app/prism.py --validate-templates official/library/survey/
Option C — Web interface template editor
PRISM Studio provides a form-based editor under Tools → Template Editor. It lets you add/edit items, set metadata, and save without touching JSON directly.
Official Library
The 110+ templates in official/library/survey/ are the canonical PRISM instrument library. They are read-only “golden masters”:
Cannot be edited directly — go through the Checkout → Edit → Submit workflow.
Checked out copies land in
official/library/survey/drafts/.Merged copies replace the golden master after review.
All official templates use canonical field names: ShortName (not Abbreviation) and ItemCount (not NumberOfItems).
Browse them by instrument name in PRISM Studio → Tools → Survey Library, or directly in official/library/survey/.
Validation
Run the template validator at any time:
# Validate the full official library
python app/prism.py --validate-templates official/library/survey/
# Validate project-local templates
python app/prism.py --validate-templates code/library/survey/
Common errors and fixes:
Error |
Fix |
|---|---|
|
Add |
|
Required in project copies — add the task identifier. |
|
Every item must have a |
|
Check the year value (expected 1900–2100). |
|
Use format |
|
Set |
LimeSurvey Export
Templates in the official library or project library can be exported directly to LimeSurvey (.lss or .lsa format) via Tools → Export to LimeSurvey. The exporter reads ShortName, OriginalName, Authors, DOI, and Citation to populate the LimeSurvey survey description block automatically.
For i18n templates, specify the export language. The compiled output contains only that language’s text.