@baravak/risloo-profile-cli 4.3.4 → 4.3.5
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/package.json +1 -1
- package/src/samples/JPFQ93.js +40 -41
package/package.json
CHANGED
package/src/samples/JPFQ93.js
CHANGED
|
@@ -76,47 +76,46 @@ class JPFQ93 extends Profile {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
function clinicalScoring(items){
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
answer = parseInt(items[index -1].user_answered)
|
|
79
|
+
f1 = 'identity'
|
|
80
|
+
f2 = 'self_direction'
|
|
81
|
+
f3 = 'empathy'
|
|
82
|
+
f4 = 'intimacy'
|
|
83
|
+
f5 = 'psychoticism'
|
|
84
|
+
f6 = 'detachment'
|
|
85
|
+
f7 = 'disinhibition'
|
|
86
|
+
f8 = 'negative_affectivity'
|
|
87
|
+
f9 = 'antagonism'
|
|
88
|
+
factors = {
|
|
89
|
+
[`${f1}`] : [1,5,9,12,14,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,48,50,53],
|
|
90
|
+
[`${f2}`] : [2,6,10,15,20,26,32,38,44,49],
|
|
91
|
+
[`${f3}`] : [4,8,13,18,24,30,36,42,47,52,55],
|
|
92
|
+
[`${f4}`] : [3,7,11,16,22,28,34,40,46,51,54],
|
|
93
|
+
[`${f5}`] : [56,62,68,73,78,83,88,96,102,108,111],
|
|
94
|
+
[`${f6}`] : [60,67,72,77,82,87,94,100,106],
|
|
95
|
+
[`${f7}`] : [57,61,63,66,69,74,79,84,89,91,93,95,97,103,107,110,114,118,120,122,124,126],
|
|
96
|
+
[`${f8}`] : [59,65,71,76,81,86,92,99,105,112,116,119,121,123,125],
|
|
97
|
+
[`${f9}`] : [58,64,70,75,80,85,90,98,101,104,109,113,115,117]
|
|
98
|
+
}
|
|
99
|
+
reverse_scoring_numbers = [1,5,6,10,11,12,14,26,32,34,47,50,115]
|
|
100
|
+
result = {}
|
|
101
|
+
for(const f in factors){
|
|
102
|
+
const fItems = factors[f]
|
|
103
|
+
if(result[f] === undefined){
|
|
104
|
+
result[f] = {total: 0, percentage: 0, width: fItems.length * 2}
|
|
105
|
+
}
|
|
106
|
+
fItems.forEach(index => {
|
|
107
|
+
answer = parseInt(items[index -1].user_answered)
|
|
109
108
|
let incScore = 0
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
if(reverse_scoring_numbers.indexOf(index) === -1){
|
|
110
|
+
incScore = Math.floor((answer - 1)/1.5)
|
|
111
|
+
}else{
|
|
112
|
+
incScore = Math.floor((4 - answer)/1.5)
|
|
113
|
+
}
|
|
114
|
+
result[f].total = result[f].total + incScore
|
|
115
|
+
})
|
|
116
|
+
totalScore = fItems.length * 2
|
|
117
|
+
result[f].percentage = Math.round((result[f].total * 100) / totalScore)
|
|
118
|
+
}
|
|
119
|
+
return result
|
|
121
120
|
}
|
|
122
121
|
module.exports = JPFQ93;
|