@baravak/risloo-profile-cli 4.33.0 → 4.35.0

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.
@@ -89,13 +89,13 @@ class CAATS93 extends Profile {
89
89
  ravenItem: {
90
90
  stops: [0, 65, 77, 89, 113, 125, 149],
91
91
  interprets: [
92
- { level: 0, title: "عقب‌مانده" },
93
- { level: 1, title: "عقب‌مانده\nمرزی" },
94
- { level: 2, title: "کودن" },
95
- { level: 3, title: "متوسط" },
96
- { level: 4, title: "ممتاز" },
97
- { level: 5, title: "بسیار ممتاز" },
98
- { level: 6, title: "حدود نابغه" },
92
+ { level: 0, title: "بسیارپایین" },
93
+ { level: 1, title: "مرزی" },
94
+ { level: 2, title: "متوسط پایین" },
95
+ { level: 3, title: "متوسط (بهنجار)" },
96
+ { level: 4, title: "متوسط بالا" },
97
+ { level: 5, title: "سرآمد" },
98
+ { level: 6, title: "خیلی سرآمد" },
99
99
  ],
100
100
  widthCoeff: 2.5,
101
101
  },
@@ -0,0 +1,96 @@
1
+ const { Profile } = require("../Profile");
2
+ const answers = [4,5,1,2,6,3,6,2,1,3,4,5,2,6,1,2,1,3,5,6,4,3,4,5,8,2,3,8,7,4,5,1,7,6,1,2,3,4,3,7,8,6,5,4,1,2,5,6,7,6,8,2,1,5,1,6,3,2,4,5]
3
+ const setGroup = ['A', 'B', 'C', 'D', 'E']
4
+ const levels = {
5
+ 'Very superior' : {title: 'خیلی سرآمد', min: 149, color: ['#059669', '#10B981']},
6
+ 'Superior' : {title: 'سرآمد', min: 125, max: 148, color: ['#059669', '#10B981']},
7
+ 'High average' : {title: 'متوسط بالا', min: 113, max: 124, color: ['#059669', '#10B981']},
8
+ 'Average' : {title: 'متوسط (بهنجار)', min: 89, max: 112, color: ['#475569', '#64748B']},
9
+ 'Low average' : {title: 'متوسط پایین', min: 77, max: 88, color: ['#E11D48', '#F43F5E']},
10
+ 'Borderline' : {title: 'مرزی', min: 65, max: 76, color: ['#E11D48', '#F43F5E']},
11
+ 'Extremely low' : {title: 'بسیار پایین', min: 0, max: 64, color: ['#E11D48', '#F43F5E']},
12
+ }
13
+
14
+ class Raven93 extends Profile {
15
+ // Number of pages
16
+ static pages = 1;
17
+
18
+ // Labels of the sample
19
+ labels = {
20
+ L1: { eng: "raw"},
21
+ L2: { eng: "iq"},
22
+ L3: { eng: "percentile"},
23
+ L9: { eng: "report"},
24
+ };
25
+
26
+ profileSpec = {
27
+ /* "sample" determines some important info about the sample and profile */
28
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
29
+ /* "prerequisites" is synonym to "fields" in our program */
30
+ sample: {
31
+ name: "آزمون ریون استاندارد" /* Name of the sample */,
32
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
33
+ questions: true /* Determines whether to get questions from inital dataset or not */,
34
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
35
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
36
+ },
37
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
38
+ /* calculating its dimensions carefully is of great importance */
39
+ profile: {
40
+ get dimensions() {
41
+ return {
42
+ width: 815 + 2 * this.padding.x,
43
+ height: 618 + 2 * this.padding.y,
44
+ };
45
+ },
46
+ padding: {
47
+ x: 44,
48
+ y: 48,
49
+ },
50
+ },
51
+ /* "labels" part which has to be provided for each profile */
52
+ labels: Object.values(this.labels),
53
+ };
54
+
55
+ constructor(dataset, options, config = {}) {
56
+ super();
57
+ this._init(dataset, options, config);
58
+ }
59
+
60
+ _calcContext() {
61
+ const {
62
+ dataset,
63
+ } = this;
64
+ const report = dataset.score[3]
65
+ const iq = dataset.score[1].mark ?? 0
66
+ const raw = dataset.score[2].mark ?? 0
67
+ const percentile = dataset.score[3].mark ?? 0
68
+ levels[report.mark].selected = true
69
+ const selected = levels[report.mark]
70
+ const questions = []
71
+ dataset.questions.forEach((item, index) => {
72
+ const i = index + 1
73
+ const set = Math.floor(index / 12)
74
+ if(questions[set] === undefined){
75
+ questions[set] = {
76
+ key: setGroup[set],
77
+ items: [],
78
+ length: 0
79
+
80
+ }
81
+ }
82
+ const isTrue = answers[index] === parseInt(item.user_answered)
83
+ questions[set].length += isTrue ? 1 : 0
84
+ questions[set].items.push({
85
+ index: i, isTrue
86
+ })
87
+ });
88
+ const indic = iq === 100 ? levels['Average'] : (
89
+ iq > 100 ? levels['High average'] : levels['Low average']
90
+ )
91
+
92
+ return [{ levels, selected, questions, iq, raw, percentile, indic }];
93
+ }
94
+ }
95
+
96
+ module.exports = Raven93;
@@ -0,0 +1,184 @@
1
+ {{#> layout}}
2
+ <defs>
3
+ <clipPath id="clip-shape">
4
+ <path
5
+ d="M267.371 78.5C284.9 44.5 316.452 0 342.496 0C368.539 0 400.092 44.5 417.621 78.5C435.15 112.5 465.842 144.16 492.746 157.5C519.65 170.84 555.351 174 567.871 174H645V187.5H690V282H345L0 281.5V187.5H45V174H117.12C129.641 174 165.341 170.84 192.245 157.5C219.15 144.16 249.841 112.5 267.371 78.5Z" />
6
+ </clipPath>
7
+ <linearGradient id="levelgrd" x1="108" y1="0" x2="-7.4" y2="45.2" gradientUnits="userSpaceOnUse">
8
+ <stop stop-color="{{selected.color.[1]}}" />
9
+ <stop offset="1" stop-color="{{selected.color.[0]}}" />
10
+ </linearGradient>
11
+ <linearGradient id="trueItem" x1="26" y1="0" x2="0" y2="26" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#F8FAFC"/>
13
+ <stop offset="1" stop-color="#F1F5F9"/>
14
+ </linearGradient>
15
+ <linearGradient id="falseItem" x1="26" y1="0" x2="0" y2="26" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#FFF1F2" stop-opacity="0.5"/>
17
+ <stop offset="1" stop-color="#FFE4E6"/>
18
+ </linearGradient>
19
+ </defs>
20
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
21
+ <rect x="150.25" y="0.25" width="0.5" height="595.5" rx="0.25" fill="none" stroke="#E2E8F0" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="10 10"/>
22
+ <g transform="translate(3,0)">
23
+ <g transform="translate(201,33)">
24
+ <svg width="600" height="189" viewBox="0 0 600 189" fill="none" xmlns="http://www.w3.org/2000/svg">
25
+ <path
26
+ d="M222.371 79.5C239.9 45.5 271.452 1 297.496 1C323.539 1 355.092 45.5 372.621 79.5C390.15 113.5 420.842 145.16 447.746 158.5C474.65 171.84 510.351 175 522.871 175H600V188.5H300.5H0V175H36.5601H72.1202C84.6411 175 120.341 171.84 147.245 158.5C174.15 145.16 204.841 113.5 222.371 79.5Z"
27
+ fill="url(#paint0_linear_20_118)" />
28
+ <g clip-path="url(#clip0_20_118)">
29
+ <rect width="1" height="14" transform="translate(73 188) rotate(-180)" fill="#CBD5E1" />
30
+ </g>
31
+ <g clip-path="url(#clip1_20_118)">
32
+ <rect width="1" height="30" transform="translate(148 188) rotate(-180)" fill="#CBD5E1" />
33
+ </g>
34
+ <g clip-path="url(#clip2_20_118)">
35
+ <rect width="1" height="108" transform="translate(223 188) rotate(-180)" fill="#CBD5E1" />
36
+ </g>
37
+ <g clip-path="url(#clip3_20_118)">
38
+ <rect width="1" height="188" transform="translate(298 188) rotate(-180)" fill="#CBD5E1" />
39
+ </g>
40
+ <g clip-path="url(#clip4_20_118)">
41
+ <rect width="1" height="108" transform="translate(373 188) rotate(-180)" fill="#CBD5E1" />
42
+ </g>
43
+ <g clip-path="url(#clip5_20_118)">
44
+ <rect width="1" height="30" transform="translate(448 188) rotate(-180)" fill="#CBD5E1" />
45
+ </g>
46
+ <g clip-path="url(#clip6_20_118)">
47
+ <rect width="1" height="14" transform="translate(523 188) rotate(-180)" fill="#CBD5E1" />
48
+ </g>
49
+ <rect y="188" width="600" height="1" rx="0.5" fill="#64748B" />
50
+ <path
51
+ d="M1 175H72.1202C84.6411 175 120.341 171.84 147.245 158.5C174.15 145.16 204.841 113.5 222.371 79.5C239.9 45.5 271.452 1 297.496 1C323.539 1 355.092 45.5 372.621 79.5C390.15 113.5 420.842 145.16 447.746 158.5C474.65 171.84 510.351 175 522.871 175H599"
52
+ stroke="#64748B" stroke-width="2" stroke-linecap="round" />
53
+ <defs>
54
+ <linearGradient id="paint0_linear_20_118" x1="0" y1="90.75" x2="600" y2="90.75"
55
+ gradientUnits="userSpaceOnUse">
56
+ <stop stop-color="#FFE4E6" />
57
+ <stop offset="0.45" stop-color="#FFF1F2" stop-opacity="0.5" />
58
+ <stop offset="0.5" stop-color="#F8FAFC" />
59
+ <stop offset="0.55" stop-color="#ECFDF5" stop-opacity="0.5" />
60
+ <stop offset="1" stop-color="#D1FAE5" />
61
+ </linearGradient>
62
+ <clipPath id="clip0_20_118">
63
+ <rect width="5" height="14" fill="white" transform="translate(75 188) rotate(-180)" />
64
+ </clipPath>
65
+ <clipPath id="clip1_20_118">
66
+ <rect width="5" height="30" fill="white" transform="translate(150 188) rotate(-180)" />
67
+ </clipPath>
68
+ <clipPath id="clip2_20_118">
69
+ <rect width="5.00001" height="108" fill="white" transform="translate(225 188) rotate(-180)" />
70
+ </clipPath>
71
+ <clipPath id="clip3_20_118">
72
+ <rect width="5.00002" height="188" fill="white" transform="translate(300 188) rotate(-180)" />
73
+ </clipPath>
74
+ <clipPath id="clip4_20_118">
75
+ <rect width="5.00001" height="108" fill="white" transform="translate(375 188) rotate(-180)" />
76
+ </clipPath>
77
+ <clipPath id="clip5_20_118">
78
+ <rect width="5" height="30" fill="white" transform="translate(450 188) rotate(-180)" />
79
+ </clipPath>
80
+ <clipPath id="clip6_20_118">
81
+ <rect width="5" height="14" fill="white" transform="translate(525 188) rotate(-180)" />
82
+ </clipPath>
83
+ </defs>
84
+ </svg>
85
+ </g>
86
+ <text x="201" y="188" dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
87
+ direction="ltr">-4σ</text>
88
+ <g transform="translate(273.5, 174)">
89
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
90
+ direction="ltr">-3σ</text>
91
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
92
+ direction="ltr">55</text>
93
+ </g>
94
+ <g transform="translate(348.5, 158)">
95
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
96
+ direction="ltr">-2σ</text>
97
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
98
+ direction="ltr">70</text>
99
+ </g>
100
+ <g transform="translate(416, 80)">
101
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
102
+ direction="ltr">-1σ</text>
103
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
104
+ direction="ltr">85</text>
105
+ </g>
106
+ <g transform="translate(498.5, 0)">
107
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
108
+ direction="ltr">0</text>
109
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
110
+ direction="ltr">100</text>
111
+ </g>
112
+ <g transform="translate(582.5, 80)">
113
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
114
+ direction="ltr">+1σ</text>
115
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
116
+ direction="ltr">115</text>
117
+ </g>
118
+ <g transform="translate(648.5, 158)">
119
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
120
+ direction="ltr">+2σ</text>
121
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
122
+ direction="ltr">130</text>
123
+ </g>
124
+ <g transform="translate(723.5, 174)">
125
+ <text dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
126
+ direction="ltr">+3σ</text>
127
+ <text dy="1.9em" text-anchor="middle" font-size="12" font-weight="400" fill="#64748B"
128
+ direction="ltr">145</text>
129
+ </g>
130
+ <text x="800.5" y="188" dy=".75em" text-anchor="middle" font-size="12" font-weight="400" fill="#94A3B8"
131
+ direction="ltr">+4σ</text>
132
+ <g transform="translate(156, 35)" clip-path="url(#clip-shape)">
133
+ <g transform="translate({{math -185 '+' (math iq '*' 5)}}, 0)">
134
+ <path d="M25.5 205H28.5V0H25.5V205Z" fill="{{indic.color.[0]}}"/>
135
+ <path d="M0 219C0 213.477 4.47715 209 10 209H44C49.5228 209 54 213.477 54 219V234C54 239.523 49.5228 244 44 244H10C4.47715 244 0 239.523 0 234V219Z" fill="{{indic.color.[0]}}"/>
136
+ <path d="M27 203.343L32.6569 209H21.3431L27 203.343Z" fill="{{indic.color.[0]}}"/>
137
+ <text x="27" y="233" text-anchor="middle" font-size="20" font-weight="700" fill="#FFFFFF">{{iq}}</text>
138
+ <text x="-7" y="227" text-anchor="start" font-size="14" font-weight="500" fill="#334155">{{raw}}</text>
139
+ <text x="-7" y="237" text-anchor="start" font-size="12" font-weight="400" fill="#64748B">نمره خام</text>
140
+ <text x="62" y="227" text-anchor="end" font-size="14" font-weight="500" fill="#334155">{{raw}}</text>
141
+ <text x="62" y="237" text-anchor="end" font-size="12" font-weight="400" fill="#64748B">رتبه درصدی</text>
142
+ <text x="27" y="245" text-anchor="middle" dy="1em" font-size="14" font-weight="400" fill="#334155">هوشبهر</text>
143
+ <text x="27" y="245" text-anchor="middle" dy="2.75em" font-size="12" font-weight="400" fill="#64748B">(IQ)</text>
144
+ </g>
145
+ </g>
146
+
147
+ <g transform="translate(0, 32)">
148
+ {{#each levels as | level key | }}
149
+ <g transform="translate(0, {{math @index '*' 78}})">
150
+ <rect width="108" height="64" rx="8" stroke="#F1F5F9" stroke-width="{{ternary level.selected '0' '1'}}" fill="{{ternary level.selected 'url(#levelgrd)' '#F8FAFC'}}" />
151
+ <text x="54" y="24.5" dy=".2em" text-anchor="middle" font-size="13" font-weight="400"
152
+ fill="{{ternary level.selected '#FFFFFF' '#475569'}}">{{title}}</text>
153
+ <text x="54" y="42.5" dy=".4em" text-anchor="middle" font-size="12" font-weight="400"
154
+ fill="{{ternary level.selected '#FFFFFF' '#64748B'}}">
155
+ {{#if (boolean max '>=' 0)}}
156
+ {{min}}&#160;{{ternary max ' تا ' ''}}&#160;{{max}}
157
+ {{else}}
158
+ {{min}}
159
+ {{/if}}
160
+ </text>
161
+ </g>
162
+ {{/each}}
163
+ </g>
164
+ <g transform="translate(256, 338)">
165
+ {{#each questions as | question qi|}}
166
+ <g transform="translate(0, {{math qi '*' 54}})">
167
+ <rect width="432" height="42" rx="8" stroke="#E2E8F0" fill="none" />
168
+ <g transform="translate(16, 8)">
169
+ {{#each question.items as | item ii|}}
170
+ <g transform="translate({{math 374 '-' (math ii '*' 34)}}, 0)">
171
+ <rect width="26" height="26" rx="6" fill="url(#{{ternary item.isTrue 'trueItem' 'falseItem'}})" opacity="0.5" />
172
+ <text x="13" y="13" dy=".3em" text-anchor="middle" font-size="13" font-weight="400" fill="{{ternary item.isTrue '#475569' '#F43F5E'}}">{{item.index}}</text>
173
+ </g>
174
+ {{/each}}
175
+ </g>
176
+ <text x="451" y="21" dy=".3em" text-anchor="middle" font-size="16" font-weight="600" fill="#94A3B8">{{key}}</text>
177
+ <text x="466.5" y="21" dy=".3em" text-anchor="middle" font-size="16" font-weight="300" fill="#94A3B8">-</text>
178
+ <text x="475" y="21" dy=".3em" text-anchor="end" font-size="18" font-weight="600" fill="question">{{question.length}}</text>
179
+ </g>
180
+ {{/each}}
181
+ </g>
182
+ </g>
183
+ </g>
184
+ {{/layout}}