Skip to content

Commit 6b42488

Browse files
committed
feat: add TEN_ITEM_PERSONALITY_INVENTORY
1 parent 0924916 commit 6b42488

File tree

1 file changed

+258
-0
lines changed
  • packages/instrument-library/src/forms/TEN_ITEM_PERSONALITY_INVENTORY

1 file changed

+258
-0
lines changed
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core';
2+
import { z } from '/runtime/v1/[email protected]';
3+
4+
const $IntScale = z.number().int().min(1).max(7);
5+
const $ContinuousScale = z.number().min(1).max(7);
6+
7+
const scaleOptions = {
8+
en: {
9+
1: 'Disagree strongly',
10+
2: 'Disagree moderately',
11+
3: 'Disagree a little',
12+
4: 'Neither agree or disagree',
13+
5: 'Agree a little',
14+
6: 'Agree moderately',
15+
7: 'Agree strongly'
16+
},
17+
fr: {
18+
1: 'Fortement en désaccord',
19+
2: 'En désaccord',
20+
3: 'Légèrement en désaccord',
21+
4: 'Ni en désaccord ni en accord',
22+
5: 'Légèrement en accord',
23+
6: 'En accord',
24+
7: 'Fortement en accord'
25+
}
26+
};
27+
28+
/** compute reverse score, i.e. 1 become 7, 2 becomes 6, etc. */
29+
function reverseScore(score: number): number {
30+
return 8 - score;
31+
}
32+
33+
/** compute final score by doing ((reverseScore(a) + b) / 2) */
34+
const computeScore = (a: number, b: number) => (((reverseScore(a) + b) / 2) * 100) / 100;
35+
36+
export default defineInstrument({
37+
kind: 'FORM',
38+
language: ['en', 'fr'],
39+
internal: {
40+
name: 'TEN_ITEM_PERSONALITY_INVENTORY',
41+
edition: 1
42+
},
43+
tags: {
44+
en: [
45+
'personality',
46+
'traits',
47+
'extraversion',
48+
'agreeableness',
49+
'conscientiousness',
50+
'emotional',
51+
'stability',
52+
'openness'
53+
],
54+
fr: ['personnalité', 'traits', 'extraversion', 'amabilité', 'conscience', 'émotionnel', 'stabilité', 'ouverture']
55+
},
56+
details: {
57+
description: {
58+
en: 'The Ten-Item Personality Inventory (TIPI) is a brief instrument designed to assess the five-factor model (FFM) personality dimensions. It was specifically developed to provide a brief assessment option in situations where using more comprehensive FFM instruments would be unfeasible.',
59+
fr: "L'inventaire de personnalité en dix éléments (TIPI) est un bref instrument conçu pour évaluer les dimensions de la personnalité du modèle à cinq facteurs (FFM). Il a été spécifiquement développé pour fournir une brève option d’évaluation dans les situations où l’utilisation d’instruments FFM plus complets serait impossible."
60+
},
61+
estimatedDuration: 5,
62+
instructions: {
63+
en: ['Please respond to every question'],
64+
fr: ['Veuillez répondre à toutes les questions']
65+
},
66+
license: 'FREE-NOS',
67+
title: {
68+
en: 'Ten-Item Personality Inventory (TIPI)',
69+
fr: 'Ten-Item Personality Inventory (TIPI)'
70+
}
71+
},
72+
content: [
73+
{
74+
description: {
75+
en: 'Here are a number of personality traits that may or may not apply to you. Please select a number next to each statement to indicate the extent to which you agree or disagree with that statement. You should rate the extent to which the pair of traits applies to you, even if one characteristic applies more strongly than the other.',
76+
fr: "Voici une liste de traits de caractère qui peuvent ou non vous correspondre. Veuillez indiquer dans quelle mesure vous pensez qu'ils vous correspondent. Veuillez évaluer la paire de caractéristique même si une caractéristique s'applique plus que l'autre."
77+
},
78+
fields: {
79+
extrovertedEnthusiastic: {
80+
kind: 'number',
81+
label: {
82+
en: '1. Extroverted, enthusiastic.',
83+
fr: '1. Extraverti(e), enthousiaste.'
84+
},
85+
options: scaleOptions,
86+
variant: 'select'
87+
},
88+
criticalQuarrelsome: {
89+
kind: 'number',
90+
label: {
91+
en: '2. Critical, quarrelsome.',
92+
fr: '2. Critique, agressif(ve).'
93+
},
94+
options: scaleOptions,
95+
variant: 'select'
96+
},
97+
dependableSelfDisciplined: {
98+
kind: 'number',
99+
label: {
100+
en: '3. Dependable, self-disciplined.',
101+
fr: '3. Digne de confiance, autodiscipliné(e).`'
102+
},
103+
options: scaleOptions,
104+
variant: 'select'
105+
},
106+
anxiousEasilyUpset: {
107+
kind: 'number',
108+
label: {
109+
en: '4. Anxious, easily upset.',
110+
fr: '4. Anxieux(euse), facilement troublé(e).'
111+
},
112+
options: scaleOptions,
113+
variant: 'select'
114+
},
115+
newExperiencesComplex: {
116+
kind: 'number',
117+
label: {
118+
en: '5. Open to new experiences, complex.',
119+
fr: "5. Ouvert(e) à de nouvelles expériences, d'une personnalité complexe."
120+
},
121+
options: scaleOptions,
122+
variant: 'select'
123+
},
124+
reservedQuiet: {
125+
kind: 'number',
126+
label: {
127+
en: '6. Reserved, quiet.',
128+
fr: '6. Réservé(e), tranquille.'
129+
},
130+
options: scaleOptions,
131+
variant: 'select'
132+
},
133+
sympatheticWarm: {
134+
kind: 'number',
135+
label: {
136+
en: '7. Sympathetic, warm.',
137+
fr: '7. Sympathique, chaleureux(euse).'
138+
},
139+
options: scaleOptions,
140+
variant: 'select'
141+
},
142+
disorganizedCareless: {
143+
kind: 'number',
144+
label: {
145+
en: '8. Disorganized, careless.',
146+
fr: '8. Désorganisé(e), négligent(e).'
147+
},
148+
options: scaleOptions,
149+
variant: 'select'
150+
},
151+
calmEmotionallyStable: {
152+
kind: 'number',
153+
label: {
154+
en: '9. Calm, emotionally stable.',
155+
fr: '9. Calme, émotionnellement stable.'
156+
},
157+
options: scaleOptions,
158+
variant: 'select'
159+
},
160+
conventionalUncreative: {
161+
kind: 'number',
162+
label: {
163+
en: '10. Conventional, uncreative.',
164+
fr: '10. Conventionnel(le), peu créatif(ve).'
165+
},
166+
options: scaleOptions,
167+
variant: 'select'
168+
}
169+
}
170+
}
171+
],
172+
measures: {
173+
extraversion: {
174+
kind: 'computed',
175+
label: {
176+
en: 'Extraversion (higher score = more extroverted, range 1-7)',
177+
fr: 'Extraversion (higher score = more extroverted, range 1-7)'
178+
},
179+
value: (data) => {
180+
// calculate the score = (reverse(q6) + q1) / 2
181+
const score1 = data.extrovertedEnthusiastic;
182+
const score6 = data.reservedQuiet;
183+
return computeScore(score6, score1);
184+
}
185+
},
186+
agreeableness: {
187+
kind: 'computed',
188+
label: {
189+
en: 'Agreeableness (higher score = more agreeable, range 1-7)',
190+
fr: 'Agreeableness (higher score = more agreeable, range 1-7)'
191+
},
192+
value: (data) => {
193+
// calculate the score = (reverse(q2) + q7) / 2
194+
const score2 = data.criticalQuarrelsome;
195+
const score7 = data.sympatheticWarm;
196+
return computeScore(score2, score7);
197+
}
198+
},
199+
conscientiousness: {
200+
kind: 'computed',
201+
label: {
202+
en: 'Conscientiousness (higher score = more conscientious, range 1-7)',
203+
fr: 'Conscientiousness (higher score = more conscientious, range 1-7)'
204+
},
205+
value: (data) => {
206+
// calculate the score = (reverse(q8) + q3) / 2
207+
const score3 = data.dependableSelfDisciplined;
208+
const score8 = data.disorganizedCareless;
209+
return computeScore(score8, score3);
210+
}
211+
},
212+
emotionalStability: {
213+
kind: 'computed',
214+
label: {
215+
en: 'Emotional Stability (higher score = more stable, range 1-7)',
216+
fr: 'Emotional Stability (higher score = more stable, range 1-7)'
217+
},
218+
value: (data) => {
219+
// calculate the score = (reverse(q4) + q9) / 2
220+
const score4 = data.anxiousEasilyUpset;
221+
const score9 = data.calmEmotionallyStable;
222+
return computeScore(score4, score9);
223+
}
224+
},
225+
openessToExperience: {
226+
kind: 'computed',
227+
label: {
228+
en: 'Openness to Experience (higher score = more open, range 1-7)',
229+
fr: 'Openness to Experience (higher score = more open, range 1-7)'
230+
},
231+
value: (data) => {
232+
// calculate the score = (reverse(q10) + q5) / 2
233+
const score5 = data.newExperiencesComplex;
234+
const score10 = data.conventionalUncreative;
235+
return computeScore(score10, score5);
236+
}
237+
}
238+
},
239+
validationSchema: z.object({
240+
//answers
241+
extrovertedEnthusiastic: $IntScale,
242+
criticalQuarrelsome: $IntScale,
243+
dependableSelfDisciplined: $IntScale,
244+
anxiousEasilyUpset: $IntScale,
245+
newExperiencesComplex: $IntScale,
246+
reservedQuiet: $IntScale,
247+
sympatheticWarm: $IntScale,
248+
disorganizedCareless: $IntScale,
249+
calmEmotionallyStable: $IntScale,
250+
conventionalUncreative: $IntScale,
251+
//measures
252+
extraversion: $ContinuousScale.optional(),
253+
agreeableness: $ContinuousScale.optional(),
254+
conscientiousness: $ContinuousScale.optional(),
255+
emotionalStability: $ContinuousScale.optional(),
256+
opennessToExperience: $ContinuousScale.optional()
257+
})
258+
});

0 commit comments

Comments
 (0)