diff options
Diffstat (limited to 'plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js')
-rw-r--r-- | plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js b/plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js index c9103bf0..db518a02 100644 --- a/plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js +++ b/plugins/jetpack/_inc/build/shortcodes/js/quiz.min.js @@ -1,2 +1 @@ -/* Do not modify this file directly. It is compiled from other files. */ -!function(a){a.fn.shuffleQuiz=function(){var t=this.get(),i=a.map(t,function(){var i,n=(i=t.length,Math.floor(Math.random()*i)),c=a(t[n]).clone(!0)[0];return t.splice(n,1),c});return this.each(function(t){a(this).replaceWith(a(i[t]))}),a(i)}}(jQuery),jQuery(function(a){a(".jetpack-quiz").each(function(){var t=a(this);t.find("div.jetpack-quiz-answer").shuffleQuiz(),t.find("div[data-correct]").removeAttr("data-correct").data("correct",1),t.find("div.jetpack-quiz-answer:last").addClass("last")}),a("div.jetpack-quiz").on("click","div.jetpack-quiz-answer",function(){var t,i=a(this),n=i.closest("div.jetpack-quiz");n.data("a8ctraining")&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_trainingchaos-"+n.data("username")+"="+n.data("a8ctraining")+"&rand="+Math.random(),n.data("a8ctraining",!1),n.data("trackid",!1)),t=n.data("trackid"),i.data("correct")?(i.addClass("correct"),t&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-"+t+"=correct&rand="+Math.random())):(i.addClass("wrong"),t&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-"+t+"=wrong&rand="+Math.random())),n.data("trackid",!1)})});
\ No newline at end of file +!function(){var t;(t=jQuery).fn.shuffleQuiz=function(){var a=this.get(),e=t.map(a,(function(){var e,n=(e=a.length,Math.floor(Math.random()*e)),i=t(a[n]).clone(!0)[0];return a.splice(n,1),i}));return this.each((function(a){t(this).replaceWith(t(e[a]))})),t(e)},jQuery((function(t){t(".jetpack-quiz").each((function(){var a=t(this);a.find("div.jetpack-quiz-answer").shuffleQuiz(),a.find("div[data-correct]").removeAttr("data-correct").data("correct",1),a.find("div.jetpack-quiz-answer:last").addClass("last")})),t("div.jetpack-quiz").on("click","div.jetpack-quiz-answer",(function(){var a,e=t(this),n=e.closest("div.jetpack-quiz");n.data("a8ctraining")&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_trainingchaos-"+n.data("username")+"="+n.data("a8ctraining")+"&rand="+Math.random(),n.data("a8ctraining",!1),n.data("trackid",!1)),a=n.data("trackid"),e.data("correct")?(e.addClass("correct"),a&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-"+a+"=correct&rand="+Math.random())):(e.addClass("wrong"),a&&((new Image).src="//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-"+a+"=wrong&rand="+Math.random())),n.data("trackid",!1)}))})),document.querySelectorAll(".jetpack-quiz-wrapper").forEach((function(t){t.childNodes.forEach((function(a,e){a.style.display="none",a.setAttribute("quiz-number",e),a.querySelector(".jetpack-quiz-count").innerHTML=e+1+"/"+t.childElementCount})),t.childNodes[0].style.display="block"})),document.querySelectorAll(".jetpack-quiz-option-button").forEach((function(t){t.addEventListener("click",(function(){var a=t.parentElement.parentElement;a.style.display="none";var e="next"===t.getAttribute("data-quiz-option")?1:-1,n=a.parentElement.childNodes[parseInt(a.getAttribute("quiz-number"))+e];n.style.display="block";var i=n.querySelector(".jetpack-quiz-question");i&&i.focus()}))}))}();
\ No newline at end of file |