@baravak/risloo-profile-cli 4.44.1 → 4.45.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.
@@ -0,0 +1,430 @@
1
+ const gauge = require("../helpers/gauge");
2
+ const { Profile } = require("../Profile");
3
+
4
+ const labels = {
5
+ extremely_high: "فوق بالا",
6
+ very_high: "خیلی بالا",
7
+ high: "بالا",
8
+ average: "متوسط",
9
+ low: "پایین",
10
+ very_low: "خیلی پایین",
11
+ extremely_low: "فوق پایین",
12
+ };
13
+
14
+ const colors = {
15
+ bars: [
16
+ ['#C7D2FE', '#4338CA', '#4F46E5', '#818CF8'], ['#DDD6FE', '#6D28D9', '#7C3AED', '#A78BFA'],
17
+ ]
18
+ }
19
+
20
+ class FRHPT93 extends Profile {
21
+ // Number of pages
22
+ static pages = 4;
23
+
24
+ // Labels of the sample
25
+ labels = {
26
+ L1_1: { eng: "factors_ex_raw", group: true, fa: "برون‌گرایی" },
27
+ L1_2: { eng: "factors_ex_percentage" },
28
+ L1_3: { eng: "factors_ex_level" },
29
+
30
+ L2_1: { eng: "factors_ex1_raw", fa: "علاقه به ارتباط با دیگران"},
31
+ L2_2: { eng: "factors_ex1_percentage" },
32
+ L2_3: { eng: "factors_ex1_level" },
33
+
34
+ L3_1: { eng: "factors_ex2_raw", fa: "توانایی ارتباط با دیگران"},
35
+ L3_2: { eng: "factors_ex2_percentage" },
36
+ L3_3: { eng: "factors_ex2_level" },
37
+
38
+ L4_1: { eng: "factors_ex3_raw", fa: "نشاط و سرزندگی اجتماعی"},
39
+ L4_2: { eng: "factors_ex3_percentage" },
40
+ L4_3: { eng: "factors_ex3_level" },
41
+
42
+ L5_1: { eng: "factors_ex4_raw", fa: "جسارت و قاطعیت"},
43
+ L5_2: { eng: "factors_ex4_percentage" },
44
+ L5_3: { eng: "factors_ex4_level" },
45
+
46
+ L6_1: { eng: "factors_an_raw", group: true, fa: "رگه اضطراب" },
47
+ L6_2: { eng: "factors_an_percentage" },
48
+ L6_3: { eng: "factors_an_level" },
49
+
50
+ L7_1: { eng: "factors_an1_raw", fa: "ترس و نگرانی"},
51
+ L7_2: { eng: "factors_an1_percentage" },
52
+ L7_3: { eng: "factors_an1_level" },
53
+
54
+ L8_1: { eng: "factors_an2_raw", fa: "اضطراب در روابط اجتماعی"},
55
+ L8_2: { eng: "factors_an2_percentage" },
56
+ L8_3: { eng: "factors_an2_level" },
57
+
58
+ L9_1: { eng: "factors_an3_raw", fa: "شک و تردید"},
59
+ L9_2: { eng: "factors_an3_percentage" },
60
+ L9_3: { eng: "factors_an3_level" },
61
+
62
+ L10_1: { eng: "factors_an4_raw", fa: "تکانشگری و شتابزدگی"},
63
+ L10_2: { eng: "factors_an4_percentage" },
64
+ L10_3: { eng: "factors_an4_level" },
65
+
66
+ L11_1: { eng: "factors_dp_raw", group: true, fa: "رگه افسردگی" },
67
+ L11_2: { eng: "factors_dp_percentage" },
68
+ L11_3: { eng: "factors_dp_level" },
69
+
70
+ L12_1: { eng: "factors_dp1_raw", fa: "حزن و اندوه درونی"},
71
+ L12_2: { eng: "factors_dp1_percentage" },
72
+ L12_3: { eng: "factors_dp1_level" },
73
+
74
+ L13_1: { eng: "factors_dp2_raw", fa: "افکار گذشته"},
75
+ L13_2: { eng: "factors_dp2_percentage" },
76
+ L13_3: { eng: "factors_dp2_level" },
77
+
78
+ L14_1: { eng: "factors_dp3_raw", fa: "بی‌انگیزگی"},
79
+ L14_2: { eng: "factors_dp3_percentage" },
80
+ L14_3: { eng: "factors_dp3_level" },
81
+
82
+ L15_1: { eng: "factors_dp4_raw", fa: "احساس بی‌ارزشی"},
83
+ L15_2: { eng: "factors_dp4_percentage" },
84
+ L15_3: { eng: "factors_dp4_level" },
85
+
86
+ L16_1: { eng: "factors_ag_raw", group: true, fa: "خشم و پرخاشگری" },
87
+ L16_2: { eng: "factors_ag_percentage" },
88
+ L16_3: { eng: "factors_ag_level" },
89
+
90
+ L17_1: { eng: "factors_ag1_raw", fa: "حساس و زودرنج" },
91
+ L17_2: { eng: "factors_ag1_percentage" },
92
+ L17_3: { eng: "factors_ag1_level" },
93
+
94
+ L18_1: { eng: "factors_ag2_raw", fa: "کینه و خصومت" },
95
+ L18_2: { eng: "factors_ag2_percentage" },
96
+ L18_3: { eng: "factors_ag2_level" },
97
+
98
+ L19_1: { eng: "factors_ag3_raw", fa: "پرخاشگری (کلامی و فیزیکی)" },
99
+ L19_2: { eng: "factors_ag3_percentage" },
100
+ L19_3: { eng: "factors_ag3_level" },
101
+
102
+ L20_1: { eng: "factors_ag4_raw", fa: "آشفتگی خانواده مبدأ" },
103
+ L20_2: { eng: "factors_ag4_percentage" },
104
+ L20_3: { eng: "factors_ag4_level" },
105
+
106
+ L21_1: { eng: "factors_op_raw", group: true, fa: "گشودگی به تجربه" },
107
+ L21_2: { eng: "factors_op_percentage" },
108
+ L21_3: { eng: "factors_op_level" },
109
+
110
+ L22_1: { eng: "factors_op1_raw", fa: "ریسک‌پذیری" },
111
+ L22_2: { eng: "factors_op1_percentage" },
112
+ L22_3: { eng: "factors_op1_level" },
113
+
114
+ L23_1: { eng: "factors_op2_raw", fa: "هیجان‌خواهی" },
115
+ L23_2: { eng: "factors_op2_percentage" },
116
+ L23_3: { eng: "factors_op2_level" },
117
+
118
+ L24_1: { eng: "factors_op3_raw", fa: "تخیل" },
119
+ L24_2: { eng: "factors_op3_percentage" },
120
+ L24_3: { eng: "factors_op3_level" },
121
+
122
+ L25_1: { eng: "factors_op4_raw", fa: "خلاقیت" },
123
+ L25_2: { eng: "factors_op4_percentage" },
124
+ L25_3: { eng: "factors_op4_level" },
125
+
126
+ L26_1: { eng: "factors_af_raw", group: true, fa: "عاطفه" },
127
+ L26_2: { eng: "factors_af_percentage" },
128
+ L26_3: { eng: "factors_af_level" },
129
+
130
+ L27_1: { eng: "factors_af1_raw", fa: "تجربه شدید احساسات" },
131
+ L27_2: { eng: "factors_af1_percentage" },
132
+ L27_3: { eng: "factors_af1_level" },
133
+
134
+ L28_1: { eng: "factors_af2_raw", fa: "عاطفه درون‌سو" },
135
+ L28_2: { eng: "factors_af2_percentage" },
136
+ L28_3: { eng: "factors_af2_level" },
137
+
138
+ L29_1: { eng: "factors_af3_raw", fa: "عاطفه برون‌سو" },
139
+ L29_2: { eng: "factors_af3_percentage" },
140
+ L29_3: { eng: "factors_af3_level" },
141
+
142
+ L30_1: { eng: "factors_af4_raw", fa: "زیبا دوستی" },
143
+ L30_2: { eng: "factors_af4_percentage" },
144
+ L30_3: { eng: "factors_af4_level" },
145
+
146
+ L31_1: { eng: "factors_co_raw", group: true, fa: "وظیفه‌شناسی" },
147
+ L31_2: { eng: "factors_co_percentage" },
148
+ L31_3: { eng: "factors_co_level" },
149
+
150
+ L32_1: { eng: "factors_co1_raw", fa: "وظیفه‌شناسی در اهداف" },
151
+ L32_2: { eng: "factors_co1_percentage" },
152
+ L32_3: { eng: "factors_co1_level" },
153
+
154
+ L33_1: { eng: "factors_co2_raw", fa: "مسئولیت‌پذیری و قانون‌مداری" },
155
+ L33_2: { eng: "factors_co2_percentage" },
156
+ L33_3: { eng: "factors_co2_level" },
157
+
158
+ L34_1: { eng: "factors_co3_raw", fa: "توجه به نظم و جزئیات" },
159
+ L34_2: { eng: "factors_co3_percentage" },
160
+ L34_3: { eng: "factors_co3_level" },
161
+
162
+ L35_1: { eng: "factors_co4_raw", fa: "تلاش و پشتکار اجرایی" },
163
+ L35_2: { eng: "factors_co4_percentage" },
164
+ L35_3: { eng: "factors_co4_level" },
165
+
166
+ L36_1: { eng: "factors_fl_raw", group: true, fa: "انعطاف‌پذیری" },
167
+ L36_2: { eng: "factors_fl_percentage" },
168
+ L36_3: { eng: "factors_fl_level" },
169
+
170
+ L37_1: { eng: "factors_fl1_raw", fa: "کنار آمدن با سختی‌ها" },
171
+ L37_2: { eng: "factors_fl1_percentage" },
172
+ L37_3: { eng: "factors_fl1_level" },
173
+
174
+ L38_1: { eng: "factors_fl2_raw", fa: "سازگاری با اطرافیان" },
175
+ L38_2: { eng: "factors_fl2_percentage" },
176
+ L38_3: { eng: "factors_fl2_level" },
177
+
178
+ L39_1: { eng: "factors_fl3_raw", fa: "انعطاف در روش‌ها" },
179
+ L39_2: { eng: "factors_fl3_percentage" },
180
+ L39_3: { eng: "factors_fl3_level" },
181
+
182
+ L40_1: { eng: "factors_fl4_raw", fa: "انعطاف در دیدگاه" },
183
+ L40_2: { eng: "factors_fl4_percentage" },
184
+ L40_3: { eng: "factors_fl4_level" },
185
+
186
+ L41_1: { eng: "factors_sp_raw", group: true, fa: "معنویت و دینداری" },
187
+ L41_2: { eng: "factors_sp_percentage" },
188
+ L41_3: { eng: "factors_sp_level" },
189
+
190
+ L42_1: { eng: "factors_sp1_raw", fa: "دلبستگی به خدا" },
191
+ L42_2: { eng: "factors_sp1_percentage" },
192
+ L42_3: { eng: "factors_sp1_level" },
193
+
194
+ L43_1: { eng: "factors_sp2_raw", fa: "نگرش‌های مثبت معنوی" },
195
+ L43_2: { eng: "factors_sp2_percentage" },
196
+ L43_3: { eng: "factors_sp2_level" },
197
+
198
+ L44_1: { eng: "factors_sp3_raw", fa: "عملکرد مذهبی" },
199
+ L44_2: { eng: "factors_sp3_percentage" },
200
+ L44_3: { eng: "factors_sp3_level" },
201
+
202
+ L45_1: { eng: "factors_un_raw", group: true, fa: "توانایی شناختی" },
203
+ L45_2: { eng: "factors_un_percentage" },
204
+ L45_3: { eng: "factors_un_level" },
205
+
206
+ L46_1: { eng: "factors_un1_raw", fa: "هوش" },
207
+ L46_2: { eng: "factors_un1_percentage" },
208
+ L46_3: { eng: "factors_un1_level" },
209
+
210
+ L47_1: { eng: "factors_un2_raw", fa: "قدرت تجزیه و تحلیل" },
211
+ L47_2: { eng: "factors_un2_percentage" },
212
+ L47_3: { eng: "factors_un2_level" },
213
+
214
+ L48_1: { eng: "factors_un3_raw", fa: "تلاش و پشتکار علمی" },
215
+ L48_2: { eng: "factors_un3_percentage" },
216
+ L48_3: { eng: "factors_un3_level" },
217
+
218
+ L49_1: { eng: "factors_un4_raw", fa: "افکار عجیب و غریب" },
219
+ L49_2: { eng: "factors_un4_percentage" },
220
+ L49_3: { eng: "factors_un4_level" },
221
+
222
+ L50x_1: { eng: "factors_mo_raw", group: true, fa: "ابعاد انگیزه" },
223
+ L50x_2: { eng: "factors_mo_percentage" },
224
+ L50x_3: { eng: "factors_mo_level" },
225
+
226
+ L50_1: { eng: "factors_mo1_raw", fa: "انگیزه خودشکوفایی" },
227
+ L50_2: { eng: "factors_mo1_percentage" },
228
+ L50_3: { eng: "factors_mo1_level" },
229
+
230
+ L51_1: { eng: "factors_mo2_raw", fa: "نیاز به محبت و احترام" },
231
+ L51_2: { eng: "factors_mo2_percentage" },
232
+ L51_3: { eng: "factors_mo2_level" },
233
+
234
+ L52_1: { eng: "factors_mo3_raw", fa: "نیاز به رفاه و رشد اقتصادی" },
235
+ L52_2: { eng: "factors_mo3_percentage" },
236
+ L52_3: { eng: "factors_mo3_level" },
237
+
238
+ L53_1: { eng: "factors_mo4_raw", fa: "نیاز به قدرت و برتری" },
239
+ L53_2: { eng: "factors_mo4_percentage" },
240
+ L53_3: { eng: "factors_mo4_level" },
241
+
242
+ L54_1: { eng: "indicators_vrin_value", fa: "دقت در پاسخ‌دهی"},
243
+ L54_2: { eng: "indicators_vrin_level" },
244
+
245
+ L55_1: { eng: "indicators_lie_scale_value", fa: "مطلوب‌نمایی گویه‌ای"},
246
+ L55_2: { eng: "indicators_lie_scale_level" },
247
+
248
+ L56_1: { eng: "indicators_defensiveness_scale_value", fa: "مطلوب‌نمایی مولفه‌ای"},
249
+ L56_2: { eng: "indicators_defensiveness_scale_level" },
250
+
251
+ L57_1: { eng: "indicators_midpoint_responses_value", fa: "احتیاط در پاسخ"},
252
+ L57_2: { eng: "indicators_midpoint_responses_level" },
253
+
254
+ L58_1: { eng: "indicators_validity_identical_value", fa: "بیش از ۱۶۵ پاسخ یکسان", length: 128},
255
+ L58_2: { eng: "indicators_validity_identical_error" },
256
+
257
+ L59_1: { eng: "indicators_validity_consecutive_value", fa: "بیش از ۳۹ پاسخ متوالی یکسان", length: 162},
258
+ L59_2: { eng: "indicators_validity_consecutive_error" },
259
+
260
+ L60_1: { eng: "indicators_validity_median_value", fa: "بیش از ۳۰ پاسخ میانه", length: 116},
261
+ L60_2: { eng: "indicators_validity_median_error" },
262
+ };
263
+
264
+ profileSpec = {
265
+ /* "sample" determines some important info about the sample and profile */
266
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
267
+ /* "prerequisites" is synonym to "fields" in our program */
268
+ sample: {
269
+ name: "پرسشنامه شخصیت ۲۰۲۵ - فرم بلند" /* Name of the sample */,
270
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
271
+ questions: false /* Determines whether to get questions from inital dataset or not */,
272
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
273
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
274
+ },
275
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
276
+ /* calculating its dimensions carefully is of great importance */
277
+ profile: {
278
+ get dimensions() {
279
+ return {
280
+ width: 800 + 2 * this.padding.x,
281
+ height: 657 + 2 * this.padding.y,
282
+ };
283
+ },
284
+ padding: {
285
+ x: 52,
286
+ y: 29,
287
+ },
288
+ },
289
+ labels: Object.values(this.labels),
290
+ };
291
+
292
+ constructor(dataset, options, config = {}) {
293
+ super();
294
+ this._init(dataset, options, config);
295
+ }
296
+
297
+ _calcContext() {
298
+ const {
299
+ dataset,
300
+ } = this;
301
+ const groups = new FG(dataset.score.slice(0, 162)).generate()
302
+ const ind = dataset.score.slice(162, 170)
303
+ const indicators = []
304
+ for(let i = 0; i < ind.length; i += 2){
305
+ const indicator = ind[i]
306
+ const level = ind[i + 1]
307
+ indicators.push({
308
+ ...indicator,
309
+ mark : indicator.mark ?? 0,
310
+ level: level.mark,
311
+ levelText: labels[level.mark]
312
+ })
313
+ }
314
+ indicators.reverse()
315
+ const validityList = dataset.score.slice(170, 179)
316
+ let validities = []
317
+ for(let i = 0; i < validityList.length; i += 2){
318
+ const validity = validityList[i]
319
+ const error = validityList[i + 1]
320
+ if(error.mark === undefined || error.mark === null) continue
321
+ validities.push({
322
+ error: validity.label.fa,
323
+ length: validity.label.length
324
+ })
325
+ }
326
+ let start = 0
327
+ validities = validities.map((v,i) => {
328
+ const result ={
329
+ ...v,
330
+ start,
331
+ last: validities.length - 1 === i
332
+ }
333
+ start += v.length + 54
334
+ return result
335
+ })
336
+ const groupList = Object.values(groups).map(r => ({...r, length: r.subs.length}))
337
+ return [
338
+ { page: 1, titleAppend:' - 1', groups: groupList, colors, indicators: indicators, validityErrors: validities },
339
+ { page: 2, titleAppend:' - 2', groups: groupList.slice(0, 4).map(rowMap), colors },
340
+ { page: 3, titleAppend:' - 3', groups: groupList.slice(4, 8).map(rowMap), colors },
341
+ { page: 4, titleAppend:' - 4', groups: groupList.slice(8, 12).map(rowMap), colors },
342
+ ];
343
+ }
344
+ }
345
+ function rowMap(r, i){
346
+ return {
347
+ ...r,
348
+ color: i % 2 === 0 ? colors.bars[0] : colors.bars[1],
349
+ bg: `url(#${i % 2 === 0 ? 'bgbar1' : 'bgbar2'})`
350
+ }
351
+ }
352
+
353
+ class FG {
354
+ factors = {};
355
+ _result = {};
356
+ _current = "";
357
+ _index = -1;
358
+ constructor(factors) {
359
+ this.factors = factors;
360
+ }
361
+
362
+ generate() {
363
+ let common = {};
364
+ let sKey = "";
365
+ let gKey = ''
366
+ for (const factor of this.factors) {
367
+ const parse = this.parse(factor);
368
+ const [key, sub, group, isGroup] = parse;
369
+ if (key !== sKey) {
370
+ this.current(group);
371
+ if(gKey !== ''){
372
+ if(this._result[gKey] === undefined ){
373
+ this._result[gKey] = common;
374
+ }else{
375
+ this._result[gKey].subs.push(common)
376
+ }
377
+ }
378
+ sKey = key;
379
+ gKey = group
380
+ common = { ...this.raw(factor), key: key.toUpperCase()};
381
+ if(isGroup){
382
+ common.subs = []
383
+ }
384
+ } else {
385
+ if (sub === "percentage") {
386
+ const [p, t] = this.percentage(factor);
387
+ common.percentage = p;
388
+ common.percentageText = t;
389
+ } else {
390
+ const [l, t] = this.label(factor);
391
+ common.level = l;
392
+ common.levelText = t;
393
+ }
394
+ }
395
+ }
396
+ this._result[gKey].subs.push(common)
397
+ return this._result
398
+ }
399
+
400
+ raw(factor) {
401
+ return {
402
+ ...factor,
403
+ mark: factor.mark ?? 0,
404
+ };
405
+ }
406
+
407
+ percentage(factor) {
408
+ const mark = factor.mark ?? 0;
409
+ return [mark, Math.round(mark * 100)];
410
+ }
411
+
412
+ label(factor) {
413
+ return [factor.mark, labels[factor.mark]];
414
+ }
415
+
416
+ parse(factor) {
417
+ const [key, sub] = factor?.label?.eng?.replace(/^factors_/, "").split("_");
418
+ const isGroup = !/\d$/.test(key);
419
+ const group = key.replace(/\d$/, "");
420
+ return [key, sub, group, isGroup];
421
+ }
422
+ current(group) {
423
+ if (this._current !== group) {
424
+ this._current = group;
425
+ this._index++;
426
+ }
427
+ }
428
+ }
429
+
430
+ module.exports = FRHPT93;
@@ -0,0 +1,115 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <linearGradient id="bgbarg">
5
+ <stop stop-color="{{colors.bars.[0].[0]}}"/>
6
+ <stop offset="1" stop-color="{{colors.bars.[0].[1]}}"/>
7
+ </linearGradient>
8
+ <clipPath id="cbgbarg">
9
+ {{bar 480 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0)}}
10
+ </clipPath>
11
+ <linearGradient id="bgind" x1="97" y1="0" x2="97" y2="83" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#F8FAFC"/>
13
+ <stop offset="1" stop-color="#F5F3FF"/>
14
+ </linearGradient>
15
+ <linearGradient id="error" x1="15" y1="15" x2="0" y2="15" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#FFF1F2"/>
17
+ <stop offset="1" stop-color="#FECDD3"/>
18
+ </linearGradient>
19
+ <filter id="split" x="0" y="0" width="7" height="462" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
20
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
21
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
22
+ <feOffset dx="1"/>
23
+ <feGaussianBlur stdDeviation="1.5"/>
24
+ <feComposite in2="hardAlpha" operator="out"/>
25
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
26
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_134825"/>
27
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5334_134825" result="shape"/>
28
+ </filter>
29
+ </defs>
30
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
31
+ <g>
32
+ <g transform="translate(0, 48)">
33
+ <g>
34
+ {{#each groups as |item index|}}
35
+ <g transform="translate(0, {{math index '*' 40}})">
36
+ <rect width="800" height="40" fill="{{ternary (even index) '#F8FAFC' 'none'}}" rx="8" />
37
+ {{bar 480 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill='#E2E8F080' transform='translate(158, 12)'}}
38
+ </g>
39
+ {{/each}}
40
+ </g>
41
+ <g>
42
+ <text x="156.5" y="-24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">0</text>
43
+ <text x="397.5" y="-24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">50 ٪</text>
44
+ <text x="632" y="-24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">100 ٪</text>
45
+ <text x="754" y="-19" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">رده‌بندی</text>
46
+ <text x="677" y="-33" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">نمره خام</text>
47
+ <text x="677" y="-19" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">از 144</text>
48
+ <line x1="277.5" y1="-8.5" x2="277.5" y2="446.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
49
+ <line x1="397.5" y1="-8.5" x2="397.5" y2="446.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
50
+ <line x1="517.5" y1="-8.5" x2="517.5" y2="446.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
51
+ <line x1="637.5" y1="-8.5" x2="637.5" y2="446.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
52
+ <rect x="709" y="-48" width="1" height="496" fill="#F1F5F9"/>
53
+
54
+ </g>
55
+ <g>
56
+ {{#each groups as |item index|}}
57
+ <g transform="translate(0, {{math index '*' 40}})">
58
+ {{# if (boolean key '!==' 'MO')}}
59
+ <g transform='translate(158, 12)'>
60
+ {{bar (math 480 '*' percentage) 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill='url(#bgbarg)' clip-path='url(#cbgbarg)'}}
61
+ <text x="{{math (math 480 '*' percentage) '+' (ternary (boolean percentage '<=' 0.24) 4 -6)}}" y="8" font-size="13" font-weight="500" dy=".3em" fill="{{ternary (boolean percentage '<=' 0.24) ../colors.bars.[0].[1] 'white'}}" text-anchor="{{ternary (boolean percentage '<=' 0.24) 'end' 'start'}}">
62
+ {{percentageText}} ٪
63
+ </text>
64
+ </g>
65
+ <rect x="659" y="11" width="36" height="18" rx="4" fill="{{../colors.bars.[0].[2]}}" />
66
+ <text x="677" y="20" font-size="13" font-weight="500" dy=".3em" fill="white" text-anchor="middle">{{item.mark}}</text>
67
+ <text x="755" y="20" font-size="12" font-weight="400" dy=".3em" fill="#64748B" text-anchor="middle">{{item.levelText}}</text>
68
+ <text x="149" y="20" font-size="13" font-weight="400" dy=".3em" fill="#475569" text-anchor="start">{{item.key}}</text>
69
+ <text x="121" y="20" font-size="13" font-weight="400" dy=".3em" fill="#475569" text-anchor="start">-</text>
70
+ <text x="110" y="20" font-size="13" font-weight="400" dy=".3em" fill="#475569" text-anchor="start">{{item.label.fa}}</text>
71
+ {{else}}
72
+ <rect x="659" y="11" width="36" height="18" rx="4" fill="#CBD5E1" />
73
+ <text x="677" y="20" font-size="13" font-weight="500" dy=".3em" fill="white" text-anchor="middle">-</text>
74
+ <text x="755" y="20" font-size="13" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">-</text>
75
+ <text x="149" y="20" font-size="13" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="start">{{item.key}}</text>
76
+ <text x="121" y="20" font-size="13" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="start">-</text>
77
+ <text x="110" y="20" font-size="13" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="start">{{item.label.fa}}</text>
78
+ {{/if}}
79
+
80
+ </g>
81
+ {{/each}}
82
+ </g>
83
+ <g opacity="0.5" filter="url(#split)" transform="translate(154.5, -10.5)">
84
+ <line x1="2.5" y1="3.5" x2="2.5" y2="458.5" stroke="white" stroke-linecap="round"/>
85
+ </g>
86
+ </g>
87
+ </g>
88
+ <g transform="translate(0, 520)">
89
+ {{#each indicators as |item index|}}
90
+ <g transform="translate({{math index '*' 202}}, 0)">
91
+ <rect width="194" height="83" fill="url(#bgind)" stroke="#EDE9FE" rx="8" />
92
+ <text x="142" y="29.5" font-size="16" font-weight="600" dy=".3em" fill="#5B21B6" text-anchor="middle">{{item.mark}}</text>
93
+ <text x="72" y="29.5" font-size="14" font-weight="500" dy=".3em" fill="#334155" text-anchor="middle">{{item.levelText}}</text>
94
+ <path d="M 8.78 3.78 h -8.75 m 0 0 l 3.75 3.75 m -3.75 -3.75 l 3.75 -3.75" stroke="#94A3B8" stroke-linecap="round" stroke-linejoin="round" transform="translate(112.62, 25.75)"/>
95
+ <text x="97" y="55" font-size="13" font-weight="400" dy=".3em" fill="#64748B" text-anchor="middle">{{item.label.fa}}</text>
96
+ </g>
97
+ {{/each}}
98
+ </g>
99
+ <g transform="translate(0, 611)">
100
+ <rect width="800" height="46" fill="#FFF1F2" stroke="#FECDD3" rx="8" />
101
+ <path d="M 8.9 5.63 v 3.5556 m 0 2.6667 h 0.0089 m -1.464 -11.0303 l -7.2053 12.0303 c -0.1485 0.2572 -0.2271 0.5488 -0.228 0.8459 c -0.0009 0.297 0.0761 0.5891 0.2231 0.8472 c 0.1471 0.258 0.3591 0.4731 0.6151 0.6238 c 0.256 0.1507 0.5469 0.2317 0.844 0.2351 h 14.4125 c 0.2968 -0.0035 0.5877 -0.0845 0.8435 -0.2352 c 0.2559 -0.1506 0.4679 -0.3656 0.6149 -0.6235 c 0.147 -0.258 0.224 -0.5499 0.2233 -0.8468 c -0.0008 -0.2969 -0.0792 -0.5884 -0.2275 -0.8456 l -7.2053 -12.0321 c -0.1516 -0.2502 -0.3652 -0.4571 -0.6201 -0.6007 c -0.2549 -0.1436 -0.5425 -0.219 -0.8351 -0.219 c -0.2926 0 -0.5802 0.0754 -0.8351 0.219 c -0.2549 0.1436 -0.4685 0.3505 -0.6201 0.6007 v 0.0009 z" transform="translate(729.61, 15.04)" fill="none" stroke="#BE123C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
102
+ <text x="690" y="23" font-size="14" font-weight="500" dy=".3em" fill="#BE123C" text-anchor="middle">فاقد اعتبار</text>
103
+ <path d="M 0 0 l 15 -15 l 0 30 l -15 -15 z" fill="url(#error)" transform="translate(580, 23)"/>
104
+ <g transform="translate(0, 23)">
105
+ {{#each validityErrors as |error index|}}
106
+ <text x="{{math 532 '-' (math start '+' (math length '/' 2))}}" y="0" font-size="13" font-weight="400" dy=".3em" fill="#57534E" text-anchor="middle">{{error.error}}</text>
107
+ {{#if (boolean error.last '===' false)}}
108
+ <circle cx="{{math 532 '-' (math start '+' (math length '+' 26))}}" cy="2" r="2" fill="#A1A1AA"/>
109
+ {{/if}}
110
+ {{/each}}
111
+ </g>
112
+ </g>
113
+ </g>
114
+
115
+ {{/layout}}
@@ -0,0 +1,103 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <linearGradient id="bgbar1">
5
+ <stop stop-color="{{colors.bars.[0].[0]}}"/>
6
+ <stop offset="1" stop-color="{{colors.bars.[0].[1]}}"/>
7
+ </linearGradient>
8
+ <linearGradient id="bgbar2">
9
+ <stop stop-color="{{colors.bars.[1].[0]}}"/>
10
+ <stop offset="1" stop-color="{{colors.bars.[1].[1]}}"/>
11
+ </linearGradient>
12
+ <clipPath id="cobar">
13
+ {{bar 250 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0)}}
14
+ </clipPath>
15
+
16
+ <filter id="split" x="0" y="0" width="7" height="{{ternary (boolean groups.length '==' 3) 462 614}}" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
17
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
18
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
19
+ <feOffset dx="1"/>
20
+ <feGaussianBlur stdDeviation="1.5"/>
21
+ <feComposite in2="hardAlpha" operator="out"/>
22
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
23
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5334_139730"/>
24
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5334_139730" result="shape"/>
25
+ </filter>
26
+ </defs>
27
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
28
+ <g transform="translate(0, 4)">
29
+ <g transform="translate(0, 48)">
30
+ {{#each groups as |item index|}}
31
+ {{setVar "color" (ternary (even index) ../colors.bars.[0] ../colors.bars.[1])}}
32
+ <g transform="translate(0, {{math index '*' 152}})">
33
+ <rect width="800" height="136" rx="8" fill="{{ternary (even index) '#F8FAFC' 'white'}}" />
34
+ {{bar 180 136 (object tl=8 bl=8 tr=0 br=0) (toRad 0) fill=(ternary (even index) '#F1F5F9' 'white') }}
35
+ {{#if (boolean level '===' undefined)}}
36
+ <text x="90" y="57" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">{{key}}</text>
37
+ <text x="90" y="77" font-size="15" font-weight="500" dy=".3em" fill="#334155" text-anchor="middle">{{label.fa}}</text>
38
+ {{else}}
39
+ <text x="90" y="23.5" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">{{key}}</text>
40
+ <text x="90" y="44.5" font-size="15" font-weight="500" dy=".3em" fill="#334155" text-anchor="middle">{{label.fa}}</text>
41
+ <rect x="50" y="65.5" width="80" height="1" rx="0.5" fill="#E2E8F0"/>
42
+ <rect x="100.5" y="78.5" width="40" height="20" rx="4" fill="{{color.[2]}}" />
43
+ <text x="120.5" y="88.5" font-size="14" font-weight="600" dy=".3em" fill="#FFFFFF" text-anchor="middle">{{percentageText}} ٪</text>
44
+ <text x="90" y="111.5" font-size="12" font-weight="400" dy=".3em" fill="{{color.[2]}}" text-anchor="middle">{{levelText}}</text>
45
+ <text x="92.5" y="88.5" font-size="15" font-weight="500" dy=".3em" fill="#334155" text-anchor="start">
46
+ <tspan>
47
+ {{mark}}
48
+ </tspan>
49
+ <tspan fill="#64748B" font-size="14" font-weight="500">از 144</tspan>
50
+ </text>
51
+ {{/if}}
52
+ <g transform="translate(389, {{ternary (boolean item.length '===' 4) 12 28}})">
53
+ {{#each subs as |sub i|}}
54
+ <g transform="translate(0, {{math i '*' 32}})">
55
+ {{bar 250 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill='#E2E8F080' clip-path="url(#cobar)"}}
56
+ </g>
57
+ {{/each}}
58
+ </g>
59
+ </g>
60
+ {{/each}}
61
+ </g>
62
+ <line x1="451.25" y1="40.5" x2="451.25" y2="{{ternary (boolean groups.length '==' 3) '495.5' '647.5'}}" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
63
+ <line x1="513.25" y1="40.5" x2="513.25" y2="{{ternary (boolean groups.length '==' 3) '495.5' '647.5'}}" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
64
+ <line x1="576.25" y1="40.5" x2="576.25" y2="{{ternary (boolean groups.length '==' 3) '495.5' '647.5'}}" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
65
+ <line x1="638.25" y1="40.5" x2="638.25" y2="{{ternary (boolean groups.length '==' 3) '495.5' '647.5'}}" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="5.5 5.5"/>
66
+ <rect x="709" width="1" height="{{ternary (boolean groups.length '==' 3) 496 648}}" fill="#F1F5F9"/>
67
+ <text x="387.5" y="24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">0</text>
68
+ <text x="514.5" y="24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">50 ٪</text>
69
+ <text x="637" y="24" font-size="12" font-weight="400" dy=".3em" fill="#94A3B8" text-anchor="middle">100 ٪</text>
70
+ <text x="754" y="27" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">رده‌بندی</text>
71
+ <text x="677" y="13" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">نمره خام</text>
72
+ <text x="677" y="27" font-size="12" font-weight="500" dy=".3em" fill="#64748B" text-anchor="middle">از 36</text>
73
+
74
+ <g transform="translate(0, 48)">
75
+ {{#each groups as |item index|}}
76
+ {{setVar "color" (ternary (even index) ../colors.bars.[0] ../colors.bars.[1])}}
77
+ <g transform="translate(0, {{math index '*' 152}})">
78
+ <g transform="translate(389, {{ternary (boolean item.length '===' 4) 12 28}})">
79
+ {{#each subs as |sub i|}}
80
+ <g transform="translate(0, {{math i '*' 32}})">
81
+ {{bar (math percentage '*' 250) 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill=../bg}}
82
+ <text x="-9" y="9" font-size="13" font-weight="400" dy=".3em" fill="#475569" text-anchor="start">{{sub.label.fa}}</text>
83
+ <rect x="270" y="-.5" width="36" height="17" rx="4" fill="none" stroke="{{../color.[3]}}" />
84
+ <text x="288" y="9" font-size="13" font-weight="500" dy=".3em" fill="{{../color.[2]}}" text-anchor="middle">{{sub.mark}}</text>
85
+ <text x="366" y="9" font-size="12" font-weight="400" dy=".3em" fill="#64748B" text-anchor="middle">{{sub.levelText}}</text>
86
+ {{#if (boolean percentage '>' 0.24)}}
87
+ <text x="{{math (math percentage '*' 250) '-' 4}}" y="9" font-size="13" font-weight="500" dy=".3em" fill="#FFFFFF" text-anchor="start">{{sub.percentageText}} ٪</text>
88
+ {{else}}
89
+ <text x="{{math (math percentage '*' 250) '+' 6}}" y="9" font-size="13" font-weight="500" dy=".3em" fill="{{../color.[1]}}" text-anchor="end">{{sub.percentageText}} ٪</text>
90
+ {{/if}}
91
+ </g>
92
+ {{/each}}
93
+ </g>
94
+ </g>
95
+ {{/each}}
96
+ </g>
97
+ <g opacity="0.5" filter="url(#split)" transform="translate(386, 37.5)">
98
+ <line x1="2.5" y1="3.5" x2="2.5" y2="{{ternary (boolean groups.length '==' 3) 458.5 610.5}}" stroke="white" stroke-linecap="round"/>
99
+ </g>
100
+ </g>
101
+ </g>
102
+
103
+ {{/layout}}