diff --git a/_posts/2024-07-24-proof-of-motivation.md b/_posts/2024-07-24-proof-of-motivation.md
new file mode 100644
index 00000000..d2d54deb
--- /dev/null
+++ b/_posts/2024-07-24-proof-of-motivation.md
@@ -0,0 +1,101 @@
+---
+layout: post
+title: "Proof of motivation. Investor Pitch for Dapp Testing of Candidate Motivation"
+description: "Investor Pitch for Dapp Testing of Candidate Motivation"
+tags: [motivation, proof]
+author: eugene
+categories: [Self-Knowledge, Career]
+comments : True
+pin: false
+mermaid: true
+image:
+ path: /assets/img/5-hats/01-leadership-hats.jpg
+---
+### Investor Pitch for Dapp Testing of Candidate Motivation
+
+---
+
+#### **Introduction**
+
+Hiring the right talent is a critical challenge for businesses worldwide. Traditional methods of assessing candidate suitability often fail to account for a candidate's intrinsic motivation, which is a key factor in job performance and employee retention. Our innovative decentralized application (dApp) aims to revolutionize the hiring process by testing and scoring candidates' motivation and alignment with specific job vacancies. This dApp leverages blockchain technology to ensure transparency, security, and trust in the hiring process.
+
+---
+
+#### **Problem in the Hiring Market**
+
+**Short-Term Issues:**
+
+1. **Inaccurate Assessments:**
+ - Traditional hiring methods often rely on resumes, interviews, and references, which can be biased or misleading.
+ - Candidates may tailor their responses to what they think employers want to hear, leading to poor job fits.
+
+2. **High Turnover Rates:**
+ - Employees who are not genuinely motivated or aligned with their roles are more likely to leave, increasing turnover rates and associated costs.
+
+3. **Time-Consuming Processes:**
+ - Extensive interview processes and background checks can delay hiring, causing businesses to miss out on top talent.
+
+**Long-Term Issues:**
+
+1. **Employee Disengagement:**
+ - Lack of motivation alignment leads to disengagement, affecting productivity and workplace morale.
+ - Disengaged employees are less likely to innovate or contribute positively to the company culture.
+
+2. **Increased Hiring Costs:**
+ - High turnover rates lead to repeated recruitment costs, including advertising, training, and onboarding expenses.
+
+3. **Talent Mismatch:**
+ - Persistent issues with motivation alignment result in a workforce that does not reach its full potential, hampering the company's growth and competitive edge.
+
+---
+
+#### **Our Solution**
+
+Our dApp addresses these issues by focusing on the intrinsic motivations of candidates and their alignment with job roles.
+
+**Key Features:**
+
+1. **Motivation Testing:**
+ - Candidates undergo a series of scientifically designed assessments to gauge their intrinsic motivations.
+ - These assessments are based on psychological theories and data-driven insights.
+
+2. **Blockchain-Powered Transparency:**
+ - All data and results are stored securely on the blockchain, ensuring tamper-proof records and trust between employers and candidates.
+
+3. **Automated Scoring:**
+ - The dApp provides a motivation score that reflects the candidate's alignment with the specific job role, enabling employers to make informed decisions quickly.
+
+4. **Real-Time Analytics:**
+ - Employers receive real-time analytics on candidate motivation trends, helping them refine their hiring strategies.
+
+---
+
+#### **Benefits**
+
+**Short-Term Benefits:**
+
+1. **Improved Hiring Accuracy:**
+ - Enhanced candidate assessment leads to better job fits and reduces the risk of hiring the wrong person.
+
+2. **Reduced Turnover Rates:**
+ - By aligning candidate motivation with job roles, employee retention rates improve, saving costs on repeated hiring.
+
+3. **Faster Hiring Process:**
+ - Streamlined assessments and automated scoring accelerate the hiring process, allowing businesses to secure top talent swiftly.
+
+**Long-Term Benefits:**
+
+1. **Higher Employee Engagement:**
+ - Employees who are motivated and aligned with their roles are more engaged, productive, and innovative.
+
+2. **Lower Recruitment Costs:**
+ - Reduced turnover and improved retention lead to significant savings in recruitment and training costs over time.
+
+3. **Enhanced Competitive Advantage:**
+ - A motivated and well-aligned workforce drives business growth, innovation, and a strong company culture, providing a competitive edge in the market.
+
+---
+
+#### **Conclusion**
+
+Our dApp is set to transform the hiring landscape by focusing on the core aspect of candidate motivation. By ensuring a strong alignment between candidates' intrinsic motivations and job roles, businesses can build a more engaged, productive, and loyal workforce. We invite investors to join us in revolutionizing the future of hiring with our cutting-edge solution.
\ No newline at end of file
diff --git a/_tabs/motivation-test.md b/_tabs/motivation-test.md
index 0ede088c..0ef76676 100644
--- a/_tabs/motivation-test.md
+++ b/_tabs/motivation-test.md
@@ -1,150 +1,31 @@
---
# the default layout is 'page'
-titile: Discover Your Core Motivation - Take the Motivation Test Today!
-description: Uncover what drives you with our Motivation Test. Reveal your key motivators and gain insights into your growth. Start now!
+title: Proof of Motivation
+description: Uncover what drives you with our Motivation Test DApp. Reveal your key motivators and gain insights into your growth. Start now!
icon: fas fa-sun
order: 5
image:
path: assets/img/motivation-test.png
---
-
+
+
Discover Your Core Motivation - Take the Motivation Test DApp Today!
+
+
Results:
+
+
+
+ ETH (0.003 ETH minimum contribution for recording test results in a blockchain)
+
+
+
-
+
+
+
@@ -158,7 +39,7 @@ image:
-
Results:
+
Result:
Chart:
@@ -167,6 +48,14 @@ image:
+
-
+
+
diff --git a/assets/css/motivation-test-page.css b/assets/css/motivation-test-page.css
new file mode 100644
index 00000000..4727a3dd
--- /dev/null
+++ b/assets/css/motivation-test-page.css
@@ -0,0 +1,157 @@
+body {
+ font-family: Arial, sans-serif;
+ padding: 20px;
+}
+#question {
+ font-size: 1.2em;
+ margin-bottom: 20px;
+ height: 110px;
+}
+.label-container {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ align-items: center;
+ align-content: center;
+ margin-bottom: 10%;
+}
+#category {
+ font-size: 2em;
+ order: 1;
+}
+#low {
+ width: 15%;
+ order: 1;
+ text-wrap: wrap;
+ text-align: left;
+}
+#high {
+ width: 15%;
+ order: 3;
+ text-wrap: wrap;
+ text-align: right;
+}
+#circles-container {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: nowrap;
+ width: 60%;
+ order: 2;
+}
+.answer-circle {
+ display: inline-block;
+ margin: 0 5px;
+ border-radius: 50%;
+ cursor: pointer;
+ flex-shrink: 0;
+}
+.answer-circle:hover {
+ opacity: 0.5;
+}
+#result {
+ margin-top: 20px;
+}
+#result-hash {
+ font-family: monospace;
+ background:var(--background-color);
+ padding: 5px;
+ border-radius: 3px;
+ display: inline-block;
+ word-break: break-all;
+ word-wrap: break-word;
+}
+.text-result {
+ margin: 0.5em;
+ display: inline-block;
+}
+.top-1 {
+ font-size: 2.5em;
+ color: rgba(255, 255, 255, 1.0); /* Полная насыщенность */
+ font-weight: bold;
+}
+.top-2 {
+ font-size: 2.3em;
+ color: rgba(255, 255, 255, 0.9); /* 90% насыщенности */
+ font-weight: bold;
+}
+.top-3 {
+ font-size: 2.1em;
+ color: rgba(255, 255, 255, 0.8); /* 80% насыщенности */
+ font-weight: bold;
+}
+.top-4 {
+ font-size: 1.9em;
+ color: rgba(255, 255, 255, 0.7); /* 70% насыщенности */
+ font-weight: bold;
+}
+.top-5 {
+ font-size: 1.7em;
+ color: rgba(255, 255, 255, 0.6); /* 60% насыщенности */
+ font-weight: bold;
+}
+.top-6 {
+ font-size: 1.5em;
+ color: rgba(255, 255, 255, 0.5); /* 50% насыщенности */
+ font-weight: normal;
+}
+.top-7 {
+ font-size: 1.3em;
+ color: rgba(255, 255, 255, 0.4); /* 40% насыщенности */
+ font-weight: normal;
+}
+#progress-container {
+ width: 100%;
+ background-color: #f3f3f39c;
+ border-radius: 30px;
+ margin-top: 37px;
+}
+#progress-bar {
+ width: 0%;
+ height: 15px;
+ background-color: #198754;
+ border-radius: 25px;
+}
+#progress-text {
+ text-align: center;
+ margin-top: 10px;
+}
+.web3button {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 6px 14px;
+ font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
+ border-radius: 6px;
+ border: none;
+
+ background: #6E6D70;
+ box-shadow: 0px 0.5px 1px rgba(0, 0, 0, 0.1), inset 0px 0.5px 0.5px rgba(255, 255, 255, 0.5), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.12);
+ color: #DFDEDF;
+ user-select: none;
+ -webkit-user-select: none;
+ touch-action: manipulation;
+}
+.web3button:focus {
+ box-shadow: inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2), 0px 0.5px 1px rgba(0, 0, 0, 0.1), 0px 0px 0px 3.5px rgba(58, 108, 217, 0.5);
+ outline: 0;
+}
+@media (max-width: 768px) {
+ .label-container {
+ flex-direction: raw;
+ }
+ #low {
+ order: 2;
+ width: 40%;
+ margin-top: 15px;
+ }
+ #circles-container {
+ order: 1;
+ width: 100%;
+ }
+ #high {
+ order: 3;
+ width: 40%;
+ margin-top: 15px;
+ }
+}
\ No newline at end of file
diff --git a/assets/js/MotivationTestQuestions.js b/assets/js/MotivationTestQuestions.js
new file mode 100644
index 00000000..7b695282
--- /dev/null
+++ b/assets/js/MotivationTestQuestions.js
@@ -0,0 +1,76 @@
+import { motivationTestAnswers } from './motivationTestAnswers.js';
+class Questions {
+ constructor() {
+ this.autonomy = [];
+ this.competence = [];
+ this.relatedness = [];
+ this.diversity_of_skills = [];
+ this.significance_of_the_task = [];
+ this.feedback = [];
+ this.task_identification = [];
+ this.goals_and_objectives = [];
+ }
+}
+class MotivationTest {
+ constructor() {
+ this.questions = new Questions;
+ this.answers = new motivationTestAnswers;
+ this.categories = [];
+ this.currentCategoryIndex = 0;
+ this.currentQuestionIndex = 0;
+ this.overallQuestionsIndex = 0;
+ }
+ async createAsync(language = 'en') {
+ const motivationTest = new MotivationTest();
+ motivationTest.questions = await fetchTestData(language);
+ motivationTest.categories = Object.keys(motivationTest.questions);
+ return motivationTest;
+ }
+ totalQuestions() {
+ if (this.questions) {
+ return Object.values(this.questions).reduce((sum, questions) => sum + questions.length, 0);
+ }
+ else {
+ return 0;
+ }
+ }
+ currentCategory() {
+ if (this.questions) {
+ return String(this.categories[this.currentCategoryIndex]);
+ }
+ else {
+ return "";
+ }
+ }
+ addAnswer(answer) {
+ if (this.questions) {
+ this.answers.addAnswer(this.currentCategory(), answer);
+ if (this.currentQuestionIndex < (this.questions[this.currentCategory()]).length - 1) {
+ this.currentQuestionIndex++;
+ }
+ else {
+ this.currentQuestionIndex = 0;
+ this.currentCategoryIndex++;
+ }
+ this.overallQuestionsIndex++;
+ }
+ }
+ currentQuestion() {
+ if (this.questions) {
+ return this.questions[this.currentCategory()][this.currentQuestionIndex];
+ }
+ else {
+ return undefined;
+ }
+ }
+}
+export default MotivationTest;
+async function fetchTestData(language) {
+ const dataUrl = `/assets/js/data/motivation-test/motivation-test-questions-${language}.json`;
+ return fetch(dataUrl)
+ .then(response => response.json())
+ .then(data => {
+ let result = data[0];
+ return result;
+ });
+}
diff --git a/assets/js/abi.js b/assets/js/abi.js
new file mode 100644
index 00000000..2319576c
--- /dev/null
+++ b/assets/js/abi.js
@@ -0,0 +1,3 @@
+import MotivationTest from "./motivation-test-contract-abi.json";
+// const MotivationTest = import('./motivation-test-contract-abi.json');
+export const MOTIVATION_TEST_ABI = MotivationTest.abi;
diff --git a/assets/js/cryptoUser.js b/assets/js/cryptoUser.js
new file mode 100644
index 00000000..9c378041
--- /dev/null
+++ b/assets/js/cryptoUser.js
@@ -0,0 +1,112 @@
+export class CryptoUser {
+ constructor() {
+ this.address = null;
+ this.encryptedTestResults = [];
+ this.abi = null;
+ this.contractAddress = "0x438cFd691017711468fcE90c57907A7d637A5033";
+ }
+ async createAsync() {
+ this.abi = await fetchABI();
+ this.address = await connectWallet();
+ if (this.address) {
+ await this.readTestResults();
+ }
+ }
+ async writeTestResult(hash, amount) {
+ if (!this.address) {
+ console.log("Please connect wallet first.");
+ return;
+ }
+ if (!hash) {
+ console.log("Can't write null result to blockchain");
+ return;
+ }
+ if (!amount) {
+ console.log("Can't write zero value, sorry! We need to develop motivation test dapp :)");
+ return;
+ }
+ try {
+ const provider = new ethers.BrowserProvider(window.ethereum);
+ const signer = await provider.getSigner();
+ const contract = new ethers.Contract(this.contractAddress, this.abi, signer);
+ const tx = await contract.writeTestResult(hash, {
+ value: ethers.parseEther(amount),
+ });
+ await tx.wait();
+ console.log('Test result written:', hash);
+ }
+ catch (error) {
+ console.error('Error writing test result:', error);
+ }
+ }
+ async readTestResults(address) {
+ try {
+ // Use a read-only provider (e.g., Infura or Alchemy)
+ const provider = new ethers.JsonRpcProvider('https://sepolia.infura.io/v3/d3e6fd8a7c33469cb6c3fe729eca9d3d');
+ const contract = new ethers.Contract(this.contractAddress, this.abi, provider);
+ const addressToUse = address || this.address;
+ if (!addressToUse) {
+ throw new Error('No address provided or available');
+ }
+ this.encryptedTestResults = await contract.readTestResults(addressToUse);
+ return;
+ }
+ catch (error) {
+ console.error('Error reading test result:', error);
+ return;
+ }
+ }
+ async withdrawFunds() {
+ await fetchABI();
+ const provider = new ethers.BrowserProvider(window.ethereum);
+ const signer = await provider.getSigner();
+ const contract = new ethers.Contract(this.contractAddress, this.abi, signer);
+ try {
+ const owner = await contract.owner();
+ const signerAddress = await signer.getAddress();
+ if (signerAddress.toLowerCase() !== owner.toLowerCase()) {
+ throw new Error("Only the contract owner can withdraw funds");
+ }
+ const tx = await contract.withdrawFunds();
+ await tx.wait();
+ console.log('Funds withdrawn successfully');
+ }
+ catch (error) {
+ console.error('Error withdrawing funds:', error);
+ }
+ }
+ async checkContractBalance() {
+ const provider = new ethers.BrowserProvider(window.ethereum);
+ const balance = await provider.getBalance(this.contractAddress);
+ console.log(`Contract balance: ${ethers.formatEther(balance)} ETH`);
+ }
+}
+async function fetchABI() {
+ try {
+ const response = await fetch('/assets/js/motivation-test-contract-abi.json');
+ return await response.json();
+ }
+ catch (error) {
+ console.error('Error fetching ABI:', error);
+ }
+}
+async function connectWallet() {
+ if (window.ethereum) {
+ try {
+ await window.ethereum.request({ method: 'eth_requestAccounts' });
+ const provider = new ethers.BrowserProvider(window.ethereum);
+ const signer = await provider.getSigner();
+ const userAddress = await signer.getAddress();
+ console.log("Wallet connected, address:", userAddress);
+ return userAddress;
+ }
+ catch (error) {
+ console.error("Error connecting wallet:", error);
+ return null;
+ }
+ }
+ else {
+ console.log("Please install MetaMask!");
+ return null;
+ }
+}
diff --git a/assets/js/data/motivation-test/motivation-test-questions-en.json b/assets/js/data/motivation-test/motivation-test-questions-en.json
index fe3592da..24a1247f 100644
--- a/assets/js/data/motivation-test/motivation-test-questions-en.json
+++ b/assets/js/data/motivation-test/motivation-test-questions-en.json
@@ -4,89 +4,34 @@ swcache: true
---
[
{
- "language": "en",
- "curiosity": [
+ "autonomy": [
{
- "question": "How often do you find time to learn something new outside of work or study?",
- "low": "never",
- "high": "constantly"
- },
- {
- "question": "How interested are you in learning new topics, even if they are not related to your main activity?",
- "low": "not interested at all",
- "high": "very interested"
- },
- {
- "question": "How often do you participate in projects or events that go beyond your comfort zone?",
- "low": "never",
- "high": "always"
- },
- {
- "question": "How willing are you to spend time and effort seeking information that you don't know yet?",
- "low": "not willing",
- "high": "very willing"
- },
- {
- "question": "How often do you read books, articles, or watch videos on topics that were previously unfamiliar to you?",
- "low": "never",
- "high": "very often"
- }
- ],
- "honor": [
- {
- "question": "How important is it for you to be honest and fair in your actions?",
- "low": "not important at all",
- "high": "very important"
- },
- {
- "question": "How often do you feel pride in your achievements and actions?",
- "low": "never",
- "high": "always"
- },
- {
- "question": "How important is it for you to keep your word and fulfill promises?",
- "low": "not important",
- "high": "very important"
- },
- {
- "question": "How important is it for you that others perceive you as an honest and trustworthy person?",
- "low": "not important",
- "high": "very important"
- },
- {
- "question": "How often do you strive to do the right thing, even if it may be inconvenient or unpopular?",
- "low": "never",
- "high": "always"
- }
- ],
- "acceptance": [
- {
- "question": "How important is it for you that your achievements and efforts are noticed and appreciated by others?",
+ "question": "How important is it for you to have the freedom to choose methods and approaches to your work?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you strive to be recognized and respected in your team?",
+ "question": "How often do you strive to independently plan your work time and tasks?",
"low": "never",
"high": "always"
},
{
- "question": "How important is it for you to receive positive feedback and approval from colleagues and management?",
+ "question": "How important is it for you to work autonomously, without constant supervision from management?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to feel part of a team and be accepted by your peers?",
+ "question": "How important is it to you to have the freedom and independence to make decisions at work?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you that your opinion is considered when making collective decisions?",
+ "question": "How important is it to you to be able to determine your own ways of doing your work?",
"low": "not important",
"high": "very important"
}
],
- "mastery": [
+ "competence": [
{
"question": "How important is it for you to constantly improve your professional skills and knowledge?",
"low": "not important at all",
@@ -103,204 +48,177 @@ swcache: true
"high": "very important"
},
{
- "question": "How important is it for you to handle difficult tasks and solve complex problems at work?",
+ "question": "How important is it to you that the job allows you to utilize your skills and abilities to the fullest?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to achieve a high level of mastery in your professional activities?",
+ "question": "How important is it to you to feel capable and confident in doing your job?",
"low": "not important",
"high": "very important"
}
],
- "leadership": [
+ "relatedness": [
{
- "question": "How important is it for you to have the ability to make decisions that affect other people or the company?",
+ "question": "How important is it for you to feel part of a team or collective?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you strive to take on leadership positions and roles that allow you to manage a team?",
+ "question": "How often do you strive to establish and maintain good relationships with colleagues?",
"low": "never",
"high": "always"
},
{
- "question": "How important is it for you to have influence on the strategic development of the company or project?",
+ "question": "How important is it for you that there is a friendly and supportive atmosphere in the team?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to be recognized as a leader and respected by colleagues and subordinates?",
+ "question": "How important is it for you to receive support and understanding from colleagues and management?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have the authority to make changes and improvements to work processes?",
+ "question": "How important is it to you to be able to establish and maintain meaningful relationships with coworkers?",
"low": "not important",
"high": "very important"
}
],
- "freedom": [
+ "diversity_of_skills": [
{
- "question": "How important is it for you to have the freedom to choose methods and approaches to your work?",
+ "question": "How important is it to you that your job requires you to use a variety of skills and abilities?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you strive to independently plan your work time and tasks?",
- "low": "never",
- "high": "always"
- },
- {
- "question": "How important is it for you to work autonomously, without constant supervision from management?",
+ "question": "How important is it to you that the job involves a variety of tasks?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have the right to make independent decisions within your work?",
+ "question": "How important is it to you that the job allows you to develop new skills and abilities?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have a flexible work schedule and the ability to work remotely?",
- "low": "not important",
- "high": "very important"
- }
- ],
- "relatedness": [
- {
- "question": "How important is it for you to feel part of a team or collective?",
- "low": "not important at all",
- "high": "very important"
- },
- {
- "question": "How often do you strive to establish and maintain good relationships with colleagues?",
+ "question": "How often do you participate in projects or events that go beyond your comfort zone?",
"low": "never",
"high": "always"
},
{
- "question": "How important is it for you that there is a friendly and supportive atmosphere in the team?",
- "low": "not important",
- "high": "very important"
- },
- {
- "question": "How important is it for you to receive support and understanding from colleagues and management?",
- "low": "not important",
- "high": "very important"
- },
- {
- "question": "How often do you feel satisfaction from being able to help colleagues or contribute to the common cause?",
- "low": "never",
- "high": "very often"
+ "question": "How willing are you to spend time and effort seeking information that you don't know yet?",
+ "low": "not willing",
+ "high": "very willing"
}
],
- "order": [
+ "significance_of_the_task": [
{
- "question": "How important is it for you that your work process is clearly organized and structured?",
+ "question": "How important is it for you that the work has a significant impact on the organization and society?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you strive to have all tasks and projects thoroughly planned?",
- "low": "never",
- "high": "always"
+ "question": "How important is it for you that work is meaningful and satisfying?",
+ "low": "not important",
+ "high": "very important"
},
{
- "question": "How important is it for you to adhere to established rules and procedures at work?",
+ "question": "How important is it for you to know that your work contributes to important goals?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have a clear understanding of your duties and tasks?",
+ "question": "How important is it for you to achieve a high level of mastery in your professional activities?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to follow the work plan and schedule without deviations?",
+ "question": "How important is it for you to handle difficult tasks and solve complex problems at work?",
"low": "not important",
"high": "very important"
}
],
- "goal": [
+ "feedback": [
{
- "question": "How important is it for you to have a clear understanding of your goals and direction in life?",
+ "question": "How important is it to you to receive regular constructive feedback about your work?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you set specific goals for yourself and strive to achieve them?",
- "low": "never",
- "high": "always"
+ "question": "How important is it to you to know how well you are doing your job?",
+ "low": "not important",
+ "high": "very important"
},
{
- "question": "How important is it for you to have a clear understanding of what you are striving for in your career or personal life?",
+ "question": "How important is it to you that management provides you with timely and understandable feedback?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have a sense that your work has meaning and leads to the achievement of goals?",
+ "question": "How important is it for you to be recognized and respected in your team?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have a clear action plan to achieve your goals?",
+ "question": "How important is it for you to receive positive feedback and approval from colleagues and management?",
"low": "not important",
"high": "very important"
}
],
- "status": [
+ "task_identification": [
{
- "question": "How important is it for you to have a high status in society or in your professional field?",
+ "question": "How important is it to you that your job involves completing entire tasks rather than individual small parts?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How often do you strive to achieve a position or role that gives you a high status?",
- "low": "never",
- "high": "always"
- },
- {
- "question": "How important is it for you that others perceive you as a successful and respected person?",
+ "question": "How important is it to you to see the end result of your efforts?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to achieve recognition and prestige in your field of activity?",
+ "question": "How important is it to you to complete your work from start to finish?",
"low": "not important",
"high": "very important"
},
{
- "question": "How important is it for you to have a high social or professional position?",
+ "question": "How often do you strive to have all tasks and projects thoroughly planned?",
+ "low": "never",
+ "high": "always"
+ },
+ {
+ "question": "How important is it for you to have a clear understanding of your duties and tasks?",
"low": "not important",
"high": "very important"
}
],
- "comfort": [
+ "goals_and_objectives": [
{
- "question": "How important is it for you to feel comfortable and at ease in your surroundings?",
+ "question": "How important is it to you that your goals at work are clear and specific?",
"low": "not important at all",
"high": "very important"
},
{
- "question": "How important is it to you to avoid stressful situations and discomfort in your daily life?",
+ "question": "How often do you set specific goals for yourself and strive to achieve them?",
"low": "never",
"high": "always"
},
{
- "question": "How important is it for you to have convenient working conditions (comfortable workplace, good schedule, etc.)?",
+ "question": "How important is it for you to have a clear understanding of what you are striving for in your career or personal life?",
"low": "not important",
"high": "very important"
},
{
- "question": "How often do you feel satisfied that your life and work bring you comfort and pleasure?",
- "low": "never",
- "high": "very often"
+ "question": "How important is it for you to have a sense that your work has meaning and leads to the achievement of goals?",
+ "low": "not important",
+ "high": "very important"
},
{
- "question": "How important is it to you to be able to rest and relax after a day of work?",
+ "question": "How important is it to you that your goals at work are challenging but achievable?",
"low": "not important",
"high": "very important"
}
]
- }
-]
\ No newline at end of file
+ }
+]
diff --git a/assets/js/data/motivation-test/motivation-test-questions-ru.json b/assets/js/data/motivation-test/motivation-test-questions-ru.json
index 600fcb77..77a6a25d 100644
--- a/assets/js/data/motivation-test/motivation-test-questions-ru.json
+++ b/assets/js/data/motivation-test/motivation-test-questions-ru.json
@@ -4,7 +4,6 @@ swcache: true
---
[
{
- "language": "ru",
"curiosity": [
{
"question": "Как часто вы находите время, чтобы учиться чему-то новому вне работы или учебы?",
diff --git a/assets/js/motivation-test-contract-abi.json b/assets/js/motivation-test-contract-abi.json
new file mode 100644
index 00000000..ff44a2b7
--- /dev/null
+++ b/assets/js/motivation-test-contract-abi.json
@@ -0,0 +1,114 @@
+[
+ {
+ "inputs": [],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "FundsWithdrawn",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "user",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "string",
+ "name": "hash",
+ "type": "string"
+ }
+ ],
+ "name": "TestResultWritten",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "minimumFee",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "user",
+ "type": "address"
+ }
+ ],
+ "name": "readTestResults",
+ "outputs": [
+ {
+ "internalType": "string[]",
+ "name": "",
+ "type": "string[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "withdrawFunds",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "string",
+ "name": "hash",
+ "type": "string"
+ }
+ ],
+ "name": "writeTestResult",
+ "outputs": [],
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "stateMutability": "payable",
+ "type": "receive"
+ }
+]
\ No newline at end of file
diff --git a/assets/js/motivation-test.js b/assets/js/motivation-test.js
index d72d008a..05c9d3ed 100644
--- a/assets/js/motivation-test.js
+++ b/assets/js/motivation-test.js
@@ -1,27 +1,83 @@
-"use strict";
-let currentCategoryIndex = 0;
-let currentQuestionIndex = 0;
-let overallQuestionsIndex = 0;
-let answers = {};
-let categories = [];
-const secretKey = 'dont give up, keep trying, try it from the other side.';
+import MotivationTest from './motivationTestQuestions.js';
+import { CryptoUser } from './cryptoUser.js';
+import { motivationTestAnswers } from './motivationTestAnswers.js';
+import { renderChart } from './renderChart.js';
+let cryptoUser = new CryptoUser;
+let cryptoUser2 = new CryptoUser;
document.addEventListener('DOMContentLoaded', async () => {
+ await cryptoUser.createAsync();
const questionElement = document.getElementById('question');
const categoryElement = document.getElementById('category');
const circlesContainer = document.getElementById('circles-container');
- let testData = await fetchTestData();
- categories = Object.keys(testData).filter(key => key !== 'language');
- categories.forEach(category => answers[category] = []);
- const totalQuestions = Object.values(testData).reduce((sum, questions) => sum + questions.length, 0);
+ let testData = new MotivationTest();
+ testData = await testData.createAsync('en');
+ const totalQuestions = testData.totalQuestions();
const lowLabel = document.getElementById('low');
const highLabel = document.getElementById('high');
const nextBtn = document.getElementById('nextBtn');
const urlParams = new URLSearchParams(window.location.search);
let encryptedResult = urlParams.get('result');
+ const address = urlParams.get('address');
+ const index = parseInt(urlParams.get('index') || "-1");
+ const connectWalletBtn = document.getElementById('connectWalletBtn');
+ if (cryptoUser.address) {
+ try {
+ connectWalletBtn.textContent = cryptoUser.address;
+ if (cryptoUser.encryptedTestResults.length > 0) {
+ const resultsDivHtml = document.getElementById('results');
+ resultsDivHtml.style.display = 'block';
+ let htmlTextResutls = '';
+ cryptoUser.encryptedTestResults.forEach((encryptedResult, index) => {
+ let testAnswers = new motivationTestAnswers;
+ testAnswers.decrypt(encryptedResult);
+ if (testAnswers.isValid()) {
+ htmlTextResutls += `