Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
quiz_audit_management
/
resources
/
js
/
components
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
CalculationsPage.vue
| Size :
7.56
KB
Copy
<template> <div class="content-step calculation-page"> <div v-if="!loaded"> <!-- <div class="loading"> Mai ai putina rabdare <span></span> </div> --> </div> <div v-else> <div class="question"> <h1 class="title"> <span class="question"> Rezultatul Auditului TBF </span> </h1> </div> <div class="description"> Mai jos găsești scorul pe care l-ai realizat, cum te compari cu alți antreprenori și acțiunile pe care ar trebui să le implementezi pentru rectificarea problemelor de management identificate. </div> <div class="results-cards"> <div class="card"> <div class="small-text">Scor total</div> <div class="points">{{ points | numeral('0,0') }}</div> <div class="small-sep"></div> <div class="desc">din totalul de 2550 puncte</div> </div> <div class="card last"> <div class="small-text">Te afli pe locul</div> <div class="points">{{ points_position }}</div> <div class="small-sep"></div> <div class="desc">din {{ totalPeopleQuiz }} scoruri distincte realizate de {{ application_no }} antreprenori</div> </div> </div> <hr class="sep"> <div class="question"> <h1 class="title" style="margin-top: 20px;margin-bottom: 50px;"> <span class="question"> Acțiuni de implementat: </span> </h1> </div> <div class="accordion" style="margin-bottom: 80px;"> <div v-for="(answer, index) in answers" v-html="answer" @click="showBox(index)" :id="'boxno-'+index" class="boxno"> </div> </div> <button key="reset-quiz" class="mb-5 mx-auto w-100" style="background: transparent; border: 0; text-decoration: underline; font-size: 14px;" @click="resetQuizDev" v-if="reset_button">RESET QUIZ</button> <!-- <div class="contact" v-if="source != 'admin'"> <contact-page></contact-page> </div> --> </div> </div> </template> <script> import Check from "./icons/Check"; import NextIcon from "./icons/Next"; import ArrowLeft from "./icons/ArrowLeft"; import ContactPage from './ContactPage' export default { data() { return { loaded: false, active_answer: 'nothing', answer_selected: 'nothing', title_question: '', showPreviousBtn: true, html_subtitle: '', // dynamic calculation values answers: {}, points: 0, application_no: 1321, points_position: 0, totalPeopleQuiz: 0, } }, components: { Check, NextIcon, ArrowLeft, ContactPage }, computed:{ title: function(){ let quiz_obj = JSON.parse(localStorage.getItem('quiz')) var new_title = ''; var html_subtitle = ''; var regex_get_value = /(?:\#)([^#]+)(?=#|$)/; var title_escaped = ''; var new_title_v1 = ''; var scope = this; this.question.title.every((element) => { if(element.condition == 'true'){ if(regex_get_value.exec(element.title)){ title_escaped = eval(regex_get_value.exec(element.title)[1]); } new_title_v1 = element.title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; this.html_subtitle = element.subtitle html_subtitle = $.parseHTML(html_subtitle); return false; } if(eval(element.condition)){ if(regex_get_value.exec(element.title)){ title_escaped = eval(regex_get_value.exec(element.title)[1]); } new_title_v1 = element.title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; this.html_subtitle = element.subtitle html_subtitle = $.parseHTML(html_subtitle); return false; } return true; }) function has_key(string){ try{ return eval(string) }catch{ return null } } return new_title; } }, mounted() { var entity_json = ''; var session_token = ''; if(this.session_token != '' && this.source == 'admin' ){ entity_json = this.entity_json; session_token = this.session_token; }else{ entity_json = localStorage.getItem('quiz'); session_token = localStorage.getItem('sessionId'); } axios.post('/finalCalculation', { entity_json: entity_json, session_token: session_token }).then((result)=>{ this.answers = result.data.answers; this.points = result.data.points; this.points_position = result.data.points_position; this.application_no = result.data.application_no; this.totalPeopleQuiz = result.data.totalPeopleQuiz; this.loaded = true; }); }, watch: { }, props: { question: Object, goThanks: Function, reset_button: Boolean, resetQuizDev: Function, name_referral: String, entity_json: Object, session_token: String, source: String }, methods: { setActive(key, value){ this.active_answer = key; axios.post('/quizFeedback',{ session_token: localStorage.getItem('sessionId'), feedback: value }).then(()=>{ setTimeout(() => { setTimeout(() => { $('.answer-button.active').removeClass('active'); }, 50); this.goThanks(this.question.next_step) }, 500); }) }, back_to_previous(){ this.previousSet(); }, showBox(item){ $('#boxno-'+item).toggleClass('active'); } } } </script>
Back