@baravak/risloo-profile-cli 4.11.0 → 4.12.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baravak/risloo-profile-cli",
3
- "version": "4.11.0",
3
+ "version": "4.12.1",
4
4
  "description": "**Risloo Profile CLI** is a library for creating profiles, reports and sheets for *psychological* samples.",
5
5
  "main": "bin/risloo.js",
6
6
  "publishConfig": {
@@ -0,0 +1,5 @@
1
+ function indexOf(arr, index) {
2
+ return arr[index]
3
+ }
4
+
5
+ module.exports = indexOf;
@@ -27,6 +27,7 @@ const prepend = require("./helpers/prepend");
27
27
  const polarToCartesian = require("./helpers/polarToCartesian");
28
28
  const abs = require("./helpers/abs");
29
29
  const getArrOfProp = require("./helpers/getArrOfProp");
30
+ const indexOf = require("./helpers/indexOf");
30
31
  const displacePoint = require("./helpers/displacePoint");
31
32
  const normalizeAngle = require("./helpers/normalizeAngle");
32
33
  const withGroup = require("./helpers/withGroup");
@@ -71,6 +72,7 @@ const helpers = {
71
72
  polarToCartesian,
72
73
  abs,
73
74
  getArrOfProp,
75
+ indexOf,
74
76
  displacePoint,
75
77
  normalizeAngle,
76
78
  withGroup,
@@ -0,0 +1 @@
1
+ {"id":"$X163XXXX","scale":{"id":"$NEO-9A","title":"پرسشنامه نئو نئو ۶۰ سؤالی"},"version":"5","edition":"","edition_version":null,"client":{"id":"GH966XXXXX","name":"مراجع"},"room":{"id":"RS96XXXX","manager":{"id":"GH96XXXXX","name":"درمانگر","user_id":"IR96XXX","avatar":null},"center":{"id":"RS96XXXX","acceptation":null,"status":"active","type":"counseling_center","detail":{"title":"مرکز درمانی"}},"acceptation":null,"status":"active","type":"room"},"case":null,"code":null,"created_at":1728128259,"started_at":1728128300,"scored_at":1728367688,"closed_at":1728128587,"total_amount":0,"prepayment":false,"purchased":true,"amount":null,"billing":null,"description":"در پاسخ دادن به هر سؤال باید احساسات و رفتار عادی و عمومی خود را در نظر بگیرید. لطفاً به تمام سؤال‌ها پاسخ دهید و وقت خود را روی سؤال خاصی تلف نکنید. در این پرسشنامه پاسخ صحیح و غلط وجود ندارد بلکه پاسخ شما به هر سؤال باید نماینده اولین عکس العمل شما در برابر سؤال باشد.","psychologist_description":null,"items":[{"text":"من اصولا شخص نگرانی نیستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"دوست دارم همیشه افراد زیادی دور و برم باشند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"5"},{"text":"دوست ندارم وقتم را با خیال پردازی تلف کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"سعی می‌کنم در مقابل همه مودب باشم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"وسایل متعلق به خود را تمیز و مرتب نگه می‌دارم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"5"},{"text":"اغلب خود را کمتر از دیگران حس می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"زود به خنده می‌افتم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"هنگامی که راه درست کاری را پیدا کنم، آن روش را همیشه ادامه می‌دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب با فامیل و همکارانم بگو مگو دارم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"3"},{"text":"به خوبی می‌توانم کارهایم را طوری تنظیم کنم که درست و سر زمان تعیین شده، انجام شوند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"هنگامی که تحت فشارهای روحی زیادی هستم گاه احساس می‌کنم دارم خرد می‌شوم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"خودم را فرد خیلی سرحال و سرزنده‌اینمی‌دانم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"نقش‌های موجود در پدیده‌های هنری و طبیعت مرا مبهوت می‌کنند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"بعضی مردم فکر می‌کنند که من شخصی خودخواه و خودمحورم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"فرد خیلی منظم و مرتبی نیستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"1"},{"text":"به ندرت احساس تنهایی و غم می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"واقعاً از صحبت کردن با دیگران لذت می‌برم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"فکر می‌کنم گوش دادن دانشجویان به مطالب متناقض، فقط به سردرگمی و گمراهی آن‌ها منجر خواهد شد.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"همکاری را بر رقابت با دیگران ترجیح می‌دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"سعی می‌کنم که همه کارهایم را با احساس مسئولیت انجام دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب احساس عصبی بودن و تنش می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"همیشه برای کار آماده‌ام.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"شعر تقریباً اثری در من ندارد.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"نسبت به قصد و نیت دیگران حساس و مشکوک هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"دارای اهداف روشنی هستم و برای رسیدن به آن‌ها طبق برنامه کار می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"گاهی کاملاً احساس بی‌ارزشی می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"غالباًترجیح می‌دهم که کارهایم را به تنهایی انجام دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"اغلب غذاهای جدید و خارجی را امتحان می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"معتقدم اگر به مردم اجازه دهید، اکثر آن‌ها از شما سوء استفاده می‌کنند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"قبل از شروع هر کاری وقت زیادی تلف می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"به ندرت احساس اضطراب یا ترس می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب احساس می‌کنم که سرشار از انرژی هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"به ندرت به احساسات و عواطفی که محیط‌های متفاوتی به وجود می‌آورند، توجه می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب آشنایانم مرا دوست دارند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"3"},{"text":"برای رسیدن به اهدافم شدیداً تلاش می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب از طرز برخورد دیگران با خودم عصبانی می‌شوم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"فردی خوشحال و بشاش و دارای روحیه خوبی هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"معتقدم که هنگام تصمیم گیری در مسائل اخلاقی باید پیرو مراجع مذهبی باشیم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"3"},{"text":"برخی فکر می‌کنند من فردی سرد و حسابگر هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":" وقتی قول یا تعهدی می‌دهم همواره می‌توان برای عمل به آن روی من حساب کرد.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"معمولاً وقتی کارها درست پیش نمی‌رود، دلسرد شده و از کار منصرف می‌شوم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"شخص با نشاط و خوش بینی نیستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"بعضی اوقات وقتی شعری می‌خوانم یا یک کار هنری را تماشا می‌کنم، یک احساس لرزش و یک تکان هیجانی را حس می‌کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"در روش‌هایم سرسخت و بی‌انعطاف هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"گاهی آنطور که باید و شاید قابل اعتماد و اتکا نیستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"1"},{"text":"به ندرت غمگین و افسرده هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"زندگی و رویدادهای آن برایم سریع می‌گذرد.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"علاقه‌ای به تامل و تفکر جدی درباره سرنوشت و ماهیت جهان یا انسان ندارم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"عموما سعی می‌کنم شخصی با ملاحظه و منطقی باشم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"فرد مولدی هستم که همیشه کارهایم را به اتمام می‌رسانم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اغلب احساس درماندگی می‌کنم و دنبال کسی می‌گردم که مشکلاتم را برطرف کند.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"شخص بسیار فعالی هستم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"من کنجکاوی فکری فراوانی دارم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"اگر کسی را دوست نداشته باشم، می‌گذارم متوجه احساسم شود.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":"فکر نمی‌کنم که هیچ وقت بتوانم فردی منطقی بشوم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"گاهی آن چنان خجالت‌زده شده‌ام که فقط می‌خواستم خودم را پنهان کنم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"ترجیح می‌دهم برای خودم کار کنم تا رهبر دیگران باشم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"2"},{"text":"اغلب از کلنجار رفتن با نظریه‌های انتزاعی لذت می‌برم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"4"},{"text":" اگر لازم باشد می‌توانم برای رسیدن به اهداف، دیگران را به طور ماهرانه‌ایبه بازی بگیریم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"3"},{"text":"تلاش می‌کنم هر کاری را به نحو احسن انجام دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"5"},{"text":"من سعی کردم که تمام این سؤالات را صادقانه و به دقت پاسخ دهم.","type":"text","answer":{"type":"optional","options":["کاملاً مخالفم","مخالفم","نظری ندارم","موافقم","کاملاً موافقم"]},"user_answered":"5"},{"text":"آیا به تمام سؤالات پاسخ داده‌اید؟","type":"text","answer":{"type":"optional","options":["بله","خیر"]},"user_answered":"1"},{"text":"آیا پاسخ‌های خود را در جای مناسب علامت زده‌اید؟","type":"text","answer":{"type":"optional","options":["بله","خیر"]},"user_answered":"1"}],"prerequisites":[{"type":"text","text":"جنسیت","answer":{"type":"select","options":["زن","مرد"]},"alias":"gender","label":"gender","force":true,"user_answered":"2"},{"type":"text","text":"سن","answer":{"type":"number"},"alias":"age","label":"age","force":true,"user_answered":"21"},{"type":"text","text":"تحصیلات","answer":{"type":"select","options":["ابتدایی اول","ابتدایی دوم","متوسطه اول","متوسطه دوم","دیپلم","کارشناسی","کارشناسی ارشد","پزشکی عمومی","متخصص","دکتری تخصصی","حوزوی مقدمات","حوزوی سطح۱","حوزوی سطح۲","حوزوی سطح۳","حوزوی سطح۴"]},"alias":"education","label":"education","force":true,"user_answered":"8"},{"type":"text","label":"marital_status","text":"وضعیت تأهل","answer":{"type":"select","options":["مجرد","متأهل"]},"alias":"marital_status","force":true,"user_answered":"1"}],"cornometer":5,"score":{"type":"60","n":2,"n_raw":18,"n_null":0,"e":5,"e_raw":35,"e_null":0,"o":3,"o_raw":29,"o_null":0,"a":1,"a_raw":27,"a_null":0,"c":5,"c_raw":40,"c_null":0,"n1":0,"n1_raw":0,"n1_null":0,"n2":0,"n2_raw":0,"n2_null":0,"n3":0,"n3_raw":0,"n3_null":0,"n4":0,"n4_raw":0,"n4_null":0,"n5":0,"n5_raw":0,"n5_null":0,"n6":0,"n6_raw":0,"n6_null":0,"e1":0,"e1_raw":0,"e1_null":0,"e2":0,"e2_raw":0,"e2_null":0,"e3":0,"e3_raw":0,"e3_null":0,"e4":0,"e4_raw":0,"e4_null":0,"e5":0,"e5_raw":0,"e5_null":0,"e6":0,"e6_raw":0,"e6_null":0,"o1":0,"o1_raw":0,"o1_null":0,"o2":0,"o2_raw":0,"o2_null":0,"o3":0,"o3_raw":0,"o3_null":0,"o4":0,"o4_raw":0,"o4_null":0,"o5":0,"o5_raw":0,"o5_null":0,"o6":0,"o6_raw":0,"o6_null":0,"a1":0,"a1_raw":0,"a1_null":0,"a2":0,"a2_raw":0,"a2_null":0,"a3":0,"a3_raw":0,"a3_null":0,"a4":0,"a4_raw":0,"a4_null":0,"a5":0,"a5_raw":0,"a5_null":0,"a6":0,"a6_raw":0,"a6_null":0,"c1":0,"c1_raw":0,"c1_null":0,"c2":0,"c2_raw":0,"c2_null":0,"c3":0,"c3_raw":0,"c3_null":0,"c4":0,"c4_raw":0,"c4_null":0,"c5":0,"c5_raw":0,"c5_null":0,"c6":0,"c6_raw":0,"c6_null":0,"vq_1":5,"vq_2":1,"vq_3":1,"count_option_1":2,"count_option_2":20,"count_option_3":4,"count_option_4":31,"count_option_5":3,"voption_1":1,"voption_2":1,"voption_3":1,"voption_4":1,"voption_5":1},"score_current_version":"1.0.0","score_last_version":"1.0.0"}
@@ -0,0 +1,91 @@
1
+ const { Profile, FS } = require("../Profile");
2
+
3
+
4
+ class NEO9A extends Profile {
5
+ // Number of pages
6
+ static pages = 1;
7
+
8
+ // Labels of the sample
9
+ labels = {
10
+ L0: { eng: "n", fr: "روان‌آزده‌گرایی", startColor:"#F9A8D4", endColor: "#DB2777", textColor:"#BE185D", bgColor: "#FDF2F8", steps: [15, 20, 25, 31, 48]},
11
+ L1: { eng: "n_raw"},
12
+
13
+ L2: { eng: "e", fr: "برون‌گرایی", startColor:"#67E8F9", endColor: "#0891B2", textColor:"#0E7490", bgColor: "#ECFEFF", steps: [22, 26, 29, 32, 48]},
14
+ L3: { eng: "e_raw"},
15
+
16
+ L4: { eng: "o", fr: "گشودگی", startColor:"#7DD3FC", endColor: "#0284C7", textColor:"#0369A1", bgColor: "#F0F9FF", steps: [23, 27, 29, 32, 48]},
17
+ L5: { eng: "o_raw"},
18
+
19
+ L6: { eng: "a", fr: "موافق‌بودن", startColor:"#A5B4FC", endColor: "#4F46E5", textColor:"#4338CA", bgColor: "#EEF2FF", steps: [27, 31, 33, 37, 48]},
20
+ L7: { eng: "a_raw"},
21
+
22
+ L8: { eng: "c", fr: "با وجدان‌بودن", startColor:"#C4B5FD", endColor: "#7C3AED", textColor:"#6D28D9", bgColor: "#F5F3FF", steps: [27, 32, 35, 39, 48]},
23
+ L9: { eng: "c_raw"},
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: "پرسشنامه شخصیت نئو ۶۰ سوالی (NEO-FFI-60)" /* 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: 866 + 2 * this.padding.x,
43
+ height: 649 + 2 * this.padding.y,
44
+ };
45
+ },
46
+ padding: {
47
+ x: 18,
48
+ y: 32,
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
+ _calcContext() {
60
+ const {
61
+ dataset,
62
+ } = this;
63
+ const factors = []
64
+ for(let i = 0; i < 10; i+=2){
65
+ const factor = {
66
+ ...dataset.score[i],
67
+ mark: dataset.score[i+1].mark,
68
+ raw: dataset.score[i].mark - 1,
69
+ label: {
70
+ ...dataset.score[i].label,
71
+ eng: dataset.score[i].label.eng.toUpperCase(),
72
+ stepTitle: [],
73
+ fill: `url(#bar-${dataset.score[i].label.eng.toUpperCase()})`
74
+ }
75
+ }
76
+ for(let j = 0; j < factor.label.steps.length; j++){
77
+ const start = j === 0 ? 0 : factor.label.steps[j-1]
78
+ const step = factor.label.steps[j]
79
+ const middle = (((step - start) * 14) / 2) + (start * 14)
80
+ factor.label.stepTitle.push(middle)
81
+ }
82
+ factors.push(factor)
83
+ }
84
+ const steps = ['خیلی پایین', 'پایین', 'وسط', 'بالا', 'خیلی بالا']
85
+ return [{factors, steps}];
86
+ }
87
+ }
88
+
89
+
90
+
91
+ module.exports = NEO9A;
@@ -0,0 +1,30 @@
1
+ {{#> layout}}
2
+ <defs>
3
+ {{#each factors as | item index |}}
4
+ <linearGradient id="bar-{{item.label.eng}}" x1="0%" y1="0%" x2="100%" y2="0%">
5
+ <stop offset="0%" style="stop-color:{{item.label.startColor}};stop-opacity:1" />
6
+ <stop offset="100%" style="stop-color:{{item.label.endColor}};stop-opacity:1" />
7
+ </linearGradient>
8
+ {{/each}}
9
+ </defs>
10
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
11
+ {{#each factors as | item index |}}
12
+ <g transform="translate(0, {{math index '*' 133}})">
13
+ <rect width="866" height="117" rx="12" fill="none" stroke="#E5E7EB" />
14
+ <text y="69" x="108" dy=".95em" font-size="13" font-weight="500" fill="#4B5563">{{item.label.fr}}</text>
15
+ <text y="69" x="118" dy=".95em" text-anchor="end" font-size="13" font-weight="500" fill="#4B5563">-</text>
16
+ <text y="69" x="139" dy=".95em" text-anchor="middle" font-size="13" font-weight="500" fill="#4B5563">{{item.label.eng}}</text>
17
+ {{bar 672 16 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=item.label.bgColor transform="translate(155,69)"}}
18
+ {{#each ../steps as | step stepIndex |}}
19
+ <line x1="{{math 155 '+' (math 14 '*' (indexOf item.label.steps stepIndex))}}" y1="40.5" x2="{{math 155 '+' (math 14 '*' (indexOf item.label.steps stepIndex))}}" y2="92.5" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
20
+ <text y="44" x="{{math 155 '+' (indexOf item.label.stepTitle stepIndex)}}" dy=".95em" text-anchor="middle" font-size="12" font-weight="{{ternary (boolean item.raw '===' stepIndex) 500 400}}" fill="{{ternary (boolean item.raw '===' stepIndex) item.label.textColor "#9CA3AF"}}">{{step}}</text>
21
+ <text y="25" x="{{math 155 '+' (math 14 '*' (indexOf item.label.steps stepIndex))}}" dy=".95em" text-anchor="middle" font-size="12" font-weight="400" fill="#9CA3AF">{{indexOf item.label.steps stepIndex}}</text>
22
+ {{/each}}
23
+ {{bar (math item.mark '*' 14) 16 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=item.label.fill transform="translate(155,69)"}}
24
+ <text y="71" x="{{ternary (boolean item.mark '<=' 5) (math 161 '+' (math 14 '*' item.mark)) (math 149 '+' (math 14 '*' item.mark))}}" dy=".75em" text-anchor="{{ternary (boolean item.mark '<=' 5) 'end' 'start'}}" font-size="16" font-weight="500" fill="{{ternary (boolean item.mark '<=' 5) item.label.textColor '#FFFFFF'}}">{{item.mark}}</text>
25
+
26
+ </g>
27
+ {{/each}}
28
+
29
+ </g>
30
+ {{/layout}}