HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/testingff/public_html/fdfctr/wp-content/plugins/quiz-cat/includes/quiz/quiz.min.js
jQuery(document).ready(function($){function isIE(){var e=window.navigator.userAgent;if(e.indexOf("MSIE ")>0)return!0;return e.indexOf("Trident/")>0}function isOldAndroidVersion(){var e=navigator.userAgent.toLowerCase().match(/android\s([0-9\.]*)/);return!!e&&parseFloat(e[1])<5}function oldBrowserFix(e){$(e).find("#fca_qc_back_container").css("backface-visibility","visible"),$(e).find("#fca_qc_back_container").css("transform","none"),$(e).find("#fca_qc_back_container").hide(),isIE()&&(svg_square='<svg xmlns="http://www.w3.org/2000/svg" class="fca_qc_rectancle" width="26" height="26"><rect class="fca_qc_checkbox" width="26" height="26"></rect></svg>')}function loadQuizzes(){$(".fca_qc_quiz").each(function(index){var thisId=get_quiz_id(this);thisId&&(quizzes[thisId]=eval("quizData_"+thisId),quizzes[thisId].selector=this,default_img=quizzes[thisId].default_img)}),$.each(quizzes,function(e,t){quizzes[e].questions=quizzes[e].questions.filter(function(e){return 0!==e.answers.filter(function(e){return e.answer||e.img}).length})}),$.each(quizzes,function(e){"on"===quizzes[e].quiz_settings.shuffle_questions&&(quizzes[e].questions=shuffleArray(quizzes[e].questions))}),$.each(quizzes,function(e){"on"===quizzes[e].quiz_settings.autostart_quiz&&startQuiz(quizzes[e])})}function preloadImages(){$.each(quizzes,function(e,t){quizzes[e].questions[0]&&lazyLoadQuestion(quizzes[e].questions[0])})}function lazyLoadResults(e){e.hasOwnProperty("quiz_results")&&$.each(e.quiz_results,function(t){e.quiz_results[t].hasOwnProperty("img")&&lazyLoadImage(e.quiz_results[t].img)})}function lazyLoadImage(e){if(""!==e&&void 0!==e&&"string"==typeof e){(new Image).src=e}}function lazyLoadQuestion(e){e.hasOwnProperty("img")&&lazyLoadImage(e.img),e.hasOwnProperty("answers")&&$.each(e.answers,function(t){e.answers[t].hasOwnProperty("img")&&lazyLoadImage(e.answers[t].img)})}function startQuiz(e){usingOldBrowser&&oldBrowserFix(e.selector),fix_hover(e),e.currentQuestion=0,e.score=0,e.responses=[],e.questionCount=e.questions.length,""===e.quiz_settings.hide_answers?e.hideAnswers="after":"on"===e.quiz_settings.hide_answers?e.hideAnswers="end":e.hideAnswers=e.quiz_settings.hide_answers,$(e.selector).find(".fca_qc_quiz_title").hide(),$(e.selector).find(".fca_qc_quiz_description").hide(),$(e.selector).find(".fca_qc_quiz_description_img").hide(),$(e.selector).find(".fca_qc_start_button").hide(),$(e.selector).find(".fca_qc_quiz_div").show(),$(e.selector).find(".fca_qc_quiz_footer").show(),$(e.selector).find(".flip-container").show(),$(e.selector).find(".fca_qc_question_count").html("1/"+e.questionCount),showQuestion(e)}function fca_qc_push_timeout_question(e,t){e.quiz_settings.timer_limit;var i=e.timeout_string,s=$(this).closest("#fca_qc_answer_container").data("id");if(e.responses.length!==e.questionCount){var s=t||$(this).closest("#fca_qc_answer_container").data("id"),n={answer:i,isCorrect:!1,correctAnswer:get_correct_answer_html(e),question:$(this).siblings("#fca_qc_question").html(),id:s,response:0};if("on"===e.quiz_settings.explanations){var c=e.questions[e.currentQuestion-1].answers.filter(function(e){return e.hasOwnProperty("hint")});c.length&&(n.hint=c[0].hint)}e.responses.push(n),add_response(e.ajaxurl,e.nonce,e.quiz_id,s,null)}}function fca_qc_push_timeout_quiz(e){for(var t=e.currentQuestion-1;t<e.questionCount;t++)fca_qc_push_timeout_question(e,t)}function fca_qc_update_timer(e,t){var i=quizzes[get_quiz_id($("#fca_qc_quiz_"+e))];if(Date.now()<t){var s=t-Date.now(),n=Math.floor(s/36e5);s-=36e5*n,i.time_remaining=s;var c=Math.floor(s/6e4),r=((s-=6e4*c)/1e3).toFixed(2);n&&$(i.selector).find(".fca_qc_timer_hours").html(n+" :"),$(i.selector).find(".fca_qc_timer_minutes").html(c+" :"),$(i.selector).find(".fca_qc_timer_seconds").html(r)}else $("#fca_qc_quiz_"+e).data("endDate",""),i.time_remaining=0,$(i.selector).find(".fca_qc_timer_minutes").html("0 :"),$(i.selector).find(".fca_qc_timer_seconds").html("0.00"),"after"===i.hideAnswers&&"mc"===i.quiz_settings.quiz_type?"question"===i.quiz_settings.timer_mode?(fca_qc_push_timeout_question(i),$(i.selector).find("#fca_qc_your_answer").html(addQuizImg($(this).children(".fca_qc_quiz_answer_img").attr("src"))+i.timeout_string),fca_qc_hide_answers_after(i)):(fca_qc_push_timeout_quiz(i),fca_qc_show_timeout_screen(i)):($(i.selector).find("#fca_qc_your_answer").html(addQuizImg($(this).children(".fca_qc_quiz_answer_img").attr("src"))+i.timeout_string),fca_qc_show_timeout_screen(i),i.currentQuestion<i.questionCount&&"question"===i.quiz_settings.timer_mode?fca_qc_push_timeout_question(i):fca_qc_push_timeout_quiz(i))}function fca_qc_start_timer(e){timer_limit=e.quiz_settings.timer_limit;var t=Date.now()+1e3*timer_limit;$(e.selector).data("endDate",t),void 0===fcaQcInterval&&(fcaQcInterval=setInterval(function(){var e=0;for(var t in quizzes){var i=$("#fca_qc_quiz_"+t).data("endDate");i&&(fca_qc_update_timer(t,i),e++)}e||(clearInterval(fcaQcInterval),fcaQcInterval=void 0)},10))}function get_quiz_id(e){var t=$(e).attr("id");return!!t&&t.replace(/\D+/g,"")}function fca_qc_show_timeout_screen(e){var t=e.timeout_string;usingOldBrowser?($(e.selector).find("#fca_qc_answer_container").hide(),$(e.selector).find("#fca_qc_back_container").show()):$(e.selector).find(".fca_qc_quiz_div").addClass("flip"),$(e.selector).find("#fca_qc_question_back").hide(),$(e.selector).find("#fca_qc_back_response_p").hide(),$(e.selector).find("#fca_qc_correct_answer_p").hide(),$(e.selector).find("#fca_qc_back_container").addClass("wrong-answer"),$(e.selector).find("#fca_qc_question_right_or_wrong").html(t),scale_flip_box_back(e.selector)}function fca_qc_hide_answers_after(e,t){var i=get_correct_answer_html(e);if($(e.selector).find("#fca_qc_correct_answer").html(i),"on"===e.quiz_settings.explanations){var s=e.questions[e.currentQuestion-1].answers.filter(function(e){return e.hasOwnProperty("hint")});s.length?($(e.selector).find("#fca_qc_hint_p").show(),$(e.selector).find("#fca_qc_hint_p").html(s[0].hint.replace(/\n/g,"<br />"))):$(e.selector).find("#fca_qc_hint_p").html("")}usingOldBrowser?($(e.selector).find("#fca_qc_answer_container").hide(),$(e.selector).find("#fca_qc_back_container").show()):$(e.selector).find(".fca_qc_quiz_div").addClass("flip"),$(e.selector).find("#fca_qc_back_container").removeClass("correct-answer"),$(e.selector).find("#fca_qc_back_container").removeClass("wrong-answer"),t?($(e.selector).find("#fca_qc_back_container").addClass("correct-answer"),$(e.selector).find("#fca_qc_question_right_or_wrong").html(e.correct_string),$(e.selector).find("#fca_qc_correct_answer_p").hide()):($(e.selector).find("#fca_qc_back_container").addClass("wrong-answer"),$(e.selector).find("#fca_qc_question_right_or_wrong").html(e.wrong_string),$(e.selector).find("#fca_qc_correct_answer_p").show()),scale_flip_box_back(e.selector)}function showQuestion(e,t){if(e.quiz_settings.disable_scroll||"on"===e.quiz_settings.autostart_quiz&&0===e.currentQuestion||scrollQuizInToView(e.selector),e.currentQuestion<e.questionCount){"question"===e.quiz_settings.timer_mode&&0!==e.currentQuestion&&fca_qc_start_timer(e),$(e.selector).find(".fca_qc_question_count").html(e.currentQuestion+1+"/"+e.questionCount);var i=e.questions[e.currentQuestion].question.replace(/\n/g,"<br />");$(e.selector).find("#fca_qc_question").html(i),$(e.selector).find("#fca_qc_question_back").html(i);var s=e.questions[e.currentQuestion].img;if($(e.selector).find("#fca_qc_answer_container").find(".fca_qc_quiz_question_img").attr("src",s),$(e.selector).find("#fca_qc_back_container").find(".fca_qc_quiz_question_img").attr("src",s),$(e.selector).find("#fca_qc_answer_container").data("id",e.questions[e.currentQuestion].id),e.questions[e.currentQuestion].correct)n=e.questions[e.currentQuestion].correct-1;else var n=0;if("mc"===e.quiz_settings.quiz_type||""===e.quiz_settings.quiz_type)var c=e.questions[e.currentQuestion].answers[n];if("off"!==quizzes[e.quiz_id].quiz_settings.fixed_answers&&quizzes[e.quiz_id].quiz_settings.fixed_answers)r=e.questions[e.currentQuestion].answers;else var r=shuffleArray(e.questions[e.currentQuestion].answers);e.currentQuestion+1<e.questionCount?lazyLoadQuestion(e.questions[e.currentQuestion+1]):lazyLoadResults(e),$(e.selector).find(".fca_qc_answer_div").hide();for(var a=0;a<r.length;a++){var _=void 0!==r[a].img&&""!==r[a].img,o=void 0!==r[a].answer&&""!==r[a].answer;(_||o)&&("mc"!==e.quiz_settings.quiz_type&&""!==e.quiz_settings.quiz_type||r[a].answer!==c.answer||r[a].img!==c.img||(e.currentAnswer=$(e.selector).find(".fca_qc_answer_div").eq(a).attr("data-question")),"pt"!==e.quiz_settings.quiz_type&&"wq"!==e.quiz_settings.quiz_type||$(e.selector).find(".fca_qc_answer_div").eq(a).data("results",r[a].results),$(e.selector).find(".fca_qc_answer_div").eq(a).find(".fca_qc_quiz_answer_img").attr("src",r[a].img),$(e.selector).find(".fca_qc_answer_div").eq(a).find(".fca_qc_answer_span").html(svg_square+r[a].answer.replace(/\n/g,"<br />")),$(e.selector).find(".fca_qc_answer_div").eq(a).data("id",r[a].id),t?$(e.selector).find(".fca_qc_answer_div").eq(a).fadeIn():$(e.selector).find(".fca_qc_answer_div").eq(a).show())}$(e.selector).find("#fca_qc_answer_container").waitForImages(function(){maybe_add_quarter_class(e.selector),scale_flip_box_question(e.selector)}),e.currentQuestion=e.currentQuestion+1}else e.time_remaining=($("#fca_qc_quiz_"+e.quiz_id).data("endDate")-Date.now())/1e3,endTest(e)}function maxHeightOfElementSet(e){var t=0;return $.each(e,function(i){e.eq(i).outerHeight()>t&&(t=e.eq(i).outerHeight())}),t}function scale_flip_box_question(e){var t=$(e).find("#fca_qc_question").outerHeight(!0);t+=$(e).find(".fca_qc_quiz_question_img").outerHeight(!0);var i=0,s=0;$(e).find(".fca_qc_answer_div:visible").eq(0).hasClass("fca-qc-twoup")?(s=maxHeightOfElementSet($(e).find(".fca_qc_answer_div:visible")),i=$(e).find(".fca_qc_answer_div:visible").length,i=Math.floor(i/2)+i%2,t+=s*i):$(e).find(".fca_qc_answer_div:visible").eq(0).hasClass("fca-qc-threeup")?(s=maxHeightOfElementSet($(e).find(".fca_qc_answer_div:visible")),i=$(e).find(".fca_qc_answer_div:visible").length,t+=s*(i/=3)):$(e).find(".fca_qc_answer_div:visible").each(function(){t+=$(this).outerHeight(!0)}),t<200&&(t=200),$(e).find(".fca_qc_quiz_footer").show(),$(e).find(".fca_qc_quiz_div, #fca_qc_answer_container, #fca_qc_back_container").outerHeight(t)}function scale_flip_box_back(e){var t=0;$(e).find("#fca_qc_back_container").children().each(function(){$(this).is(":visible")&&(t+=$(this).outerHeight(!0))}),(t+=35)<200&&(t=200),$(e).find(".fca_qc_quiz_footer").hide(),$(e).find(".fca_qc_quiz_div, #fca_qc_answer_container, #fca_qc_back_container").height(t)}function maybe_add_quarter_class(e){$(e).find(".fca_qc_answer_div").height("auto"),$(e).find(".fca_qc_answer_div").removeClass("fca-qc-twoup fca-qc-threeup"),$(e).find(".fca_qc_quiz_answer_img").css("marginBottom",0);var t=!0,i=0;if($(e).find(".fca_qc_answer_div:visible").each(function(){if(i++,""===$(this).find(".fca_qc_quiz_answer_img").attr("src")||!t)return t=!1,!1}),t){var s="fca-qc-twoup";i%3==0&&0===$(e).find(".fca_qc_mobile_check:visible").length&&(s="fca-qc-threeup"),$(e).find(".fca_qc_answer_div").addClass(s);var n=maxHeightOfElementSet($(e).find(".fca_qc_quiz_answer_img:visible"));n>200&&(n=200),$(e).find(".fca_qc_quiz_answer_img:visible").each(function(){$(this).css("marginBottom",n-$(this).height()+10+"px")});var c=maxHeightOfElementSet($(e).find(".fca_qc_answer_div:visible"));return $(e).find(".fca_qc_answer_div:visible").outerHeight(c),!0}return!1}function get_time_taken(e){var t=e.quiz_settings.timer_limit,i=e.time_taken_string;return e.time_remaining?i+" "+(t-e.time_remaining).toFixed(2)+"s":i+" "+timer_limit+"s ("+e.timeout_string+")"}function get_result(e){if(!e.quiz_results)return!1;if("pt"===e.quiz_settings.quiz_type){var t=[],i=-1;return $.each(e.quiz_results,function(e,t){t.hasOwnProperty("score")&&t.score>i&&(i=t.score)}),$.each(e.quiz_results,function(e,s){s.hasOwnProperty("score")&&s.score===i&&t.push(s)}),0===t.length&&(t=e.quiz_results),t[Math.floor(Math.random()*t.length)]}if("wq"===e.quiz_settings.quiz_type)for(s=0;s<e.quiz_results.length;s++)if(e.quiz_results[s].min<=e.score&&e.quiz_results[s].max>=e.score)return e.quiz_results[s];if("mc"===e.quiz_settings.quiz_type||""===e.quiz_settings.quiz_type)for(var s=0;s<e.quiz_results.length;s++)if(e.quiz_results[s].min<=e.score&&e.quiz_results[s].max>=e.score)return e.quiz_results[s];return!1}function show_responses(e){for(var t,i=0;i<e.questions.length;i++)t="",e.responses[i].isCorrect?t+="<div class='fca_qc_question_response_item correct-answer'>":t+="<div class='fca_qc_question_response_item wrong-answer'>",t+="<p class='fca_qc_question_response_question'>"+(i+1)+". "+e.questions[i].question+"</p>",e.questions[i].img&&(t+="<img class='fca_qc_quiz_question_img' src='"+e.questions[i].img+"'>"),t+="<p class='fca_qc_question_response_response'><span class='fca_qc_bold'>"+e.your_answer_string+" </span>"+e.responses[i].answer+"</p>",t+="<p class='fca_qc_question_response_correct_answer'><span class='fca_qc_bold'>"+e.correct_answer_string+" </span>"+e.responses[i].correctAnswer+"</p>",e.responses[i].hasOwnProperty("hint")&&(t+="<p class='fca_qc_question_response_hint'>"+e.responses[i].hint+"</p>"),t+="</div>",$(e.selector).find(".fca_qc_insert_response_above").before(t);$(e.selector).find(".fca_qc_your_answer_container").show()}function endTest(e){if($(e.selector).find(".fca_qc_quiz_footer").hide(),$(e.selector).find(".fca_qc_quiz_div").hide(),"mc"===e.quiz_settings.quiz_type||""===e.quiz_settings.quiz_type){var t=scoreString.replace("{{SCORE_CORRECT}}",e.score);t=t.replace("{{SCORE_TOTAL}}",e.questionCount),$(e.selector).find(".fca_qc_score_text").html(t)}"pt"!==e.quiz_settings.quiz_type&&"wq"!==e.quiz_settings.quiz_type||$(e.selector).find(".fca_qc_score_text").hide();var i=get_result(e);i&&($(e.selector).find(".fca_qc_score_title").html(i.title),"quiz"===e.quiz_settings.timer_mode&&$(e.selector).find(".fca_qc_score_time").html(get_time_taken(e)),$(e.selector).find(".fca_qc_score_img").attr("src",i.img),$(e.selector).find(".fca_qc_score_desc").html(i.desc.replace(/\n/g,"<br />"))),"on"===e.optin_settings.capture_emails?show_optins(e,i):show_sharing_and_result_screen(e,i)}function show_optins(e,t){$(e.selector).find(".fca_qc_optin_input, .fca-qc-gdpr-consent").not(".tooltipstered").tooltipster({trigger:"custom",maxWidth:240,theme:["tooltipster-borderless","tooltipster-quiz-cat"]}),$(e.selector).find(".tooltipstered").tooltipster("close"),$(e.selector).find(".fca_qc_optin_container").show(),$(e.selector).find(".fca_qc_optin_input").first().focus(),$(e.selector).find(".fca_qc_skip_email_button").on("click",function(){$(e.selector).find(".fca_qc_optin_container").hide(),$(e.selector).find(".tooltipstered").tooltipster("close"),show_sharing_and_result_screen(e,t)}),$(e.selector).find(".fca_qc_submit_email_button").on("click",function(){var i=$(e.selector).find("#fca_qc_email_input").val(),s=$(e.selector).find("#fca_qc_name_input").val(),n=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(i),c=""!==s||0===$(e.selector).find("#fca_qc_name_input").length;if($(e.selector).find(".fca_qc_optin_input").removeClass("fca_qc_invalid"),e.selector.offsetWidth=e.selector.offsetWidth,n&&c){$(e.selector).find(".tooltipstered").tooltipster("close");if(e.gdpr_checkbox){var r=$(e.selector).find(".fca-qc-gdpr-consent:visible");if(0==r.length)return $(e.selector).find(".fca-qc-gdpr").show(),$(e.selector).find(".fca_qc_optin_input").hide(),!1;if(0==r.prop("checked"))return r.tooltipster("open"),!1;!0}$(document).unbind("keypress"),$(e.selector).find(".tooltipstered").tooltipster("close"),e.user={name:s,email:i},add_to_mailing_list(e,i,s,t),$(e.selector).find(".fca_qc_optin_container").hide(),show_sharing_and_result_screen(e,t)}else n?($(e.selector).find("#fca_qc_email_input").tooltipster("close"),$(e.selector).find("#fca_qc_email_input").removeClass("fca_qc_invalid")):($(e.selector).find("#fca_qc_email_input").tooltipster("open"),$(e.selector).find("#fca_qc_email_input").addClass("fca_qc_invalid")),c?($(e.selector).find("#fca_qc_name_input").tooltipster("close"),$(e.selector).find("#fca_qc_name_input").removeClass("fca_qc_invalid")):($(e.selector).find("#fca_qc_name_input").tooltipster("open"),$(e.selector).find("#fca_qc_name_input").addClass("fca_qc_invalid"))}),0===$(e.selector).find(".fca_qc_skip_email_button").length&&0===$(e.selector).find(".fca_qc_submit_email_button").length?show_sharing_and_result_screen(e,t):$(document).keypress(function(t){if(13===t.which)return $(e.selector).find(".fca_qc_submit_email_button").click(),!1})}function add_to_mailing_list(e,t,i,s){if(fcaQcData.debug&&console.log(s),-1!==optins.indexOf(e.quiz_id))return fcaQcData.debug&&console.log("already opted in for this quiz! woop"),!1;optins.push(e.quiz_id);var n=jstz.determine();$.ajax({url:e.ajaxurl,type:"POST",data:{nonce:e.nonce,post_id:e.quiz_id,action:"fca_qc_add_to_mailing_list",email:t,name:i,result:get_result_text(e,s),tags:s.tags,groups:s.groups,timezone:n.name()}}).done(function(e){fcaQcData.debug&&console.log(e)})}function add_activity(e,t,i,s){if(0==fcaQcData.analytics)return!1;if("shares"===s){if(-1!==shared.indexOf(i))return fcaQcData.debug&&console.log("already shared this quiz! woop"),!1;shared.push(i)}else if("completions"===s){if(-1!==completed.indexOf(i))return fcaQcData.debug&&console.log("already completed this quiz! woop"),!1;completed.push(i)}$.ajax({url:e,type:"POST",data:{nonce:t,quiz_id:i,action:"fca_qc_activity",type:s}}).done(function(e){fcaQcData.debug&&console.log(e)})}function add_response(e,t,i,s,n){if(0==fcaQcData.analytics)return!1;$.ajax({url:e,type:"POST",data:{nonce:t,quiz_id:i,question:s,response:n,action:"fca_qc_add_response_ajax"}}).done(function(e){fcaQcData.debug&&console.log(e)})}function send_responses(e,t){var i="",s="",n="",c="unknown";if(0==fcaQcData.analytics)return!1;if(e.gdpr_checkbox){c=!!$(e.selector).find(".fca-qc-gdpr-consent").prop("checked")}e.hasOwnProperty("user")&&(i=e.user.name,s=e.user.email),n=t.hasOwnProperty("id")?t.id:e.score,$.ajax({url:e.ajaxurl,type:"POST",data:{nonce:e.nonce,quiz_id:e.quiz_id,name:i,email:s,gdpr_consent:c,result:n,result_text:get_result_text(e,t),responses:e.responses,action:"fca_qc_send_responses_ajax"}}).done(function(e){fcaQcData.debug&&console.log(e)})}function restart_quiz(e){location.href=location.origin+location.pathname+location.search+"#"+e.selector.id,location.reload(),location.href=location.origin+location.pathname+location.search+"#"+e.selector.id}function get_result_text(e,t){var i="";return t.hasOwnProperty("title")&&(i=t.title),"mc"!==e.quiz_settings.quiz_type&&""!==e.quiz_settings.quiz_type||(i=i?e.score+"/"+e.questionCount+": "+t.title:e.score+"/"+e.questionCount),i}function show_sharing_and_result_screen(e,t){send_responses(e,t),"redirect"===e.quiz_settings.result_mode?setTimeout(function(){window.location.href=t.url},1e3):("on"===e.quiz_settings.restart_button&&$(e.selector).find("#fca_qc_restart_button").on("click",function(){restart_quiz(e),$(this).hide()}).show("fast"),"end"===e.hideAnswers&&show_responses(e),"on"===e.quiz_settings.show_sharing&&show_sharing(e,t),$(e.selector).find(".fca_qc_score_container").show())}function get_correct_answer_html(e){var t="",i="";return $(e.selector).find(".fca_qc_answer_div").each(function(){$(this).attr("data-question")===e.currentAnswer&&(t=addQuizImg($(this).find(".fca_qc_quiz_answer_img").attr("src")),i=$(this).find(".fca_qc_answer_span").html().replace(svg_square,""))}),t+i}function fix_hover(e){$(e.selector).find(".fca_qc_answer_div").hover(function(e){$(this).addClass("fakehover"),$(this).children("span").addClass("fakehover")},function(e){$(this).removeClass("fakehover"),$(this).children("span").removeClass("fakehover")})}function show_sharing(e,t){$(e.selector).find(".fca_qc_social_share").show("fast");var i=$(e.selector).find(".fca_qc_score_img").attr("src");""===i&&(i=$(e.selector).find(".fca_qc_quiz_description_img").attr("src")),""===i&&(i=default_img);var s=$(e.selector).find("#fca_qc_share_link_facebook");1===s.length&&(0==t?s.prop("href",s.prop("href")+"0"+encodeURIComponent("&fca_qc_title="+get_result_text(e,t))):s.prop("href",s.prop("href")+e.quiz_results.indexOf(t)+encodeURIComponent("&fca_qc_title="+get_result_text(e,t))));var n=$(e.selector).find("#fca_qc_share_link_twitter");1===n.length&&(n.data("sharestring",encodeURIComponent(n.data("sharestring").replace("{{MY_QUIZ_RESULT}}",get_result_text(e,t)))),n.prop("href",n.prop("href")+encodeURIComponent("&fca_qc_title="+get_result_text(e,t).replace(/ /g,"+"))+"&text="+n.data("sharestring")));var c=$(e.selector).find("#fca_qc_share_link_email");1===c.length&&encode_share_link(c,get_result_text(e,t)),iOS&&c.hide();var r=$(e.selector).find("#fca_qc_share_link_pinterest");1===r.length&&(encode_share_link(r,get_result_text(e,t)),r.prop("href",r.prop("href")+"&media="+i)),$(e.selector).find(".fca_qc_share_link").on("click",function(t){t.preventDefault();var i=$(this).prop("href");window.open(i,"_blank","resizable=yes,scrollbars=yes,titlebar=yes, width=560, height=443, top=100, left=50"),add_activity(e.ajaxurl,e.nonce,e.quiz_id,"shares")})}function encode_share_link(e,t){var i=encodeURIComponent(e.data("sharestring").replace("{{MY_QUIZ_RESULT}}",t)),s=e.prop("href");e.prop("href",s+i)}function shuffleArray(e){for(var t=e.length-1;t>0;t--){var i=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[i],e[i]=s}return e}function addQuizImg(e){return e&&""!==e&&"string"==typeof e?"<img class='fca_qc_quiz_answer_img' src='"+e+"'>":""}function scrollQuizInToView(e){var t=$(e).offset().top+-100;t<0&&(t=0),$("html, body").animate({scrollTop:t},300)}function debounce(e,t,i){var s;return function(){var n=this,c=arguments,r=i&&!s;clearTimeout(s),s=setTimeout(function(){s=null,i||e.apply(n,c)},t),r&&e.apply(n,c)}}var usingOldBrowser=isIE()||isOldAndroidVersion(),iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,scoreString=$(".fca_qc_score_text").first().html(),svg_square='<svg xmlns="http://www.w3.org/2000/svg" class="fca_qc_rectancle" width="26" height="26"><rect class="fca_qc_checkbox" width="26" height="26"></rect></svg>',quizzes={},fcaQcInterval,default_img="";loadQuizzes(),fcaQcData.debug&&console.log(quizzes),preloadImages(),$(".fca_qc_start_button").on("click",function(){var e=quizzes[get_quiz_id($(this).closest(".fca_qc_quiz"))];startQuiz(e),"off"!==e.quiz_settings.timer_mode&&fca_qc_start_timer(e)}),$(".fca_qc_next_question").on("click",function(){var e=quizzes[get_quiz_id($(this).closest(".fca_qc_quiz"))];if($(e.selector).find("#fca_qc_your_answer").html(""),usingOldBrowser?($(e.selector).find("#fca_qc_answer_container").show(),$(e.selector).find("#fca_qc_back_container").hide()):($(e.selector).find("#fca_qc_hint_p").hide(),$(e.selector).find(".fca_qc_quiz_div").removeClass("flip")),"quiz"===e.quiz_settings.timer_mode&&!e.time_remaining)return e.time_remaining=0,void endTest(e);showQuestion(e)}),$(".fca_qc_answer_div").on("click",function(){var e=quizzes[get_quiz_id($(this).closest(".fca_qc_quiz"))];"question"===e.quiz_settings.timer_mode&&$("#fca_qc_quiz_"+e.quiz_id).data("endDate",""),$(".fakehover").removeClass("fakehover");var t=$(this).closest("#fca_qc_answer_container").data("id"),i=$(this).data("id"),s=!1;if(1===e.currentQuestion&&add_activity(e.ajaxurl,e.nonce,e.quiz_id,"starts"),"wq"===e.quiz_settings.quiz_type){var n=parseInt(e.questions[e.currentQuestion-1].answers.filter(function(e){return e.id===i})[0].points);isNaN(n)||(e.score=parseInt(e.score)+n)}else $(this).attr("data-question")===e.currentAnswer&&(e.score=e.score+1,s=!0);var c={answer:addQuizImg($(this).children(".fca_qc_quiz_answer_img").attr("src"))+$(this).children(".fca_qc_answer_span").html().replace(svg_square,""),answer:addQuizImg($(this).children(".fca_qc_quiz_answer_img").attr("src"))+$(this).children(".fca_qc_answer_span").html().replace(svg_square,""),isCorrect:s,correctAnswer:get_correct_answer_html(e),question:$(this).siblings("#fca_qc_question").html(),id:t,response:i};if("on"===e.quiz_settings.explanations){var r=e.questions[e.currentQuestion-1].answers.filter(function(e){return e.hasOwnProperty("hint")});r.length&&(c.hint=r[0].hint)}e.responses.push(c),add_response(e.ajaxurl,e.nonce,e.quiz_id,t,i),"pt"===e.quiz_settings.quiz_type?($.each($(this).data("results"),function(t,i){$.each(e.quiz_results,function(e,t){i===t.id&&(t.hasOwnProperty("score")?t.score=t.score+1:t.score=1)})}),showQuestion(e,!0)):"wq"===e.quiz_settings.quiz_type?($.each($(this).data("results"),function(t,i){$.each(e.quiz_results,function(e,t){i===t.id&&(t.hasOwnProperty("score")?t.score=t.score+1:t.score=1)})}),showQuestion(e,!0)):"after"===e.hideAnswers?($(e.selector).find("#fca_qc_your_answer").html(addQuizImg($(this).children(".fca_qc_quiz_answer_img").attr("src"))+$(this).children(".fca_qc_answer_span").html().replace(svg_square,"")),fca_qc_hide_answers_after(e,s)):showQuestion(e,!0),e.quiz_settings.disable_scroll||scrollQuizInToView(e.selector)});var optins=[],shared=[],completed=[],resizeWindow=debounce(function(){jQuery.each(quizzes,function(e){$(quizzes[e].selector).find("#fca_qc_answer_container").waitForImages(function(){maybe_add_quarter_class(quizzes[e].selector),$("#fca_qc_back_container").is(":visible")?scale_flip_box_back(quizzes[e].selector):scale_flip_box_question(quizzes[e].selector)})})},50)});