| Name | Last commit date | |
|---|---|---|
| .. | ||
| src | 2 years ago | |
| test | 2 years ago | |
| .eslintrc.js | 2 years ago | |
| .gitignore | 2 years ago | |
| jest.config.js | 2 years ago | |
| package.json | 2 years ago | |
| README.md | 2 years ago | |
| tsconfig.json | 2 years ago | |
| yarn.lock | 2 years ago | |
bigfive-score
Calculate score for big five tests.
Installation
$ npm i @bigfive-org/score
Usage
Pass an object with property answers. Answers have to be an Array with domain and score. Facet is optional.
import { processAnswers } from '@bigfive-org/score'
const result = {
"timeElapsed": 51,
"lang": "en",
"test": "50-IPIP-NEO-PI-R",
"totalQuestions": 50,
"answers": [
{
"domain": "A",
"facet": "1",
"score": "3"
},
{
"domain": "A",
"facet": "1",
"score": "3"
},
{
"domain": "E",
"facet": "1",
"score": "3"
},
{
"domain": "E",
"facet": "2",
"score": "3"
}
]
}
processAnswers(result)
returns score for each factor
{
'A': {
'score': 6,
'count': 2,
'result': 'neutral',
'facet': {
'1': {
'score': 6,
'count': 2,
'result': 'neutral'
}
}
},
'E': {
'score': 6,
'count': 2,
'result': 'neutral',
'facet': {
'1': {
'score': 3,
'count': 1,
'result': 'neutral'
},
'2': {
'score': 3,
'count': 1,
'result': 'neutral'
}
}
}
}