psytools 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -4
- package/SOURCES.md +16 -1
- package/dist/cjs/errors.d.ts +1 -1
- package/dist/cjs/i18n.d.ts +21 -1
- package/dist/cjs/i18n.js +136 -0
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +19 -14
- package/dist/cjs/inventories/aq10.js +5 -64
- package/dist/cjs/inventories/asrs6.js +6 -49
- package/dist/cjs/inventories/audit.js +9 -116
- package/dist/cjs/inventories/common.js +0 -20
- package/dist/cjs/inventories/dass21.js +19 -130
- package/dist/cjs/inventories/gad7.js +5 -40
- package/dist/cjs/inventories/index.d.ts +11 -2
- package/dist/cjs/inventories/index.js +22 -3
- package/dist/cjs/inventories/mini-ipip.js +1 -132
- package/dist/cjs/inventories/phq9.js +6 -53
- package/dist/cjs/inventories/who5.js +5 -56
- package/dist/cjs/locales/de/aq10.d.ts +4 -0
- package/dist/cjs/locales/de/aq10.js +53 -0
- package/dist/cjs/locales/de/asrs6.d.ts +4 -0
- package/dist/cjs/locales/de/asrs6.js +42 -0
- package/dist/cjs/locales/de/audit.d.ts +4 -0
- package/dist/cjs/locales/de/audit.js +80 -0
- package/dist/cjs/locales/de/dass21.d.ts +4 -0
- package/dist/cjs/locales/de/dass21.js +114 -0
- package/dist/cjs/locales/de/gad7.d.ts +4 -0
- package/dist/cjs/locales/de/gad7.js +46 -0
- package/dist/cjs/locales/de/mini-ipip.d.ts +4 -0
- package/dist/cjs/locales/de/mini-ipip.js +97 -0
- package/dist/cjs/locales/de/phq9.d.ts +4 -0
- package/dist/cjs/locales/de/phq9.js +56 -0
- package/dist/cjs/locales/de/who5.d.ts +4 -0
- package/dist/cjs/locales/de/who5.js +41 -0
- package/dist/cjs/locales/es/aq10.d.ts +4 -0
- package/dist/cjs/locales/es/aq10.js +53 -0
- package/dist/cjs/locales/es/asrs6.d.ts +4 -0
- package/dist/cjs/locales/es/asrs6.js +42 -0
- package/dist/cjs/locales/es/audit.d.ts +4 -0
- package/dist/cjs/locales/es/audit.js +80 -0
- package/dist/cjs/locales/es/dass21.d.ts +4 -0
- package/dist/cjs/locales/es/dass21.js +114 -0
- package/dist/cjs/locales/es/gad7.d.ts +4 -0
- package/dist/cjs/locales/es/gad7.js +46 -0
- package/dist/cjs/locales/es/mini-ipip.d.ts +4 -0
- package/dist/cjs/locales/es/mini-ipip.js +97 -0
- package/dist/cjs/locales/es/phq9.d.ts +4 -0
- package/dist/cjs/locales/es/phq9.js +56 -0
- package/dist/cjs/locales/es/who5.d.ts +4 -0
- package/dist/cjs/locales/es/who5.js +41 -0
- package/dist/cjs/locales/index.d.ts +12 -0
- package/dist/cjs/locales/index.js +63 -0
- package/dist/cjs/locales/tr/aq10.d.ts +4 -0
- package/dist/cjs/locales/tr/aq10.js +53 -0
- package/dist/cjs/locales/tr/asrs6.d.ts +4 -0
- package/dist/cjs/locales/tr/asrs6.js +42 -0
- package/dist/cjs/locales/tr/audit.d.ts +4 -0
- package/dist/cjs/locales/tr/audit.js +80 -0
- package/dist/cjs/locales/tr/dass21.d.ts +4 -0
- package/dist/cjs/locales/tr/dass21.js +114 -0
- package/dist/cjs/locales/tr/gad7.d.ts +4 -0
- package/dist/cjs/locales/tr/gad7.js +46 -0
- package/dist/cjs/locales/tr/mini-ipip.d.ts +4 -0
- package/dist/cjs/locales/tr/mini-ipip.js +97 -0
- package/dist/cjs/locales/tr/phq9.d.ts +4 -0
- package/dist/cjs/locales/tr/phq9.js +56 -0
- package/dist/cjs/locales/tr/who5.d.ts +4 -0
- package/dist/cjs/locales/tr/who5.js +41 -0
- package/dist/cjs/locales/zh/aq10.d.ts +4 -0
- package/dist/cjs/locales/zh/aq10.js +53 -0
- package/dist/cjs/locales/zh/asrs6.d.ts +4 -0
- package/dist/cjs/locales/zh/asrs6.js +42 -0
- package/dist/cjs/locales/zh/audit.d.ts +4 -0
- package/dist/cjs/locales/zh/audit.js +80 -0
- package/dist/cjs/locales/zh/dass21.d.ts +4 -0
- package/dist/cjs/locales/zh/dass21.js +114 -0
- package/dist/cjs/locales/zh/gad7.d.ts +4 -0
- package/dist/cjs/locales/zh/gad7.js +46 -0
- package/dist/cjs/locales/zh/mini-ipip.d.ts +4 -0
- package/dist/cjs/locales/zh/mini-ipip.js +97 -0
- package/dist/cjs/locales/zh/phq9.d.ts +4 -0
- package/dist/cjs/locales/zh/phq9.js +56 -0
- package/dist/cjs/locales/zh/who5.d.ts +4 -0
- package/dist/cjs/locales/zh/who5.js +41 -0
- package/dist/cjs/types.d.ts +30 -0
- package/dist/esm/errors.d.ts +1 -1
- package/dist/esm/i18n.d.ts +21 -1
- package/dist/esm/i18n.js +134 -0
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/inventories/aq10.js +5 -64
- package/dist/esm/inventories/asrs6.js +6 -49
- package/dist/esm/inventories/audit.js +9 -116
- package/dist/esm/inventories/common.js +0 -20
- package/dist/esm/inventories/dass21.js +19 -130
- package/dist/esm/inventories/gad7.js +5 -40
- package/dist/esm/inventories/index.d.ts +11 -2
- package/dist/esm/inventories/index.js +22 -3
- package/dist/esm/inventories/mini-ipip.js +1 -132
- package/dist/esm/inventories/phq9.js +6 -53
- package/dist/esm/inventories/who5.js +5 -56
- package/dist/esm/locales/de/aq10.d.ts +4 -0
- package/dist/esm/locales/de/aq10.js +51 -0
- package/dist/esm/locales/de/asrs6.d.ts +4 -0
- package/dist/esm/locales/de/asrs6.js +40 -0
- package/dist/esm/locales/de/audit.d.ts +4 -0
- package/dist/esm/locales/de/audit.js +78 -0
- package/dist/esm/locales/de/dass21.d.ts +4 -0
- package/dist/esm/locales/de/dass21.js +112 -0
- package/dist/esm/locales/de/gad7.d.ts +4 -0
- package/dist/esm/locales/de/gad7.js +44 -0
- package/dist/esm/locales/de/mini-ipip.d.ts +4 -0
- package/dist/esm/locales/de/mini-ipip.js +95 -0
- package/dist/esm/locales/de/phq9.d.ts +4 -0
- package/dist/esm/locales/de/phq9.js +54 -0
- package/dist/esm/locales/de/who5.d.ts +4 -0
- package/dist/esm/locales/de/who5.js +39 -0
- package/dist/esm/locales/es/aq10.d.ts +4 -0
- package/dist/esm/locales/es/aq10.js +51 -0
- package/dist/esm/locales/es/asrs6.d.ts +4 -0
- package/dist/esm/locales/es/asrs6.js +40 -0
- package/dist/esm/locales/es/audit.d.ts +4 -0
- package/dist/esm/locales/es/audit.js +78 -0
- package/dist/esm/locales/es/dass21.d.ts +4 -0
- package/dist/esm/locales/es/dass21.js +112 -0
- package/dist/esm/locales/es/gad7.d.ts +4 -0
- package/dist/esm/locales/es/gad7.js +44 -0
- package/dist/esm/locales/es/mini-ipip.d.ts +4 -0
- package/dist/esm/locales/es/mini-ipip.js +95 -0
- package/dist/esm/locales/es/phq9.d.ts +4 -0
- package/dist/esm/locales/es/phq9.js +54 -0
- package/dist/esm/locales/es/who5.d.ts +4 -0
- package/dist/esm/locales/es/who5.js +39 -0
- package/dist/esm/locales/index.d.ts +12 -0
- package/dist/esm/locales/index.js +59 -0
- package/dist/esm/locales/tr/aq10.d.ts +4 -0
- package/dist/esm/locales/tr/aq10.js +51 -0
- package/dist/esm/locales/tr/asrs6.d.ts +4 -0
- package/dist/esm/locales/tr/asrs6.js +40 -0
- package/dist/esm/locales/tr/audit.d.ts +4 -0
- package/dist/esm/locales/tr/audit.js +78 -0
- package/dist/esm/locales/tr/dass21.d.ts +4 -0
- package/dist/esm/locales/tr/dass21.js +112 -0
- package/dist/esm/locales/tr/gad7.d.ts +4 -0
- package/dist/esm/locales/tr/gad7.js +44 -0
- package/dist/esm/locales/tr/mini-ipip.d.ts +4 -0
- package/dist/esm/locales/tr/mini-ipip.js +95 -0
- package/dist/esm/locales/tr/phq9.d.ts +4 -0
- package/dist/esm/locales/tr/phq9.js +54 -0
- package/dist/esm/locales/tr/who5.d.ts +4 -0
- package/dist/esm/locales/tr/who5.js +39 -0
- package/dist/esm/locales/zh/aq10.d.ts +4 -0
- package/dist/esm/locales/zh/aq10.js +51 -0
- package/dist/esm/locales/zh/asrs6.d.ts +4 -0
- package/dist/esm/locales/zh/asrs6.js +40 -0
- package/dist/esm/locales/zh/audit.d.ts +4 -0
- package/dist/esm/locales/zh/audit.js +78 -0
- package/dist/esm/locales/zh/dass21.d.ts +4 -0
- package/dist/esm/locales/zh/dass21.js +112 -0
- package/dist/esm/locales/zh/gad7.d.ts +4 -0
- package/dist/esm/locales/zh/gad7.js +44 -0
- package/dist/esm/locales/zh/mini-ipip.d.ts +4 -0
- package/dist/esm/locales/zh/mini-ipip.js +95 -0
- package/dist/esm/locales/zh/phq9.d.ts +4 -0
- package/dist/esm/locales/zh/phq9.js +54 -0
- package/dist/esm/locales/zh/who5.d.ts +4 -0
- package/dist/esm/locales/zh/who5.js +39 -0
- package/dist/esm/types.d.ts +30 -0
- package/package.json +21 -1
- package/src/errors.ts +1 -0
- package/src/i18n.ts +176 -1
- package/src/index.ts +4 -1
- package/src/inventories/aq10.ts +5 -64
- package/src/inventories/asrs6.ts +6 -49
- package/src/inventories/audit.ts +9 -116
- package/src/inventories/common.ts +0 -20
- package/src/inventories/dass21.ts +19 -130
- package/src/inventories/gad7.ts +5 -40
- package/src/inventories/index.ts +27 -3
- package/src/inventories/mini-ipip.ts +1 -132
- package/src/inventories/phq9.ts +6 -53
- package/src/inventories/who5.ts +5 -56
- package/src/locales/de/aq10.ts +54 -0
- package/src/locales/de/asrs6.ts +43 -0
- package/src/locales/de/audit.ts +81 -0
- package/src/locales/de/dass21.ts +115 -0
- package/src/locales/de/gad7.ts +47 -0
- package/src/locales/de/mini-ipip.ts +98 -0
- package/src/locales/de/phq9.ts +57 -0
- package/src/locales/de/who5.ts +42 -0
- package/src/locales/es/aq10.ts +54 -0
- package/src/locales/es/asrs6.ts +43 -0
- package/src/locales/es/audit.ts +81 -0
- package/src/locales/es/dass21.ts +115 -0
- package/src/locales/es/gad7.ts +47 -0
- package/src/locales/es/mini-ipip.ts +98 -0
- package/src/locales/es/phq9.ts +57 -0
- package/src/locales/es/who5.ts +42 -0
- package/src/locales/index.ts +64 -0
- package/src/locales/tr/aq10.ts +54 -0
- package/src/locales/tr/asrs6.ts +43 -0
- package/src/locales/tr/audit.ts +81 -0
- package/src/locales/tr/dass21.ts +115 -0
- package/src/locales/tr/gad7.ts +47 -0
- package/src/locales/tr/mini-ipip.ts +98 -0
- package/src/locales/tr/phq9.ts +57 -0
- package/src/locales/tr/who5.ts +42 -0
- package/src/locales/zh/aq10.ts +54 -0
- package/src/locales/zh/asrs6.ts +43 -0
- package/src/locales/zh/audit.ts +81 -0
- package/src/locales/zh/dass21.ts +115 -0
- package/src/locales/zh/gad7.ts +47 -0
- package/src/locales/zh/mini-ipip.ts +98 -0
- package/src/locales/zh/phq9.ts +57 -0
- package/src/locales/zh/who5.ts +42 -0
- package/src/types.ts +25 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Give your app a validated psychological questionnaire — rendered, collected, a
|
|
|
5
5
|
```ts
|
|
6
6
|
import { loadInventory } from "psytools";
|
|
7
7
|
|
|
8
|
-
const phq9 = loadInventory("phq9");
|
|
8
|
+
const phq9 = await loadInventory("phq9"); // Patient Health Questionnaire-9
|
|
9
9
|
phq9.localize("en"); // render-ready questions & options for your UI
|
|
10
10
|
|
|
11
11
|
const response = phq9.createResponse();
|
|
@@ -23,6 +23,7 @@ That's a complete depression screening: standardized items, answer validation, p
|
|
|
23
23
|
- **Your tests too** — therapists and researchers can define their own instruments as one plain JSON object; psytools validates, localizes, and scores them the same way.
|
|
24
24
|
- **Everything is plain JSON** — assessments and responses `stringify()`/`parse()` losslessly, so definitions live in your database and travel between backend and frontend. Scoring rules are data, not code, and survive the round trip.
|
|
25
25
|
- **Safe by default** — every answer is validated against the option scale, incomplete responses can't be scored accidentally, and submitted responses are immutable.
|
|
26
|
+
- **Data minimization by default** — base definitions carry English only; other languages ship as per-inventory locale packs that are lazily imported (and only then enter memory or your bundle) when you request them.
|
|
26
27
|
- **Runs anywhere** — zero runtime dependencies; Node (>= 18), browsers, and edge runtimes; ESM + CommonJS with full TypeScript declarations.
|
|
27
28
|
|
|
28
29
|
## Install
|
|
@@ -36,7 +37,8 @@ npm install psytools
|
|
|
36
37
|
```ts
|
|
37
38
|
import { loadInventory } from "psytools";
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
// Locales are lazy: only the requested packs are loaded.
|
|
41
|
+
const phq9 = await loadInventory("phq9", { locales: ["tr"] });
|
|
40
42
|
|
|
41
43
|
// 1. Render — get a flat, single-locale view for your UI.
|
|
42
44
|
const view = phq9.localize("tr");
|
|
@@ -147,6 +149,26 @@ Questions may also carry their own `options` to override the default scale, and
|
|
|
147
149
|
|
|
148
150
|
Non-JavaScript backends can validate stored definitions against the published [JSON Schema](schema/assessment-definition.schema.json) (shipped in the npm package under `schema/`).
|
|
149
151
|
|
|
152
|
+
### Data minimization
|
|
153
|
+
|
|
154
|
+
Minimization is the default, at every layer:
|
|
155
|
+
|
|
156
|
+
- **Memory / runtime**: base definitions are English-only. `loadInventory(id, { locales })` dynamically imports just the requested locale packs and merges them — nothing else is ever loaded. `availableLocales(id)` lists what exists.
|
|
157
|
+
- **Bundles**: import a single inventory via `psytools/inventories/<id>` (~2 kB gzipped) and, for static bundling, a specific pack via `psytools/locales/<locale>/<id>`, merged with `applyLocale`:
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { phq9 } from "psytools/inventories/phq9"; // en base
|
|
161
|
+
import tr from "psytools/locales/tr/phq9"; // one language pack
|
|
162
|
+
import { Assessment, applyLocale } from "psytools";
|
|
163
|
+
|
|
164
|
+
const assessment = new Assessment(applyLocale(phq9, tr));
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Named root imports also tree-shake (`sideEffects: false`).
|
|
168
|
+
- **Payloads**: a loaded definition contains exactly the locales you asked for, so `res.json(assessment.definition)` is already minimal. To slim an existing multi-locale definition (e.g. a stored custom test), use `pickLocales(definition, [userLocale])`.
|
|
169
|
+
|
|
170
|
+
Merged definitions remain one self-contained JSON object — locale loading never breaks the `stringify → DB → parse` round trip.
|
|
171
|
+
|
|
150
172
|
### Missing answers
|
|
151
173
|
|
|
152
174
|
Declarative scoring takes an optional missing-data policy governing how incomplete answer sets are scored (they reach the scorer via raw answer maps or `allowIncomplete`):
|
|
@@ -161,6 +183,8 @@ scoring: {
|
|
|
161
183
|
|
|
162
184
|
`ignore` sums what is answered (partial totals understate severity — use deliberately); `prorate` scales the raw score up to the full item count (rounded) and refuses to score below `minAnswered`; `require-complete` throws unless every contributing non-optional item is answered. For subscale scoring the policy applies to each subscale independently.
|
|
163
185
|
|
|
186
|
+
The bundled inventories ship with policies (PHQ-9/GAD-7/DASS-21/Mini-IPIP prorate with thresholds, WHO-5/ASRS/AQ-10 require-complete, AUDIT ignores to match its skip logic) — see [SOURCES.md](SOURCES.md#missing-data-policies) for the rationale and how to override.
|
|
187
|
+
|
|
164
188
|
## Custom evaluation
|
|
165
189
|
|
|
166
190
|
Declarative scoring is optional. Pass an evaluator for anything beyond sums and subscales — it can return a single scale, multiple scales, a category, or arbitrary data:
|
|
@@ -200,8 +224,9 @@ const history = rows
|
|
|
200
224
|
| `AssessmentResponse` | `answer()`, `answerAll()`, `clearAnswer()`, `status`, `progress()`, `validate()`, `submit()`, `stringify()`/`parse()` |
|
|
201
225
|
| `evaluate(definition, answers, { evaluator? })` | Standalone scoring (also available as `Assessment#evaluate`) |
|
|
202
226
|
| `validateDefinition(input)` | Non-throwing structural validation of definitions |
|
|
203
|
-
| `loadInventory(id)` / `inventories` | Predefined instruments (definitions also exported by name) |
|
|
204
|
-
| `
|
|
227
|
+
| `loadInventory(id, { locales? })` / `inventories` | Predefined instruments (async; English-only base definitions also exported by name) |
|
|
228
|
+
| `applyLocale(definition, pack)` / `availableLocales(id)` / `localePacks` | Lazy per-inventory locale packs |
|
|
229
|
+
| `localizeText(text, locale, fallback?)` / `collectLocales(texts)` / `pickLocales(definition, locales)` | Locale helpers |
|
|
205
230
|
| `PsytoolsError` | All errors carry a `code` typed as `PsytoolsErrorCode` (e.g. `invalid_value`, `already_submitted`) |
|
|
206
231
|
|
|
207
232
|
## Development
|
package/SOURCES.md
CHANGED
|
@@ -24,7 +24,22 @@ The same provenance applies to every bundled inventory. If an inventory ever dev
|
|
|
24
24
|
| zh | AI translation (Anthropic Claude, `claude-fable-5`) from the original English | No |
|
|
25
25
|
| es | AI translation (Anthropic Claude, `claude-fable-5`) from the original English | No |
|
|
26
26
|
|
|
27
|
-
Official validated translations exist for most of these instruments, but they were **not consulted** in preparing the bundled texts, so they are deliberately not cited as sources. The packaged
|
|
27
|
+
Official validated translations exist for most of these instruments, but they were **not consulted** in preparing the bundled texts, so they are deliberately not cited as sources. The packaged non-English wording has not been checked against them and has not been psychometrically validated. Validated instruments are only validated for their exact wording — before clinical or research use, obtain the official version for your language and compare or replace the text.
|
|
28
|
+
|
|
29
|
+
Non-English texts live as one file per inventory per language under [`src/locales/<locale>/`](src/locales) — exactly the unit a native-speaker reviewer needs. Verification contributions are very welcome.
|
|
30
|
+
|
|
31
|
+
## Missing-data policies
|
|
32
|
+
|
|
33
|
+
Bundled inventories ship with declarative missing-data policies (`scoring.missing`). **The prorating thresholds are implementation choices reflecting common research practice — they are not part of the instruments' official scoring rules.** Override by cloning the definition if your protocol differs.
|
|
34
|
+
|
|
35
|
+
| Inventory | Policy | Rationale |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `phq9` | prorate, ≥7 of 9 answered | Common research practice (≈75% completion) |
|
|
38
|
+
| `gad7` | prorate, ≥6 of 7 answered | Common research practice |
|
|
39
|
+
| `dass21` | prorate, ≥6 of 7 per subscale | DASS manual tolerates occasional missing items |
|
|
40
|
+
| `mini-ipip` | prorate, ≥3 of 4 per trait | IPIP scoring is mean-based; prorating is equivalent |
|
|
41
|
+
| `who5`, `asrs6`, `aq10` | require-complete | Short instruments; cutoffs/counts are undefined for partial data |
|
|
42
|
+
| `audit` | ignore | Unanswered items score 0, matching the instrument's skip logic (e.g. non-drinkers skipping items 2–8) |
|
|
28
43
|
|
|
29
44
|
## PHQ-9 — Patient Health Questionnaire-9 (`phq9`)
|
|
30
45
|
|
package/dist/cjs/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Every error code psytools can throw, for exhaustive handling. */
|
|
2
|
-
export type PsytoolsErrorCode = "malformed" | "duplicate_question" | "invalid_definition" | "unknown_question" | "invalid_value" | "missing_answer" | "already_submitted" | "invalid_response" | "incomplete_response" | "assessment_mismatch" | "no_scoring" | "invalid_json" | "unknown_inventory" | "invalid_argument";
|
|
2
|
+
export type PsytoolsErrorCode = "malformed" | "duplicate_question" | "invalid_definition" | "unknown_question" | "invalid_value" | "missing_answer" | "already_submitted" | "invalid_response" | "incomplete_response" | "assessment_mismatch" | "no_scoring" | "invalid_json" | "unknown_inventory" | "unknown_locale" | "invalid_argument";
|
|
3
3
|
/** Error thrown by psytools, carrying a stable machine-readable code. */
|
|
4
4
|
export declare class PsytoolsError extends Error {
|
|
5
5
|
readonly code: PsytoolsErrorCode;
|
package/dist/cjs/i18n.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LocalizedText } from "./types.ts";
|
|
1
|
+
import type { AssessmentDefinition, InventoryLocalePack, LocalizedText } from "./types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Resolves a `LocalizedText` to a string for the given locale.
|
|
4
4
|
*
|
|
@@ -6,5 +6,25 @@ import type { LocalizedText } from "./types.ts";
|
|
|
6
6
|
* (`"de-AT"` -> `"de"`) -> `fallbackLocale` -> first available entry.
|
|
7
7
|
*/
|
|
8
8
|
export declare function localizeText(text: LocalizedText, locale: string, fallbackLocale?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Merges a locale pack into a definition, returning a new definition that
|
|
11
|
+
* additionally carries the pack's language in every localized text. The
|
|
12
|
+
* original definition and the pack are not modified.
|
|
13
|
+
*
|
|
14
|
+
* Packs may be partial (untranslated entries keep their existing locales),
|
|
15
|
+
* but entries referencing unknown question/band/flag/subscale ids or
|
|
16
|
+
* mismatched option counts throw `invalid_argument`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyLocale(definition: AssessmentDefinition, pack: InventoryLocalePack): AssessmentDefinition;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a copy of a definition containing only the given locales in every
|
|
21
|
+
* localized text (questions, options, bands, flags, subscales). The
|
|
22
|
+
* definition's `defaultLocale` is always kept as the fallback.
|
|
23
|
+
*
|
|
24
|
+
* Use this at the server boundary to avoid shipping unused languages to a
|
|
25
|
+
* client: `res.json(pickLocales(phq9, [userLocale]))`. The original
|
|
26
|
+
* definition is not modified.
|
|
27
|
+
*/
|
|
28
|
+
export declare function pickLocales(definition: AssessmentDefinition, locales: string[]): AssessmentDefinition;
|
|
9
29
|
/** Collects the union of locales present in a set of localized texts. */
|
|
10
30
|
export declare function collectLocales(texts: Array<LocalizedText | undefined>): string[];
|
package/dist/cjs/i18n.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.localizeText = localizeText;
|
|
4
|
+
exports.applyLocale = applyLocale;
|
|
5
|
+
exports.pickLocales = pickLocales;
|
|
4
6
|
exports.collectLocales = collectLocales;
|
|
7
|
+
const errors_ts_1 = require("./errors.js");
|
|
5
8
|
/**
|
|
6
9
|
* Resolves a `LocalizedText` to a string for the given locale.
|
|
7
10
|
*
|
|
@@ -22,6 +25,139 @@ function localizeText(text, locale, fallbackLocale) {
|
|
|
22
25
|
const first = Object.values(text)[0];
|
|
23
26
|
return first ?? "";
|
|
24
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Merges a locale pack into a definition, returning a new definition that
|
|
30
|
+
* additionally carries the pack's language in every localized text. The
|
|
31
|
+
* original definition and the pack are not modified.
|
|
32
|
+
*
|
|
33
|
+
* Packs may be partial (untranslated entries keep their existing locales),
|
|
34
|
+
* but entries referencing unknown question/band/flag/subscale ids or
|
|
35
|
+
* mismatched option counts throw `invalid_argument`.
|
|
36
|
+
*/
|
|
37
|
+
function applyLocale(definition, pack) {
|
|
38
|
+
if (pack.id !== definition.id) {
|
|
39
|
+
throw new errors_ts_1.PsytoolsError("invalid_argument", `Locale pack "${pack.id}" (${pack.locale}) does not belong to assessment "${definition.id}"`);
|
|
40
|
+
}
|
|
41
|
+
const set = (text, value) => value === undefined ? text : { ...text, [pack.locale]: value };
|
|
42
|
+
const setOptions = (options, labels, where) => {
|
|
43
|
+
if (!labels)
|
|
44
|
+
return options;
|
|
45
|
+
if (labels.length !== options.length) {
|
|
46
|
+
throw new errors_ts_1.PsytoolsError("invalid_argument", `Locale pack "${pack.id}/${pack.locale}": ${where} has ${labels.length} labels for ${options.length} options`);
|
|
47
|
+
}
|
|
48
|
+
return options.map((option, i) => ({ ...option, label: set(option.label, labels[i]) }));
|
|
49
|
+
};
|
|
50
|
+
const setBands = (bands, packBands) => bands?.map((band) => ({ ...band, label: set(band.label, packBands?.[band.id]) }));
|
|
51
|
+
const setFlags = (flags, packFlags) => flags?.map((flag) => ({ ...flag, label: set(flag.label, packFlags?.[flag.id]) }));
|
|
52
|
+
for (const questionId of Object.keys(pack.questions)) {
|
|
53
|
+
if (!definition.questions.some((q) => q.id === questionId)) {
|
|
54
|
+
throw new errors_ts_1.PsytoolsError("invalid_argument", `Locale pack "${pack.id}/${pack.locale}" references unknown question "${questionId}"`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
let scoring;
|
|
58
|
+
if (definition.scoring) {
|
|
59
|
+
const s = definition.scoring;
|
|
60
|
+
if (s.kind === "subscales") {
|
|
61
|
+
scoring = {
|
|
62
|
+
...s,
|
|
63
|
+
subscales: s.subscales.map((subscale) => {
|
|
64
|
+
const entry = pack.subscales?.[subscale.id];
|
|
65
|
+
return {
|
|
66
|
+
...subscale,
|
|
67
|
+
label: set(subscale.label, entry?.label),
|
|
68
|
+
...(subscale.bands ? { bands: setBands(subscale.bands, entry?.bands) } : {}),
|
|
69
|
+
};
|
|
70
|
+
}),
|
|
71
|
+
...(s.flags ? { flags: setFlags(s.flags, pack.flags) } : {}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
scoring = {
|
|
76
|
+
...s,
|
|
77
|
+
...(s.bands ? { bands: setBands(s.bands, pack.bands) } : {}),
|
|
78
|
+
...(s.flags ? { flags: setFlags(s.flags, pack.flags) } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
...definition,
|
|
84
|
+
title: set(definition.title, pack.title),
|
|
85
|
+
...(definition.description ? { description: set(definition.description, pack.description) } : {}),
|
|
86
|
+
...(definition.instructions ? { instructions: set(definition.instructions, pack.instructions) } : {}),
|
|
87
|
+
options: setOptions(definition.options, pack.options, "options"),
|
|
88
|
+
questions: definition.questions.map((question) => {
|
|
89
|
+
const entry = pack.questions[question.id];
|
|
90
|
+
if (!entry)
|
|
91
|
+
return question;
|
|
92
|
+
return {
|
|
93
|
+
...question,
|
|
94
|
+
text: set(question.text, entry.text),
|
|
95
|
+
...(question.options
|
|
96
|
+
? { options: setOptions(question.options, entry.options, `question "${question.id}"`) }
|
|
97
|
+
: {}),
|
|
98
|
+
};
|
|
99
|
+
}),
|
|
100
|
+
...(scoring ? { scoring } : {}),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns a copy of a definition containing only the given locales in every
|
|
105
|
+
* localized text (questions, options, bands, flags, subscales). The
|
|
106
|
+
* definition's `defaultLocale` is always kept as the fallback.
|
|
107
|
+
*
|
|
108
|
+
* Use this at the server boundary to avoid shipping unused languages to a
|
|
109
|
+
* client: `res.json(pickLocales(phq9, [userLocale]))`. The original
|
|
110
|
+
* definition is not modified.
|
|
111
|
+
*/
|
|
112
|
+
function pickLocales(definition, locales) {
|
|
113
|
+
const keep = new Set([...locales, definition.defaultLocale]);
|
|
114
|
+
const pick = (text) => {
|
|
115
|
+
const out = {};
|
|
116
|
+
for (const [locale, value] of Object.entries(text)) {
|
|
117
|
+
if (keep.has(locale))
|
|
118
|
+
out[locale] = value;
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
121
|
+
};
|
|
122
|
+
const pickOptions = (options) => options.map((option) => ({ ...option, label: pick(option.label) }));
|
|
123
|
+
const pickBands = (bands) => bands.map((band) => ({ ...band, label: pick(band.label) }));
|
|
124
|
+
const pickFlags = (flags) => flags.map((flag) => ({ ...flag, label: pick(flag.label) }));
|
|
125
|
+
let scoring;
|
|
126
|
+
if (definition.scoring) {
|
|
127
|
+
const s = definition.scoring;
|
|
128
|
+
if (s.kind === "subscales") {
|
|
129
|
+
scoring = {
|
|
130
|
+
...s,
|
|
131
|
+
subscales: s.subscales.map((subscale) => ({
|
|
132
|
+
...subscale,
|
|
133
|
+
label: pick(subscale.label),
|
|
134
|
+
...(subscale.bands ? { bands: pickBands(subscale.bands) } : {}),
|
|
135
|
+
})),
|
|
136
|
+
...(s.flags ? { flags: pickFlags(s.flags) } : {}),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
scoring = {
|
|
141
|
+
...s,
|
|
142
|
+
...(s.bands ? { bands: pickBands(s.bands) } : {}),
|
|
143
|
+
...(s.flags ? { flags: pickFlags(s.flags) } : {}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
...definition,
|
|
149
|
+
title: pick(definition.title),
|
|
150
|
+
...(definition.description ? { description: pick(definition.description) } : {}),
|
|
151
|
+
...(definition.instructions ? { instructions: pick(definition.instructions) } : {}),
|
|
152
|
+
options: pickOptions(definition.options),
|
|
153
|
+
questions: definition.questions.map((question) => ({
|
|
154
|
+
...question,
|
|
155
|
+
text: pick(question.text),
|
|
156
|
+
...(question.options ? { options: pickOptions(question.options) } : {}),
|
|
157
|
+
})),
|
|
158
|
+
...(scoring ? { scoring } : {}),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
25
161
|
/** Collects the union of locales present in a set of localized texts. */
|
|
26
162
|
function collectLocales(texts) {
|
|
27
163
|
const locales = new Set();
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export type { LocalizedText, AssessmentOption, AssessmentQuestion, AssessmentDefinition, ScoreBand, ScoreFlag, SumScoring, SubscaleDefinition, SubscaleScoring, CountScoringItem, CountScoring, MissingDataPolicy, MissingDataStrategy, ScoringDefinition, ValidationIssueCode, AnswerMap, ResponseStatus, ResponseData, ValidationIssue, ValidationResult, BandResult, TriggeredFlag, ScaleScore, ScaleResult, MultiScaleResult, CategoricalResult, CustomResult, EvaluationResult, Evaluator, LocalizedAssessmentView, } from "./types.ts";
|
|
1
|
+
export type { LocalizedText, AssessmentOption, AssessmentQuestion, AssessmentDefinition, ScoreBand, ScoreFlag, SumScoring, SubscaleDefinition, SubscaleScoring, CountScoringItem, CountScoring, MissingDataPolicy, MissingDataStrategy, ScoringDefinition, ValidationIssueCode, AnswerMap, InventoryLocalePack, ResponseStatus, ResponseData, ValidationIssue, ValidationResult, BandResult, TriggeredFlag, ScaleScore, ScaleResult, MultiScaleResult, CategoricalResult, CustomResult, EvaluationResult, Evaluator, LocalizedAssessmentView, } from "./types.ts";
|
|
2
2
|
export { PsytoolsError } from "./errors.ts";
|
|
3
3
|
export type { PsytoolsErrorCode } from "./errors.ts";
|
|
4
|
-
export { localizeText, collectLocales } from "./i18n.ts";
|
|
4
|
+
export { localizeText, collectLocales, pickLocales, applyLocale } from "./i18n.ts";
|
|
5
|
+
export { localePacks, availableLocales } from "./locales/index.ts";
|
|
6
|
+
export type { LocalePackLoader } from "./locales/index.ts";
|
|
5
7
|
export { Assessment, validateDefinition } from "./assessment.ts";
|
|
6
8
|
export { AssessmentResponse } from "./response.ts";
|
|
7
9
|
export { evaluate } from "./evaluation.ts";
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.twoWeekInstructions = exports.twoWeekFrequencyOptions = exports.loadInventory = exports.inventories = exports.miniIpip = exports.audit = exports.aq10 = exports.asrs6 = exports.who5 = exports.dass21 = exports.gad7 = exports.phq9 = exports.evaluate = exports.AssessmentResponse = exports.validateDefinition = exports.Assessment = exports.collectLocales = exports.localizeText = exports.PsytoolsError = void 0;
|
|
3
|
+
exports.twoWeekInstructions = exports.twoWeekFrequencyOptions = exports.loadInventory = exports.inventories = exports.miniIpip = exports.audit = exports.aq10 = exports.asrs6 = exports.who5 = exports.dass21 = exports.gad7 = exports.phq9 = exports.evaluate = exports.AssessmentResponse = exports.validateDefinition = exports.Assessment = exports.availableLocales = exports.localePacks = exports.applyLocale = exports.pickLocales = exports.collectLocales = exports.localizeText = exports.PsytoolsError = void 0;
|
|
4
4
|
var errors_ts_1 = require("./errors.js");
|
|
5
5
|
Object.defineProperty(exports, "PsytoolsError", { enumerable: true, get: function () { return errors_ts_1.PsytoolsError; } });
|
|
6
6
|
var i18n_ts_1 = require("./i18n.js");
|
|
7
7
|
Object.defineProperty(exports, "localizeText", { enumerable: true, get: function () { return i18n_ts_1.localizeText; } });
|
|
8
8
|
Object.defineProperty(exports, "collectLocales", { enumerable: true, get: function () { return i18n_ts_1.collectLocales; } });
|
|
9
|
+
Object.defineProperty(exports, "pickLocales", { enumerable: true, get: function () { return i18n_ts_1.pickLocales; } });
|
|
10
|
+
Object.defineProperty(exports, "applyLocale", { enumerable: true, get: function () { return i18n_ts_1.applyLocale; } });
|
|
11
|
+
var index_ts_1 = require("./locales/index.js");
|
|
12
|
+
Object.defineProperty(exports, "localePacks", { enumerable: true, get: function () { return index_ts_1.localePacks; } });
|
|
13
|
+
Object.defineProperty(exports, "availableLocales", { enumerable: true, get: function () { return index_ts_1.availableLocales; } });
|
|
9
14
|
var assessment_ts_1 = require("./assessment.js");
|
|
10
15
|
Object.defineProperty(exports, "Assessment", { enumerable: true, get: function () { return assessment_ts_1.Assessment; } });
|
|
11
16
|
Object.defineProperty(exports, "validateDefinition", { enumerable: true, get: function () { return assessment_ts_1.validateDefinition; } });
|
|
@@ -13,16 +18,16 @@ var response_ts_1 = require("./response.js");
|
|
|
13
18
|
Object.defineProperty(exports, "AssessmentResponse", { enumerable: true, get: function () { return response_ts_1.AssessmentResponse; } });
|
|
14
19
|
var evaluation_ts_1 = require("./evaluation.js");
|
|
15
20
|
Object.defineProperty(exports, "evaluate", { enumerable: true, get: function () { return evaluation_ts_1.evaluate; } });
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "phq9", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "gad7", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "dass21", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "who5", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "asrs6", { enumerable: true, get: function () { return
|
|
22
|
-
Object.defineProperty(exports, "aq10", { enumerable: true, get: function () { return
|
|
23
|
-
Object.defineProperty(exports, "audit", { enumerable: true, get: function () { return
|
|
24
|
-
Object.defineProperty(exports, "miniIpip", { enumerable: true, get: function () { return
|
|
25
|
-
Object.defineProperty(exports, "inventories", { enumerable: true, get: function () { return
|
|
26
|
-
Object.defineProperty(exports, "loadInventory", { enumerable: true, get: function () { return
|
|
27
|
-
Object.defineProperty(exports, "twoWeekFrequencyOptions", { enumerable: true, get: function () { return
|
|
28
|
-
Object.defineProperty(exports, "twoWeekInstructions", { enumerable: true, get: function () { return
|
|
21
|
+
var index_ts_2 = require("./inventories/index.js");
|
|
22
|
+
Object.defineProperty(exports, "phq9", { enumerable: true, get: function () { return index_ts_2.phq9; } });
|
|
23
|
+
Object.defineProperty(exports, "gad7", { enumerable: true, get: function () { return index_ts_2.gad7; } });
|
|
24
|
+
Object.defineProperty(exports, "dass21", { enumerable: true, get: function () { return index_ts_2.dass21; } });
|
|
25
|
+
Object.defineProperty(exports, "who5", { enumerable: true, get: function () { return index_ts_2.who5; } });
|
|
26
|
+
Object.defineProperty(exports, "asrs6", { enumerable: true, get: function () { return index_ts_2.asrs6; } });
|
|
27
|
+
Object.defineProperty(exports, "aq10", { enumerable: true, get: function () { return index_ts_2.aq10; } });
|
|
28
|
+
Object.defineProperty(exports, "audit", { enumerable: true, get: function () { return index_ts_2.audit; } });
|
|
29
|
+
Object.defineProperty(exports, "miniIpip", { enumerable: true, get: function () { return index_ts_2.miniIpip; } });
|
|
30
|
+
Object.defineProperty(exports, "inventories", { enumerable: true, get: function () { return index_ts_2.inventories; } });
|
|
31
|
+
Object.defineProperty(exports, "loadInventory", { enumerable: true, get: function () { return index_ts_2.loadInventory; } });
|
|
32
|
+
Object.defineProperty(exports, "twoWeekFrequencyOptions", { enumerable: true, get: function () { return index_ts_2.twoWeekFrequencyOptions; } });
|
|
33
|
+
Object.defineProperty(exports, "twoWeekInstructions", { enumerable: true, get: function () { return index_ts_2.twoWeekInstructions; } });
|
|
@@ -16,42 +16,30 @@ exports.aq10 = {
|
|
|
16
16
|
version: "1.0.0",
|
|
17
17
|
title: {
|
|
18
18
|
en: "Autism Spectrum Quotient (AQ-10) — Adult",
|
|
19
|
-
tr: "Otizm Spektrum Anketi (AQ-10) — Yetişkin",
|
|
20
|
-
de: "Autismus-Spektrum-Quotient (AQ-10) — Erwachsene",
|
|
21
|
-
zh: "自闭症谱系商数问卷(AQ-10)— 成人版",
|
|
22
|
-
es: "Cociente del Espectro Autista (AQ-10) — Adultos",
|
|
23
19
|
},
|
|
24
20
|
description: {
|
|
25
21
|
en: "A 10-item screening questionnaire for autistic traits in adults, condensed from the 50-item Autism Spectrum Quotient.",
|
|
26
|
-
tr: "50 maddelik Otizm Spektrum Anketi'nden kısaltılmış, yetişkinlerde otistik özellikleri taramak için 10 maddelik bir ölçek.",
|
|
27
|
-
de: "Ein 10-Item-Screeningfragebogen für autistische Merkmale bei Erwachsenen, verkürzt aus dem 50-Item-Autismus-Spektrum-Quotienten.",
|
|
28
|
-
zh: "一份用于筛查成人自闭症特质的10条目问卷,由50条目的自闭症谱系商数量表精简而成。",
|
|
29
|
-
es: "Un cuestionario de cribado de 10 ítems para rasgos autistas en adultos, condensado a partir del Cociente del Espectro Autista de 50 ítems.",
|
|
30
22
|
},
|
|
31
23
|
instructions: {
|
|
32
24
|
en: "For each statement, select the answer that best describes you.",
|
|
33
|
-
tr: "Her ifade için sizi en iyi tanımlayan yanıtı işaretleyin.",
|
|
34
|
-
de: "Wählen Sie zu jeder Aussage die Antwort, die Sie am besten beschreibt.",
|
|
35
|
-
zh: "请针对每条陈述,选择最符合您情况的答案。",
|
|
36
|
-
es: "Para cada afirmación, seleccione la respuesta que mejor lo describa.",
|
|
37
25
|
},
|
|
38
26
|
defaultLocale: "en",
|
|
39
27
|
options: [
|
|
40
28
|
{
|
|
41
29
|
value: 0,
|
|
42
|
-
label: { en: "Definitely disagree"
|
|
30
|
+
label: { en: "Definitely disagree" },
|
|
43
31
|
},
|
|
44
32
|
{
|
|
45
33
|
value: 1,
|
|
46
|
-
label: { en: "Slightly disagree"
|
|
34
|
+
label: { en: "Slightly disagree" },
|
|
47
35
|
},
|
|
48
36
|
{
|
|
49
37
|
value: 2,
|
|
50
|
-
label: { en: "Slightly agree"
|
|
38
|
+
label: { en: "Slightly agree" },
|
|
51
39
|
},
|
|
52
40
|
{
|
|
53
41
|
value: 3,
|
|
54
|
-
label: { en: "Definitely agree"
|
|
42
|
+
label: { en: "Definitely agree" },
|
|
55
43
|
},
|
|
56
44
|
],
|
|
57
45
|
questions: [
|
|
@@ -59,20 +47,12 @@ exports.aq10 = {
|
|
|
59
47
|
id: "aq10-1",
|
|
60
48
|
text: {
|
|
61
49
|
en: "I often notice small sounds when others do not",
|
|
62
|
-
tr: "Başkalarının fark etmediği küçük sesleri sıklıkla fark ederim",
|
|
63
|
-
de: "Ich nehme oft leise Geräusche wahr, die andere nicht bemerken",
|
|
64
|
-
zh: "我经常注意到别人注意不到的微小声音",
|
|
65
|
-
es: "A menudo noto pequeños sonidos que otras personas no perciben",
|
|
66
50
|
},
|
|
67
51
|
},
|
|
68
52
|
{
|
|
69
53
|
id: "aq10-2",
|
|
70
54
|
text: {
|
|
71
55
|
en: "I usually concentrate more on the whole picture, rather than the small details",
|
|
72
|
-
tr: "Genellikle küçük ayrıntılardan çok resmin bütününe odaklanırım",
|
|
73
|
-
de: "Ich konzentriere mich meist mehr auf das Gesamtbild als auf die kleinen Details",
|
|
74
|
-
zh: "我通常更关注事情的整体,而不是小细节",
|
|
75
|
-
es: "Normalmente me concentro más en la imagen global que en los pequeños detalles",
|
|
76
56
|
},
|
|
77
57
|
reverseScored: true,
|
|
78
58
|
},
|
|
@@ -80,10 +60,6 @@ exports.aq10 = {
|
|
|
80
60
|
id: "aq10-3",
|
|
81
61
|
text: {
|
|
82
62
|
en: "I find it easy to do more than one thing at once",
|
|
83
|
-
tr: "Aynı anda birden fazla iş yapmak benim için kolaydır",
|
|
84
|
-
de: "Es fällt mir leicht, mehrere Dinge gleichzeitig zu tun",
|
|
85
|
-
zh: "我觉得同时做几件事情很容易",
|
|
86
|
-
es: "Me resulta fácil hacer más de una cosa a la vez",
|
|
87
63
|
},
|
|
88
64
|
reverseScored: true,
|
|
89
65
|
},
|
|
@@ -91,10 +67,6 @@ exports.aq10 = {
|
|
|
91
67
|
id: "aq10-4",
|
|
92
68
|
text: {
|
|
93
69
|
en: "If there is an interruption, I can switch back to what I was doing very quickly",
|
|
94
|
-
tr: "Bir kesinti olursa, yapmakta olduğum işe çok hızlı bir şekilde geri dönebilirim",
|
|
95
|
-
de: "Wenn ich unterbrochen werde, kann ich sehr schnell zu meiner Tätigkeit zurückkehren",
|
|
96
|
-
zh: "如果被打断,我能很快回到原来正在做的事情上",
|
|
97
|
-
es: "Si hay una interrupción, puedo volver muy rápidamente a lo que estaba haciendo",
|
|
98
70
|
},
|
|
99
71
|
reverseScored: true,
|
|
100
72
|
},
|
|
@@ -102,10 +74,6 @@ exports.aq10 = {
|
|
|
102
74
|
id: "aq10-5",
|
|
103
75
|
text: {
|
|
104
76
|
en: "I find it easy to 'read between the lines' when someone is talking to me",
|
|
105
|
-
tr: "Biri benimle konuşurken 'satır aralarını okumak' benim için kolaydır",
|
|
106
|
-
de: "Es fällt mir leicht, 'zwischen den Zeilen zu lesen', wenn jemand mit mir spricht",
|
|
107
|
-
zh: "当别人和我说话时,我觉得'听出言外之意'很容易",
|
|
108
|
-
es: "Me resulta fácil 'leer entre líneas' cuando alguien me está hablando",
|
|
109
77
|
},
|
|
110
78
|
reverseScored: true,
|
|
111
79
|
},
|
|
@@ -113,10 +81,6 @@ exports.aq10 = {
|
|
|
113
81
|
id: "aq10-6",
|
|
114
82
|
text: {
|
|
115
83
|
en: "I know how to tell if someone listening to me is getting bored",
|
|
116
|
-
tr: "Beni dinleyen birinin sıkılmaya başladığını nasıl anlayacağımı bilirim",
|
|
117
|
-
de: "Ich erkenne, ob jemand, der mir zuhört, sich zu langweilen beginnt",
|
|
118
|
-
zh: "我知道如何判断听我说话的人是否开始感到厌烦",
|
|
119
|
-
es: "Sé darme cuenta de si la persona que me escucha se está aburriendo",
|
|
120
84
|
},
|
|
121
85
|
reverseScored: true,
|
|
122
86
|
},
|
|
@@ -124,30 +88,18 @@ exports.aq10 = {
|
|
|
124
88
|
id: "aq10-7",
|
|
125
89
|
text: {
|
|
126
90
|
en: "When I'm reading a story I find it difficult to work out the characters' intentions",
|
|
127
|
-
tr: "Bir öykü okurken karakterlerin niyetlerini anlamakta zorlanırım",
|
|
128
|
-
de: "Wenn ich eine Geschichte lese, fällt es mir schwer, die Absichten der Figuren zu erkennen",
|
|
129
|
-
zh: "读故事时,我很难弄清人物的意图",
|
|
130
|
-
es: "Cuando leo una historia, me resulta difícil deducir las intenciones de los personajes",
|
|
131
91
|
},
|
|
132
92
|
},
|
|
133
93
|
{
|
|
134
94
|
id: "aq10-8",
|
|
135
95
|
text: {
|
|
136
96
|
en: "I like to collect information about categories of things (e.g. types of car, types of bird, types of train, types of plant etc)",
|
|
137
|
-
tr: "Belirli kategorilerdeki şeyler hakkında bilgi toplamayı severim (örneğin araba türleri, kuş türleri, tren türleri, bitki türleri vb.)",
|
|
138
|
-
de: "Ich sammle gern Informationen über Kategorien von Dingen (z. B. Auto-, Vogel-, Zug- oder Pflanzenarten)",
|
|
139
|
-
zh: "我喜欢收集各类事物的信息(例如汽车的类型、鸟的种类、火车的类型、植物的种类等)",
|
|
140
|
-
es: "Me gusta recopilar información sobre categorías de cosas (p. ej., tipos de coches, de aves, de trenes, de plantas, etc.)",
|
|
141
97
|
},
|
|
142
98
|
},
|
|
143
99
|
{
|
|
144
100
|
id: "aq10-9",
|
|
145
101
|
text: {
|
|
146
102
|
en: "I find it easy to work out what someone is thinking or feeling just by looking at their face",
|
|
147
|
-
tr: "Sadece yüzüne bakarak birinin ne düşündüğünü ya da hissettiğini anlamak benim için kolaydır",
|
|
148
|
-
de: "Es fällt mir leicht, allein am Gesicht abzulesen, was jemand denkt oder fühlt",
|
|
149
|
-
zh: "我觉得只看别人的脸就能轻松看出对方在想什么或有什么感受",
|
|
150
|
-
es: "Me resulta fácil deducir lo que alguien piensa o siente con solo mirarle la cara",
|
|
151
103
|
},
|
|
152
104
|
reverseScored: true,
|
|
153
105
|
},
|
|
@@ -155,15 +107,12 @@ exports.aq10 = {
|
|
|
155
107
|
id: "aq10-10",
|
|
156
108
|
text: {
|
|
157
109
|
en: "I find it difficult to work out people's intentions",
|
|
158
|
-
tr: "İnsanların niyetlerini anlamakta zorlanırım",
|
|
159
|
-
de: "Es fällt mir schwer, die Absichten anderer Menschen zu erkennen",
|
|
160
|
-
zh: "我很难弄清别人的意图",
|
|
161
|
-
es: "Me resulta difícil deducir las intenciones de las personas",
|
|
162
110
|
},
|
|
163
111
|
},
|
|
164
112
|
],
|
|
165
113
|
scoring: {
|
|
166
114
|
kind: "count",
|
|
115
|
+
missing: { strategy: "require-complete" },
|
|
167
116
|
items: [
|
|
168
117
|
{ questionId: "aq10-1", minValue: 2 },
|
|
169
118
|
{ questionId: "aq10-2", minValue: 2 },
|
|
@@ -183,10 +132,6 @@ exports.aq10 = {
|
|
|
183
132
|
max: 5,
|
|
184
133
|
label: {
|
|
185
134
|
en: "Below screening threshold",
|
|
186
|
-
tr: "Tarama eşiğinin altında",
|
|
187
|
-
de: "Unterhalb der Screening-Schwelle",
|
|
188
|
-
zh: "低于筛查阈值",
|
|
189
|
-
es: "Por debajo del umbral de cribado",
|
|
190
135
|
},
|
|
191
136
|
},
|
|
192
137
|
{
|
|
@@ -195,10 +140,6 @@ exports.aq10 = {
|
|
|
195
140
|
max: 10,
|
|
196
141
|
label: {
|
|
197
142
|
en: "At or above threshold — consider referral for a specialist autism assessment",
|
|
198
|
-
tr: "Eşikte ya da üzerinde — uzman otizm değerlendirmesine yönlendirme düşünülmelidir",
|
|
199
|
-
de: "An oder über der Schwelle — Überweisung zu einer spezialisierten Autismus-Diagnostik erwägen",
|
|
200
|
-
zh: "达到或超过阈值——建议考虑转介进行自闭症专科评估",
|
|
201
|
-
es: "En el umbral o por encima — considere la derivación para una evaluación especializada de autismo",
|
|
202
143
|
},
|
|
203
144
|
},
|
|
204
145
|
],
|