1!function(a){void 0===mejs.plugins&&(mejs.plugins={},mejs.plugins.silverlight=[],mejs.plugins.silverlight.push({types:[]})),mejs.HtmlMediaElementShim=mejs.HtmlMediaElementShim||{getTypeFromFile:mejs.Utils.getTypeFromFile},void 0===mejs.MediaFeatures&&(mejs.MediaFeatures=mejs.Features),void 0===mejs.Utility&&(mejs.Utility=mejs.Utils);var e=MediaElementPlayer.prototype.init,t=(MediaElementPlayer.prototype.init=function(){this.options.classPrefix="mejs-",this.$media=this.$node=a(this.node),e.call(this)},MediaElementPlayer.prototype._meReady);MediaElementPlayer.prototype._meReady=function(){this.container=a(this.container),this.controls=a(this.controls),this.layers=a(this.layers),t.apply(this,arguments)},MediaElementPlayer.prototype.getElement=function(e){return void 0!==a&&e instanceof a?e[0]:e},MediaElementPlayer.prototype.buildfeatures=function(e,t,i,s){for(var l=["playpause","current","progress","duration","tracks","volume","fullscreen"],r=0,n=this.options.features.length;r<n;r++){var o=this.options.features[r];if(this["build"+o])try{-1===l.indexOf(o)?this["build"+o](e,a(t),a(i),s):this["build"+o](e,t,i,s)}catch(e){console.error("error building "+o,e)}}}}((window,jQuery));; 2!function(r,e,i){"use strict";window.wp=window.wp||{};var t=i.View.extend({initialize:function(t){this.index=0,this.settings={},this.data=t.metadata||r.parseJSON(this.$("script.wp-playlist-script").html()),this.playerNode=this.$(this.data.type),this.tracks=new i.Collection(this.data.tracks),this.current=this.tracks.first(),"audio"===this.data.type&&(this.currentTemplate=wp.template("wp-playlist-current-item"),this.currentNode=this.$(".wp-playlist-current-item")),this.renderCurrent(),this.data.tracklist&&(this.itemTemplate=wp.template("wp-playlist-item"),this.playingClass="wp-playlist-playing",this.renderTracks()),this.playerNode.attr("src",this.current.get("src")),e.bindAll(this,"bindPlayer","bindResetPlayer","setPlayer","ended","clickTrack"),e.isUndefined(window._wpmejsSettings)||(this.settings=e.clone(_wpmejsSettings)),this.settings.success=this.bindPlayer,this.setPlayer()},bindPlayer:function(t){this.mejs=t,this.mejs.addEventListener("ended",this.ended)},bindResetPlayer:function(t){this.bindPlayer(t),this.playCurrentSrc()},setPlayer:function(t){this.player&&(this.player.pause(),this.player.remove(),this.playerNode=this.$(this.data.type)),t&&(this.playerNode.attr("src",this.current.get("src")),this.settings.success=this.bindResetPlayer),this.player=new MediaElementPlayer(this.playerNode.get(0),this.settings)},playCurrentSrc:function(){this.renderCurrent(),this.mejs.setSrc(this.playerNode.attr("src")),this.mejs.load(),this.mejs.play()},renderCurrent:function(){var t;"video"===this.data.type?(this.data.images&&this.current.get("image")&&-1===this.current.get("image").src.indexOf("wp-includes/images/media/video.svg")&&this.playerNode.attr("poster",this.current.get("image").src),(t=this.current.get("dimensions"))&&t.resized&&this.playerNode.attr(t.resized)):(this.data.images||this.current.set("image",!1),this.currentNode.html(this.currentTemplate(this.current.toJSON())))},renderTracks:function(){var e=this,i=1,s=r('<div class="wp-playlist-tracks"></div>');this.tracks.each(function(t){e.data.images||t.set("image",!1),t.set("artists",e.data.artists),t.set("index",!!e.data.tracknumbers&&i),s.append(e.itemTemplate(t.toJSON())),i+=1}),this.$el.append(s),this.$(".wp-playlist-item").eq(0).addClass(this.playingClass)},events:{"click .wp-playlist-item":"clickTrack","click .wp-playlist-next":"next","click .wp-playlist-prev":"prev"},clickTrack:function(t){t.preventDefault(),this.index=this.$(".wp-playlist-item").index(t.currentTarget),this.setCurrent()},ended:function(){this.index+1<this.tracks.length?this.next():(this.index=0,this.setCurrent())},next:function(){this.index=this.index+1>=this.tracks.length?0:this.index+1,this.setCurrent()},prev:function(){this.index=this.index-1<0?this.tracks.length-1:this.index-1,this.setCurrent()},loadCurrent:function(){var t=this.playerNode.attr("src")&&this.playerNode.attr("src").split(".").pop(),e=this.current.get("src").split(".").pop();this.mejs&&this.mejs.pause(),t!==e?this.setPlayer(!0):(this.playerNode.attr("src",this.current.get("src")),this.playCurrentSrc())},setCurrent:function(){this.current=this.tracks.at(this.index),this.data.tracklist&&this.$(".wp-playlist-item").removeClass(this.playingClass).eq(this.index).addClass(this.playingClass),this.loadCurrent()}});function s(){r(".wp-playlist:not(:has(.mejs-container))").each(function(){new t({el:this})})}window.wp.playlist={initialize:s},r(document).ready(s),window.WPPlaylistView=t}(jQuery,_,Backbone);; 3var document_qwiz_declined_login_b="not ready",document_qwiz_user_logged_in_b="not ready",document_qwiz_wp_user_session_id,document_qwiz_maker_privileges=!1,qjax_bypass="not ready",qwiz_wp_site_url,document_qwiz_remember_f=!1,document_active_qwiz_qdeck="",document_qwiz_username="",document_qwiz_independent_taker_f="",document_qwiz_email="",default_document_qwiz_email_confirm=1,document_qwiz_email_confirm=default_document_qwiz_email_confirm,$dialog_current_password="",$dialog_assign_to_classes="",document_qwiz_class_id="",document_qwiz_school_id=0,document_qwiz_session_id,document_qwiz_login_timeout,document_qwiz_team_b=!1,document_qwiz_mobile_enabled="Always",document_qwiz_mobile="",document_qwiz_bubblebar_enabled_b=!0,document_qwiz_force_mobile_f=!1,document_qwiz_qdeck_maker_ids={},document_qwiz_pay_registration_date_unix=0,document_qwiz_not_logged_in_alerted=!1,document_qwiz_qwiz_html_completed_f,document_qwiz_qdeck_html_completed_f,document_qwiz_preview_i_qwiz,document_qwiz_preview_i_deck,document_qwiz_set_user_menus_and_icons_done="",document_qwiz_good_through_date,document_qwiz_good_through_date_ok,document_qwiz_subscription_id,document_qwiz_immediate_payment,document_qwiz_university_discount;qwiz_qcards_common={};var qwiz_qcards_common_f=function(){var qqc=this,qqcname="qwiz_qcards_common",$=jQuery,init_enter_intercept_f,jjax_script_no=0,head="not ready",server_loc="not ready",secure_server_loc,qwiz_ajaxurl="not ready",plugin_url="",icon_expand_src="not ready",icon_collapse_src,maker_specific_n_qs_by_unit_topic,use_dataset_options_display_name={},progress_bars_leaderboard={},refresh_leaderboard_timeout={},dataset_questions_countdown_timeout={},pay_qwiz_qdeck_,pay_i_qwiz_deck,payment_received_f=!1,register_taker_global_reg_code_ok_f=!1,register_taker_display_pay_screen=!1,register_taker_global_username,register_taker_global_first_name,register_taker_global_last_name,register_taker_global_sha3_password,register_taker_global_username_unique_f,register_taker_global_email_unique_f,register_taker_global_reg_code_maker_id="",register_taker_global_reg_code_school_id="",register_taker_global_reg_code_class_id="",register_taker_global_reg_code_class_name="",register_taker_global_reg_code_school_name="",register_taker_global_reg_code_professor_f="",register_taker_global_in_process_b=!1,provide_feedback_html={},dataset_units_topics_data,units_topics_state={},selected_levels={},debug=[];function qjax_callback(js){debug[0]&&console.log("[qjax_callback] js:",js),js&&(js=js.replace(/var /g,""),eval(js))}function check_maker_session_id(){var e=$.cookie("maker_session_id");if(debug[0]&&console.log("[check_maker_session_id] cookie_session_id:",e),e){var t={cookie_session_id:e,callback:"maker_session_id_ok_or_no"};qqc.qjax("qwiz_qcards_common",0,"","check_maker_session_id",t)}else qqc.maker_session_id_ok_or_no()}function get_progress_meter_data(){var e={},t="";if(qwiz_.n_qwizzes){t=[];for(var s=0;s<qwiz_.n_qwizzes;s++){let i=qwiz_.get_qwizdata(s,"qrecord_id");i&&(t.push(i),e[i]=["Q",s])}}var i="";
3if(qcard_.n_decks){i=[];for(var a=0;a<qcard_.n_decks;a++){let t=qcard_.get_deckdata(a,"qrecord_id");t&&(i.push(t),e[t]=["F",a])}}if(debug[0]&&(console.log("[get_progress_meter_data] qwiz_qrecord_ids:",t),console.log("[get_progress_meter_data] qdeck_qrecord_ids:",i)),t||i){var r={qwiz_qrecord_ids:t,qdeck_qrecord_ids:i,qrecord_id_to_i_qwiz_i_deck:e};qqc.qjax("",0,"","get_progress_meter_data",r)}}function reset_progress_meters(){if(qwiz_)for(var e=0;e<qwiz_.n_qwizzes;e++)qwiz_.set_qwizdata(e,"progress_meter",!1),$(`div.qwiz-progress_meter-qwiz${e}`).hide();if(qcard_)for(var t=0;t<qcard_.n_decks;t++)qcard_.set_deckdata(t,"progress_meter",!1),$(`div.qcard-progress_meter-qdeck${t}`).hide()}debug[0]=!1,debug[5]=!1,debug[7]=!1,debug[9]=!1,debug[10]=!1,debug[11]=!1,debug[12]=!1,debug[13]=!1,$(document).ready((function(){qqc.qdebug(debug),$.cookie&&(document_qwiz_declined_login_b=$.cookie("qwiz_declined_login")),head=document.getElementsByTagName("head")[0],debug[0]&&console.log("[qwiz_qcards_common ready] head:",head);var e=$("a.unit.unit_button"),t=e.html();if(t&&"start course"==t.toLowerCase()){var s=function(){$("div.qwiz_wrapper_fallback").is(":visible")&&qwiz_.qwiz_init(),$("div.qdeck_wrapper_fallback").is(":visible")&&qcard_.qdeck_init()};e.click((function(){setTimeout(s,3e3)}))}})),this.jjax=function(e,t,s,i,a){return qqc.qjax(e,t,s,i,a),!1},this.qjax=function(e,t,s,i,a){if(a||(a={}),a.qname=e,a.i_qwiz=t,a.qrecord_id=s,a.dest=i,a.js_f=1,void 0!==document_qwiz_session_id&&(a.qwiz_session_id=document_qwiz_session_id),debug[0]&&console.log("[qjax] qwizdata:",a),"not ready"==qjax_bypass&&(qjax_bypass=qqc.get_qwiz_param("qjax_bypass","")),qwiz_wp_site_url=qqc.get_qwiz_param("wp_site_url",""),qjax_bypass){var r=qwiz_wp_site_url+"/admin/"+i;debug[0]&&console.log("[qjax] url:",r),$.ajax({type:"POST",url:r,data:a,error:function(s,i,o){var n;console.log("[qjax] XMLHttpRequest:",s,", statusText:",i,", errorThrown:",o),console.log("[qjax] url:",r);var _=s.readyState;-1!=r.indexOf("record")?("qwiz_"==e?$(`span.response_recorded-qwiz${t} img.response_recording`).removeClass("response_recording_spin"):$(`span.response_recorded-qdeck${t} img.response_recording`).removeClass("response_recording_spin"),n=0==_?a.secure_f?"Sorry, unable to record your response. Please try again. Perhaps check your Internet connection?":"Sorry, unable to record your response. Perhaps check your Internet connection?":a.secure_f?"Sorry, unable to record your response. Please try again. If the problem reoccurs, contact [email protected]":"Sorry, unable to record your response. If the problem reoccurs, please contact [email protected]"):n=0==_?"Sorry, unable to process request. Perhaps check your Internet connection?":"Sorry, unable to process request. If the problem persists, please contact [email protected]",alert(n)},success:qjax_callback})}else{"not ready"==qwiz_ajaxurl&&(qwiz_ajaxurl=qqc.get_qwiz_param("ajaxurl",""));var o={action:"qjax"};o.qwizdata=a,$.ajax({type:"POST",url:qwiz_ajaxurl,data:o,success:qjax_callback})}},this.check_session_id=function(e,t){var s=$.cookie("qwiz_session_id");if(debug[0]&&console.log("[check_session_id] cookie_session_id:",s),s){document_qwiz_session_id=s;var i={cookie_session_id:s};t&&(i.register_f=1),debug[0]&&(i.qdebug=1),qqc.qjax("",e,"","check_session_id",i)}else document_qwiz_user_logged_in_b=!1},this.maker_session_id_ok_or_no=function(){if(!qqc.maker_logged_in_b){setTimeout((function(){$("a.teacher_subscriptions").each((function(){var e=$
3(this),t=e.data("query_string");debug[0]&&console.log("[maker_session_id_ok_or_no]: query_string:",t);const s=qqc.get_qwiz_param("secure_server_loc")+"/maker_login_register"+t;e.attr("href",s)}))}),250)}},this.set_user_menus_and_icons=function(e,t,s){if("doing_quizzes"==s){if(/decks/.test(document_qwiz_set_user_menus_and_icons_done+="quizzes"))return}else if("doing_decks"==s&&/quizzes/.test(document_qwiz_set_user_menus_and_icons_done+="decks"))return;var i="",a="black",r=0,o=function(){if("not ready"!=document_qwiz_user_logged_in_b&&document_qwiz_qwiz_html_completed_f&&document_qwiz_qdeck_html_completed_f){if(!0===document_qwiz_user_logged_in_b){get_progress_meter_data();var t=document_qwiz_maker_privileges?"Teacher logged in as student":"Logged in as";if(i+='<div style="text-align: right;">'+qqc.T(t)+" <strong>"+document_qwiz_username+"</strong></div>",document_qwiz_maker_privileges&&!qwiz_.preview_i_qwiz_plus1&&!qcard_.preview_ideck_plus1){const e="javascript: qwiz_qcards_common.do_preview (i_qwiz, 'qname')";i+='<div class="teacher_preview_qname"><table class="teacher_preview"><tr><td><b>'+qqc.T("Teachers only:")+' </b></td><td style="padding-bottom: 5px;"><a href="'+e+'" title="View this quiz/deck in expanded, all-question display">'+qqc.T("preview this")+' quiz_flashcard_deck</a></td></tr><tr><td></td><td><a href="javascript: qwiz_qcards_common.assign_to_classes (\'qname\', i_qwiz)" title="Assign this quiz_flashcard_deck to your classes">'+qqc.T("assign to classes")+"</a></td></tr></table></div>"}document_qwiz_independent_taker_f?i+='<div><a href="javascript: qname.hide_menu_and_display_login (i_qwiz, false, \'enroll\')" title="You are currently registered as an independent student. If you have a registration code you can join a class">'+qqc.T("Enroll in a school/class")+"</a></div>":document_qwiz_wp_user_session_id||(i+='<div><a href="javascript: qname.hide_menu_and_display_login (i_qwiz, true)">'+qqc.T("Add team member")+"</a></div>"),"not ready"==server_loc&&(server_loc=qqc.get_qwiz_param("server_loc","http://qwizcards.com/admin")),i+='<div><a href="'+server_loc+"/index?student_view=1&time="+document_qwiz_session_id+'" target="_blank">'+qqc.T("My scores")+"</a></div>",i+="leaderboard",i+="</nobr></div>",document_qwiz_wp_user_session_id||(i+='<div><a href="javascript:'+qqcname+'.my_account ()" title="'+qqc.T("View/edit login name, password, ...")+'">'+qqc.T("My account - settings")+"</a></div>"),i+='<div><a href="javascript: qname.hide_menu_and_display_login (i_qwiz, false, \'feedback\')" title="'+qqc.T("Report errors/bugs, comment, make suggestions...")+'">'+qqc.T("Feedback")+"</a></div>",document_qwiz_wp_user_session_id||(i+="<div>"+qqc.T("Not")+" "+document_qwiz_username+"? <a href=\"javascript: qwiz_qcards_common.sign_out (false, false, 'qname', i_qwiz)\">"+qqc.T("Sign out")+"</a></div>"),a=document_qwiz_maker_privileges?"#00b8ff":"#20a020",$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce")}else document_qwiz_wp_user_session_id?i+="<b>Authentication expired. Please re-load this page to record your work</b>":(reset_progress_meters(),i+='<br /><div><nobr><a href="javascript: qname.hide_menu_and_display_login (i_qwiz)"><strong>'+qqc.T("Log in")+"</strong> "+qqc.T("to record/get credit")+"</a></nobr></div>",i+='<div> <span class="qwiz-remember" title="'+qqc.T("Skip login in the future")+'"><label class="qwiz_label"><span class="qwiz-remember"><input type="checkbox" /> '+qqc.T("Remember")+'</span></label></span> <a href="javascript: qname.icon_no_login (i_qwiz)"><strong>'+qqc.T("No thanks")+"</strong></a></div>",i+="leaderboard","not ready"==document_qwiz_declined_login_b&&(document_qwiz_declined_login_b=$.cookie("qwiz_declined_login")),e||document_qwiz_declined_login_b||($("div.qwiz-usermenu_icon_no_intro").addClass("qwiz-icon-bounce"),$("div.qwiz-usermenu_icon").addClass("qwiz-icon-bounce")));const r='<div class="qwiz_leaderboard_link"><a href="javascript: qwiz_.hide_menu_and_display_login (i_qwiz, false, \'leaderboard\')">'+qqc.T("Fastest finish times")+"</a></div>";var s=i.replace(/qname/g,"qwiz_").replace(/quiz_flashcard_deck/g,"quiz");$("div.qwiz-usermenu").each((function(){const e=$(this).attr("id").substr(13);var t="";qwiz_.get_qwizdata(e,"qwiz_timer")&&(t=r),$(this).html(s.replace("leaderboard",t).replace(/i_qwiz/g,e))}));var n=i.replace(/qname/g,"qcard_").replace(/quiz_flashcard_deck/g,"deck").replace("leaderboard","");$("div.qdeck-usermenu").each((function(){const e=$(this).attr("id").substr(14);$(this).html(n.replace(/i_qwiz/g,e))})),$("div.qwiz-usermenu_icon").css({display:"block",color:a}),$qscores=$("span.qscores"),$qscores.length&&qqc.set_qscore_menus($qscores)}else debug[0]&&console.log("[set_user_menus_and_icons] n_tries:",r),++r<20?setTimeout(o,"250"):console.log("[set_user_menus_and_icons] document_qwiz_user_logged_in_b not set");!0!==document_qwiz_user_logged_in_b&&$("div.qwiz_progress_meter").hide()};o()},this.set_progress_meters=function(e){debug[0]&&console.log("[set_progress_meters] data:",e);const t=e.n_questions_by_qrecord_id;qqc.question_card_ids_by_qrecord_id=e.question_card_ids_by_qrecord_id;const s=e.qrecord_id_to_i_qwiz_i_deck,i=e.qrecord_id_oks;for(var[a,r]of Object.entries(t)){const e=s[a],t=e[0],_=e[1];let c=!0;1==document_qwiz_school_id||document_qwiz_maker_privileges||(c=i[a]);var o=5;r>150?o=0:r>100?o=1:r>10?o=2:r>4&&(o=3);let d=0;var n;if(qqc.question_card_ids_by_qrecord_id[a]&&(d=qqc.question_card_ids_by_qrecord_id[a].length),"Q"==t){n=$(`div.qwiz-progress_meter-qwiz${_}`),qwiz_.set_qwizdata(_,"progress_meter",!0),d&&qwiz_.set_qwizdata(_,"progress_meter_previous",!0);const e=parseFloat($(`#qwiz${_}`).css("border-width"));n.css({top:-e-7+"px",left:-e+"px",width:'calc(100% + 2*quiz_border_width + "px")'})}else n=$(`div.qcard-progress_meter-qdeck${_}`),qcard_.set_deckdata(_,"progress_meter",!0),d&&qcard_.set_deckdata(_,"progress_meter_previous",!0);const l=n[0];let u="";1==document_qwiz_school_id||document_qwiz_maker_privileges||("not in a class"==c||"no credit"==i[a])&&(u=c),u?n.css({"--dash-bg":"rgb(255, 233, 192)","--dash-border":"rgb(255, 165, 0)"}):n.css({"--dash-bg":"","--dash-border":""}),l.qrecord_id_not_ok=u,"Q"==t?qwiz_.set_qwizdata(_,"qrecord_id_not_ok",u):qcard_.set_deckdata(_,"qrecord_id_not_ok",u),n.css({"--n":r,"--m":d,"--gap":o+"px"}),qqc.init_progress_meter(l),l.previous_n_correct=d>0}},this.update_progress_meter=function(e){const t=getComputedStyle(e),s=parseInt(t.getPropertyValue("--n"),10)||0,i=Math.max(0,Math.min(parseInt(t.getPropertyValue("--m"),10)||0,s)),a=parseInt(t.getPropertyValue("--gap"),10)||0;if(e.innerHTML="",s<=0)return;e.innerHTML='<div class="progress_meter_overlay"></div>';const r=/qwiz/.test(e.className);var o="";const n=e.qrecord_id_not_ok;if("not in a class"==n)o="You are not in a class. To get credit, enroll in a class (green down-triangle menu). ";else if("no credit"==n){o=`This ${r?"quiz":"flashcard deck"} is not assigned as work you need to do. `}const _=e.previous_n_correct?"("+qqc.T("including previous work")+")":"";o+=r?`${i} ${qqc.T("correct")} / ${s} ${qqc.T("questions")} ${_}`:`${i} ${qqc.T('"Got-its"')} / ${s} ${qqc.T("cards")} ${_}`,e.title=o;const c=document.createDocumentFragment(),d=s-1;for(let e=0;e<s;e++){const t=document.createElement("div");let s="dash"+(e<i?" filled":"");0==a&&(s+=0==e?" border-left":e==d?" border-right":" border-top-bottom"),t.className=s,c.appendChild(t)}e.appendChild(c)},this.init_progress_meter=function(e){qqc.update_progress_meter(e),e.style.display="flex";new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&"style"===t.attributeName&&qqc.update_progress_meter(t.target)})).observe(e,{attributes:!0})},this.my_account=function(){var e=server_loc+"/my_account?time="+document_qwiz_session_id;if(document_qwiz_good_through_date){e+="&good_through_date="+DateFormat.format.date(Date.parse(document_qwiz_good_through_date),"MMMM d, yyyy")}window.open(e,"my_account")};var do_preview_form=!1,assign_to_classes_data;function deassign_class_from_quiz(e){debug&&(console.log("[deassign_class_from_quiz] e.params.data:",e.params.data),console.log("[deassign_class_from_quiz] e.params.data.element.value:",e.params.data.element.value));const t={class_id:e.params.data.element.value,class_name:e.params.data.element.text,i_row:0,callback:"qwiz_qcards_common.assign_to_classes_updated"};qqc.qjax("",0,assign_to_classes_data.qrecord_id,"delete_class_from_qwiz_qdeck",t)}function add_class_to_qwiz_qdeck(e){debug&&(console.log("[add_class_to_qwiz_qdeck] e.params.data:",e.params.data),console.log("[add_class_to_qwiz_qdeck] e.params.data.element.value:",e.params.data.element.value));const t={class_id:e.params.data.element.value,class_name:e.params.data.element.text,i_row:0,callback:"qwiz_qcards_common.assign_to_classes_updated"};qqc.qjax("",0,assign_to_classes_data.qrecord_id,"add_class_to_qwiz_qdeck",t)}function set_pay_unlock_menu(e,t,s,i,a,r,o,n,_){var c,d,l,u="";"qwiz_"==e?(c="quiz",d="qwiz",l="qwiz_"):(c="flashcard deck",d="qdeck",l="qcard_"),u+='<div class="pay_preview_status">'+i+"</div>";var p=!1;if(!0===document_qwiz_user_logged_in_b){if("paid"!=get_qwizdeckdata(e,t,"pay_quiz_ok"))if(r.length){u+=a+r.join("");var g=o?"Sign up":"Pay now";u+='<a href="javascript: '+e+".hide_menu_and_display_login ("+t+", false, 'pay', '', 0, '"+g+'\')" class="qwiz_pay_unlock_menu_pay_now">'+g+"</a>"}else u+=1==document_qwiz_school_id?"Please contact the maker of this "+c+": they need to provide an individual-student payment option for you":"Please talk to your teacher: they need to provide access to this "+c+" for you"}else if(!s){var h="?url="+encodeURIComponent(qqc.get_qwiz_param("url","./"))+"&qname="+l+"&i_qwiz="+t;qqc.get_qwiz_param("secure_server_loc");if(u+=`<div><b>Students in a teacher’s class</b>: Use your teacher’s registration code to <a href="javascript: qwiz_qcards_common.pay_unlock_menu_display_login ('${e}', ${t}, 'register')" class="qwiz_login">`+qqc.T("register")+"</a>. ",r.length&&(u+="<br />"+a+r.join(""),!o)){u+=`<a href="javascript: qwiz_qcards_common.pay_unlock_menu_display_login ('${e}', ${t}, 'register', '${"Please register so you can get credited for your payment"}')" class="qwiz_login qwiz_pay_unlock_menu_pay_now">\n Pay now\n </a>`}if(u+="</div>",n.length&&(u+="<div><b>Teachers</b>: "+n.join("<br />"),_)){qqc.maker_logged_in_b||(p=!0);u+='<br /><a href="'+("javascript: "+e+".hide_menu_and_display_login ("+t+", false, 'maker_pay')")+'" class="teacher_subscriptions qwiz_login" data-query_string="'+h+'" target="_blank">Teacher subscriptions</a>'}u+="</div>"}return $("div#pay_unlock_menu-"+d+t).html(u),p}this.do_preview=function(e,t){if(!do_preview_form){var s=[];s.push('<form name="do_preview" target="_blank">'),s.push('<input type="hidden" name="qwizmin">'),s.push("</form>"),$("body").append(s.join("\n")),do_preview_form=!0}const i="qwiz_"==t?"qwiz":"deck";$.cookie(i+"_preview",e,{path:"/"}),$.cookie("qwiz_preview_username",document_qwiz_username,{path:"/"});const a=document.forms.do_preview,r=document.location.href,o=document.location.search.match(/qwizmin=(\d)/);o&&(a.qwizmin.value=o[1]),a.action=r,a.submit()},this.assign_to_classes=function(e,t){var s;s="qwiz_"==e?$("div#qwiz"+t).attr("qrecord_id"):$("div.qcard_card-qdeck"+t+" div.qcard-front").attr("qrecord_id");qqc.qjax(e,t,s,"assign_to_classes",{modal:1})},this.dialog_assign_to_classes=function(e){if(debug[0]&&console.log("[dialog_assign_to_classes] data:",e),e.errmsg)return void alert(e.errmsg);if(assign_to_classes_data=e,!$dialog_assign_to_classes){var t=[];t.push('<div id="dialog_assign_to_classes" title="Assign quiz/flashcard deck to classes">'),t.push('<div id="assign_to_classes_feedback_msg">'),t.push(" "),t.push("</div>"),t.push('<h3 class="assign_to_classes qwiz_display_none">'),t.push('Assign <span id="assign_to_classes_quiz_flashcard_deck"></span> to classes'),t.push("</h3>"),t.push('<div id="assign_to_classes_select">'),t.push("</div>"),t.push("<br />"),t.push('<h3 class="assign_to_classes qwiz_display_none">'),t.push('Set <span id="assign_to_classes_assignment_due"></span>
3 date'),t.push("</h3>"),t.push('<input id="assign_to_classes_assignment_date" class="qwiz_display_none" type="date" onchange="qwiz_qcards_common.update_assignment_date (this)" />'),t.push("</div>"),$("body").append(t.join("\n")),$dialog_assign_to_classes=$("div#dialog_assign_to_classes").dialog({autoOpen:!1,width:600,height:600,modal:!0,resizable:!1,buttons:{Close:function(){$dialog_assign_to_classes.dialog("close")}}})}const s={class_id:"all",maker_id:e.maker_id,callback:"qwiz_qcards_common.assign_to_classes_set_quizzes_decks"};qqc.qjax(e.qname,0,e.qrecord_id,"get_quizzes_decks",s)},this.assign_to_classes_set_quizzes_decks=function(e){debug[0]&&console.log("[assign_to_classes_set_quizzes_decks] data:",e);const t="qwiz_"==assign_to_classes_data.qname?"quiz":"flashcard deck";var s=[];if(0==e.class_ids_assigned_to_qwiz.length){const e=assign_to_classes_data.qrecord_id.replace(/sciencemusicvideosMeister1961-/,"");s.push("<b>Sorry, this "+t+", “"+e+"”, has not been made available to you for use in your classes."),s.push("<br />"),s.push("<br />"),s.push("You will have to contact the "+t+" owner/creator and ask them to provide it to you.</b>"),$("div#assign_to_classes_select").html(s.join("\n"))}else{s.push('<select id="class_select" multiple="multiple">');const n=assign_to_classes_data.class_ids,_=assign_to_classes_data.class_names,c=assign_to_classes_data.deleted_fs,d=n.length;for(var i=!1,a=0;a<d;a++)if(!c[a]){var r="";-1!=e.class_ids_assigned_to_qwiz[0].indexOf(n[a])&&(r=" selected",i=!0),s.push('<option value="'+n[a]+'"'+r+">"),s.push(_[a]),s.push("</option>")}s.push("</select>"),i&&(s.push("<br />"),s.push('<span style="font-size: 8pt; color: gray;">'),s.push("Click in the box for options dropdown"),s.push("</span>")),$("div#assign_to_classes_select").html(s.join("\n")),$("h3.assign_to_classes").removeClass("qwiz_display_none"),$("span#assign_to_classes_quiz_flashcard_deck").html(t+" “"+e.display_names[0]+"”");var o=$("select#class_select");o.select2({placeholder:"Select...",width:"250px"}),o.on("select2:unselect",deassign_class_from_quiz),o.on("select2:select",add_class_to_qwiz_qdeck);const l=e.assignment_due?"due":"assignment";if($("span#assign_to_classes_assignment_due").html(l),$("input#assign_to_classes_assignment_date").removeClass("qwiz_display_none"),void 0!==e.assignment_dates[0]){const t=DateFormat.format.date(1e3*e.assignment_dates[0],"yyyy-MM-dd");$("input#assign_to_classes_assignment_date").val(t)}}$dialog_assign_to_classes.dialog("open")},this.update_assignment_date=function(e){var t=e.value;if(!t)return void $("div#assign_to_classes_feedback_msg").html('<span class="qwiz_errmsg">Please enter a valid date</span>');t=Date.parse(t+"T00:00")/1e3;const s={qrecord_ids:[assign_to_classes_data.qrecord_id],field:"assignment_date",value:t,callback:"qwiz_qcards_common.assign_to_classes_updated"};qqc.qjax("",0,assign_to_classes_data.qrecord_id,"update_quiz_deck",s)},this.assign_to_classes_updated=function(e){var t,s=DateFormat.format.date((new Date).getTime(),"h:mm:ss");t=e.affected_rows>=1?"Database updated "+s:'<span class="qwiz_red">Sorry, unable to update database</span>',$("div#assign_to_classes_feedback_msg").html(t)},this.request_assign_to_class=function(e){var t,s,i;e?(t="qwiz_",s=qwiz_.assign_to_class_i_qwiz,i=qwiz_.assign_to_class_qrecord_id):(t="qcard_",s=qcard_.assign_to_class_i_deck,i=qcard_.assign_to_class_qrecord_id,document_qwiz_qdeck_maker_ids["qdeck"+s]);const a=document_qwiz_school_id,r=document_qwiz_taker_id,o=window.location.href,n={taker_username:document_qwiz_username,school_id:a,taker_id:r,page_url:o};plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));const _='<img src="'+plugin_url+'images/spinner16x16.gif" />';$("div#"+t+"request_assign_to_class_feedback").html(_),qqc.qjax(t,s,i,"request_assign_to_class",n)},this.do_not_show_assign_to_class=function(e){const t=document_qwiz_username+"do_not_show_assign_to_class";if(e.checked){const e={expires:7};$.cookie(t,1,e)}else $.removeCookie(t)},this.pay_unlock_menu_display_login=function(e,t,s,i,a,r){var o,n;"qwiz_"==e?(o="qwiz",n=qwiz_):(o="qdeck",n=qcard_);var _=$("div.qwiz_icon_and_menu_container."+o+t);_.css({"z-index":"-1"}),n.display_login(t,!1,s,i,a,r);setTimeout((function(){_.css({"z-index":""})}),100)},this.sign_out=function(e,t,s,i){var a={session_id:document_qwiz_session_id,table:"session_id"};if(qqc.qjax("",-1,"","delete_session_id",a),$.removeCookie("qwiz_session_id",{path:"/"}),document_qwiz_user_logged_in_b=!1,document_qwiz_maker_privileges=!1,document_qwiz_session_id="",document_qwiz_username="",document_qwiz_independent_taker_f="",document_qwiz_email="",document_qwiz_email_confirm=default_document_qwiz_email_confirm,document_qwiz_school_id=0,document_qwiz_team_b=!1,document_qwiz_good_through_date="",document_qwiz_good_through_date_ok=!1,document_qwiz_university_discount=!1,s){setTimeout((function(){var e=qwiz_deck_
3selector(s,i);$(e+"input.register_taker_username").val("")}),50)}qqc.set_user_menus_and_icons(!e,t),qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(),document_qwiz_pay_registration_date_unix=0;const r=set_display_pay_screen(s,i),o="qwiz_"==s?qwiz_:qcard_;"open_register"==r?o.hide_menu_and_display_login(i,!1,"open_register","",!1):"free_trial"==r?o.hide_menu_and_display_login(i,!1,"free_trial","",!0):"register"==r&&o.hide_menu_and_display_login(i,!1,"register","",!1)},this.usermenu_pay=function(e,t){"qwiz_"==e?$("div.qwiz-progress-container.qwiz"+t).find("a.qwiz_pay_unlock_menu_pay_now")[0].click():$("div#qcard_progress-qdeck"+t).find("a.qwiz_pay_unlock_menu_pay_now")[0].click()},this.set_qscore_menus=function(e){var t;"not ready"==server_loc&&(server_loc=qqc.get_qwiz_param("server_loc"),secure_server_loc=qqc.get_qwiz_param("secure_server_loc")),!0===document_qwiz_user_logged_in_b?(t='<a href="'+secure_server_loc+"/index.php?student_view=1&time="+document_qwiz_session_id+'" target="_blank">',t+=qqc.T("View scores")):(t='<a href="'+secure_server_loc+'/student_login.php" target="_blank">',t+=qqc.T("Login/View scores")),t+="</a>",e.html(t)},this.create_progress_bars=function(e,t,s,i){progress_bars_leaderboard[e+s]=i,plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));var a='<img src="'+(plugin_url+"images/spinner40x40.gif")+'" class="qwiz-center" style="margin-top: 100px;" />';e&&qqc.$get_login_div(e,s).html(a).show();if(!0!==document_qwiz_user_logged_in_b){var r={not_logged_in_f:1,qname:e,i_qwiz_qdeck:s,qrecord_id:t[s].qrecord_id};return qqc.create_progress_bars3(r),!1}if(t[s].record_start_b&&!0===document_qwiz_user_logged_in_b){t[s].record_start_b=!1;var o=(new Date).getTime()/1e3,n=(r={qrecord_id_ok:t[s].qrecord_id_ok,type:"start",now_sec:o,callback:"create_progress_bars2"},"qwiz_"==e?"record_response_v4":"record_qcard_v3");qqc.qjax(e,s,t[s].qrecord_id,n,r)}else qqc.create_progress_bars2(e,s,t[s].qrecord_id)},this.create_progress_bars2=function(e,t,s){var i;if(document_qwiz_independent_taker_f&&(document_qwiz_class_id="independent_student"),i=get_qwizdeckdata(e,t,"use_dataset")){if(/\|\s*unit:/.test(i))var[i,a,r]=qqc.parse_use_dataset(i);else var a=[],r=[];get_dataset_units_topics(e,t,s,i,a,r,"create_progress_bars3")}else{var o,n;if("qwiz_"==e)n=qwiz_.get_qwizdata(t,"n_questions"),o=qwiz_.get_qwizdata(t,"n_correct");else o=(n=qcard_.get_deckdata(t,"n_cards"))-qcard_.get_deckdata(t,"n_to_go");var _={qname:e,i_qwiz_qdeck:t,qrecord_id:s,units:[""],n_correct_by_unit_topic:[o],n_questions_by_unit_topic:[n]};qqc.create_progress_bars3(_)}};var leaderboard_refresh_sec=0,update_email_data,enroll_reg_code_ok_f,enroll_reg_code_school_id,enroll_reg_code_school_name,enroll_reg_code_class_id,enroll_reg_code_class_name,global_data_urls,global_blob_urls,number_word,ordinal_words;function record_units_topics_state(e,t){var s=qqc.$get_login_div(e,t),i=[];s.find("img.expand_collapse_unit.collapse").each((function(){var e=$
3(this).parents("tr.unit_head")[0].id.match(/\d+$/)[0];i.push(e)}));var a=!1,r=[],o=[];s.find('table.dataset_units_topics input[type="checkbox"]').each((function(){if(this.checked)if(this.id){var e=this.id.match(/\d+$/)[0];o.push(e)}else{var t=$(this).parents("tr.unit_head");if(t.length){var s=t[0].id.match(/\d+$/)[0];r.push(s)}else a=this.checked}}));const n={i_units_expanded:i,table_head_checked:a,i_units_checked:r,i_topics_checked:o};debug[0]&&console.log("[record_units_topics_state] state:",n),units_topics_state[e+t]=n}function restore_units_topics_state(e,t){var s=units_topics_state[e+t];if(s){debug[0]&&console.log("[restore_units_topics_state] state:",s);var i=qqc.$get_login_div(e,t),a=s.i_units_expanded;i.find("img.expand_collapse_unit").each((function(){let e=$(this);var t=e.parents("tr.unit_head")[0].id.match(/\d+$/)[0];-1!=a.indexOf(t)&&e.trigger("click")})),i.find('table.dataset_units_topics input[type="checkbox"]').each((function(){this.checked=!1}));var r=s.i_units_checked,o=s.i_topics_checked;i.find('table.dataset_units_topics input[type="checkbox"]').each((function(){if(this.id){var e=this.id.match(/\d+$/)[0];-1!=o.indexOf(e)&&(this.checked=!0)}else{var t=$(this).parents("tr.unit_head");if(t.length){var i=t[0].id.match(/\d+$/)[0];-1!=r.indexOf(i)&&(this.checked=!0)}else this.checked=s.table_head_checked}}))}else debug[0]&&console.log("[restore_units_topics_state] (not available)")}function units_topics_sort(e,t){var s=[];const i=e.length;for(var a=0;a<i;a++)s.push([a,qqc.create_sortable_unit_number(e[a]),qqc.create_sortable_unit_number(t[a])]);s.sort(firstBy(1).thenBy(2));var r=[];for(a=0;a<i;a++)r.push(s[a][0]);return r}function units_topics_counts(e,t,s){var i=e.units,a=e.topics,r=e.levels,o=e.n_questions_by_unit_topic,n=e.n_correct_by_unit_topic,_=i.length,c=units_topics_sort(i,a),d=[],l=[],u={},p={},g={},h={},q=!0,m={},f=0,w=i[_-1];w||(w="Other");for(var b=0,v=0,k=0,z="",y=_-1;y>=0;y--){const e=c[y],_=parseInt(o[e],10),T=null===n[e]?0:parseInt(n[e],10);i[e]||(i[e]="Other"),a[e]||(a[e]="Other");var $=i[e]+"__"+a[e];if($=$.replace(/[^a-z0-9 ]/gi,"_"),!r[e]||(t[r[e]]="",-1!=s.indexOf(r[e]))){if(p[$]||(p[$]=0,g[$]=0),p[$]+=_,g[$]+=T,i[e]!=w){var x=w.replace(/[^a-z0-9 ]/gi,"_");u[x]=b,h[x]=v,"Other"!=w&&(q=!1),m[x]=0==k,b=0,v=0,k=0,w=i[e]}b+=_,v+=T,f+=_,$!=z&&("Other"!=a[e]&&k++,d.push(i[e]),l.push(a[e]),z=$)}}if(_){var T=c[0],S=!1;if(r[T]&&(t[r[T]]="",-1==s.indexOf(r[T])&&(S=!0)),!S){var j=i[T].replace(/[^a-z0-9 ]/gi,"_");u[j]=b,h[j]=v,"Other"!=i[T]&&(q=!1),m[j]=0==k}}return[d,l,_=d.length,c=units_topics_sort(d,l),u,p,h,g,f,q,m,t]}function create_units_topics_correspondence(e,t){for(var s=e.length,i=[],a=[],r=[],o=0,n=0;n<s;n++){var _=e[n].length;r.push(_);for(var c=[],d=[],l=0;l<_;l++){var u=e[n][l].replace(/\.{0,1}([a-z])/i," $1").replace(/[-_]/g," ").replace(/s /g," ").replace(/s$/,""),p=t[n][l].replace(/\.{0,1}([a-z])/i," $1").replace(/[-_]/g," ").replace(/s /g," ").replace(/s$/,"");c.push(u),d.push(p)}i.push(c),a.push(d),_>o&&(o=_)}var g=[];const h=i[0].length;for(n=1;n<s;n++){g.push([]);var q=0,m=3,f=0;const e=i[n].length;for(l=0;l<h;l++){for(var w=!1,b=q;b<m&&!(f+b>=e);b++){if(units_topics_correspondence_twoway_comparison(i[0][l],a[0][l],i[n][f+b],a[n][f+b])){if(b<0&&-1!=g[n-1].indexOf(f+b)){debug[13]&&console.log("[create_units_topics_correspondence] (already used) j + jj:",f+b);continue}g[n-1].push(f+b),w=!0,debug[13]&&(console.log(`[create_units_topics_correspondence] Match: ${i[0][l]} | ${a[0][l]} (i=${l})`),console.log(` ${i[n][f+b]} | ${a[n][f+b]} (j=${f+b})`)),q=b>0?-b:b,m=3,f+=b+1;break}}w||(g[n-1].push(-1),debug[13]&&console.log(`[create_units_topics_correspondence] No match to ${i[0][l]} | ${a[0][l]} (i=${l})`),m++)}}if(debug[13]){console.log("[create_units_topics_correspondence] datasets_matches:",g);var v,k=[]}var z="",y=(f=new Array(s-1).fill(0),[]);for(n=0;n<s;n++)y.push([]);for(l=0;l<r[0];l++){(u=e[0][l])!=z&&(debug[13]&&k.push("UNIT "+u),z=u);var $=t[0][l];y[0].push(l),debug[13]&&(k.push([$]),v=k.length-1);var x=[],T=["NA"];for(n=0;n<s-1;n++){for(x.push(-1),(b=g[n][l])>=0&&(y[n+1].push(b),debug[13]&&k[v].push(t[n+1][b]));;){if(b==f[n]){f[n]++;break}if(b<0){y[n+1].push(-1),debug[13]&&k[v].push("NA");break}if(-1==g[n].indexOf(f[n])){if(x.push(f[n]),T.push(t[n+1][f[n]]),n==s-2){for(var S=0;S<s;S++)y[S].push(x[S]);debug[13]&&k.push(T)}f[n]++;break}f[n]++}}}if(debug[13]&&console.log("[create_units_topics_correspondence] lines:",k),debug[0]){k=[];for(_=y[0].length,l=0;l<_;l++){k.push([]);for(n=0;n<s;n++){(b=y[n][l])>=0?k[l].push(t[n][b]):k[l].push("NA")}}console.log("[create_units_topics_correspondence] display_line_to_dataset_j: ",y),console.log("[create_units_topics_correspondence] lines:",k)}return y}function units_topics_correspondence_twoway_comparison(e,t,s,i){const a=.69;var r=!1;return(units_topics_correspondence_com_score(e,s)>a||units_topics_correspondence_com_score(s,e)>a)&&(units_topics_correspondence_com_score(t,i)>a||units_topics_correspondence_com_score(i,t)>a)&&(r=!0),r}function units_topics_correspondence_com_score(e,t){s1s=e.split(/\s+/);var s=0;for(var i of s1s)e.includes(i)&&(/[a-z]/i.test(i)?s+=1:s+=.3);var a=0;for(var i of s1s)t.includes(i)&&(/[a-z]/i.test(i)?a+=1:a+=.3);return cscore=a/s,debug[13]&&(console.log("[units_topics_correspondence_twoway_comparison] s1:",e),console.log("[units_topics_correspondence_twoway_comparison] s2:",t),console.log("[units_topics_correspondence_twoway_comparison] cscore:",cscore.toFixed(2))),cscore}function get_dataset_units_topics(e,t,s,i,a,r,o){var n="";void 0!==document_qwiz_session_id&&(n=document_qwiz_session_id);var _={qname:e,i_qwiz_qdeck:t,dataset:i,units:a,topics:r,qwiz_session_id:n};o&&(_.callback=o),debug[0]&&(_.qdebug=1),qqc.qjax(e,t,s,"get_dataset_units_topics",_)}function get_combo_units_topics(e,t,s,i,a,r,o){var n="";void 0!==document_qwiz_session_id&&(n=document_qwiz_session_id);var _={qname:e,i_qwiz_qdeck:t,dataset:i,units:a,topics:r,qwiz_session_id:n};o&&(_.callback=o),debug[0]&&(_.qdebug=1),qqc.qjax(e,t,s,"get_combo_units_topics",_)}function subscription_plan_data(e,t){var s,i,a=qqc.set_immediate_payment(e,t);const r="05-04",o=parseInt(r.split("-")[0])-1,n=parseInt(r.split("-")[1]),_=1e3*qqc.get_qwiz_param("current_time_unix"),c=DateFormat.format.date(_,"yyyy"),d=DateFormat.format.date(_,"MM-dd"),l=new Date(parseInt(c),o-2,n).getTime(),u=DateFormat.format.date(l,"MM-dd"),p=new Date(parseInt(c),o-1,n).getTime(),g=DateFormat.format.date(p,"MM-dd");var h=!1;return!a&&d>=r?(s="P-19D295110R601454BM5XCHMY",i=29.95):!a&&d<u?(s="P-62Y81532P85606323NFP47AA",i=39.95):!a&&d<g?(s="P-2J818600MG931162NNGEM3DY",i=49.95,h=!0):(a=!0,s="P-4MH87306J1361740NNGEM5BY",i=49.95),["AdMvaQesYKbCDS3vl8-_Td2bmsnVdwrPl3jbkMzefr3RUZIsmK8BHwUZxEfg_f2m2jfmLJwh4-iEikTC",s,i,a,o,n,h]}function resize_feedback_images(e){$(e).find("img").each((function(){if(!this.qwiz_sizing){var e,t=$(this),s=parseInt(t.parents("div.qwiz-provide_feedback").width()),i=parseInt(t.width());debug[0]&&console.log("[resize_feedback_images] img_width:",i,", container_width:",s),e=i==s?1:1/window.devicePixelRatio;var a=parseInt(i*e),r=parseInt(t.height()*e);t.css({cssText:"border: 1px solid gray !important",width:a+"px",height:r+"px",margin:"0 5px 5px 0",float:"left"}),this.qwiz_sizing=1}}))}function submit_feedback2(e,t,s,i,a){if(a){debug[0]&&console.log("[submit_feedback2] global_data_urls[0].substr (0, 50):",global_data_urls[0].substr(0,50));for(var r=a.length,o=0;o<r;o++)i=i.replace(a[o],'<img src="'+global_data_urls[o]);debug[0]&&console.log("[submit_feedback2] feedback_html.length:",i.length)}var n,_,c,d;if("qwiz_"==e?(n="div#qwiz"+t,_="qwiz",c=qwiz_.get_qwizdata,d=$("div.header-qwiz"+t).html()):(n="div.qcard_card-qdeck"+t,_="qdeck",c=qcard_.get_deckdata,d=$("div#qcard_header-qdeck"+t).html()),provide_feedback_html[n]=i,i.length>25e6)return alert("Sorry, your feedback is too big (large images). Please use smaller/fewer images."),!1;var l=c(t,"qrecord_id"),u=document_qwiz_qdeck_maker_ids[_+t],p={feedback_html:i,page_url:window.location.href,user_agent:navigator.userAgent,qwiz_qcard:n,qname:e,header_html:d,i_qwiz:t,i_question:s,maker_id:u,taker_username:document_qwiz_username,taker_email:document_qwiz_email};qqc.jjax(e,t,l,"receive_feedback",p)}
3function qwiz_deck_selector(e,t){return("qwiz_"==e?"div#qwiz"+t:"div.qcard_card-qdeck"+t)+" "}function set_display_pay_screen(e,t){var s;return s=get_qwizdeckdata(e,t,"display_pay_screen"),debug[0]&&console.log("[set_display_pay_screen] i_qwiz_deck:",t,", display_pay_screen:",s),s}function register_taker_open_register_pay_feedback(e,t){htm.push("<p>"),htm.push("Thanks. "),htm.push("</p>"),qqc.$get_login_div(e,t).html(htm.join("\n")).show()}function register_taker_registered_feedback(e,t,s,i){debug[0]&&(console.log("[register_taker_registered_feedback] qname:",e),console.log("[register_taker_registered_feedback] proceed_to_pay_f:",i));var a="";"qwiz_"==e&&(a=get_qwizdeckdata(e,t,"display_pay_screen"));var r=[];if(i)if("free_trial"==a)document_qwiz_good_through_date_ok=!0;else{if(/register/.test(a)){qwiz_.pay_lock_settings();return setTimeout((function(){qwiz_.display_login(t,!1,"pay","")}),500),!1}"qwiz_"==e?qwiz_.display_login(t,!1,"pay","",1):qcard_.display_login(t,!1,"pay","",1)}else{if(s){plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));const e=plugin_url+"images/spinner40x40.gif";r.push('<img src="'+e+'" class="qwiz-center" style="margin-top: 70px;" />'),r.push("<p>"),r.push("You are now logged in so that your work can be recorded. "),r.push("In the future, use the pull-down triangle at the top right of any quiz or deck to log in."),r.push("</p>"),r.push("<p>"),r.push("The green triangle also gives you a menu option to view your scores."),r.push("</p>"),r.push("<p>")}else r.push("<br />"),r.push("<br />"),r.push("<p>"),r.push("<b>Thank you. You are now registered for class "+register_taker_global_reg_code_class_name+", "+register_taker_global_reg_code_school_name+"</b>"),r.push("</p>"),r.push("<p>"),r.push("When you do a quiz or flashcard deck, be sure to log in (under the"),r.push("pull-down triangle icon at the top right of any quiz or deck)."),r.push("</p>"),a||(i=register_taker_global_reg_code_ok_f?0:1,r.push('<button class="qwiz_button" onclick="'+e+".login_ok ("+t+", 0, "+i+')">'),r.push("Continue"),r.push("</button>"));qqc.$get_login_div(e,t).html(r.join("\n")).show()}return!1}function extract_delete_shortcode_content(e,t,s,i){for(var a=[],r="["+t+"]",o="[/"+t+"]";;){var n=e.indexOf(r);if(-1==n)break;if(e.indexOf(o)<n)i.additional_errmsgs.push(r+" "+qqc.T("found, but not")+" "+o);else{var _=new RegExp("(<[^\\/][^>]*>\\s*)*?\\["+t+"\\]([\\s\\S]*?)\\[\\/"+t+"\\]((<\\/[^>]+>\\s*)*)","m"),c=e.substr(n).match(_);a.push(c[2]),e=e.replace(_,"")}if(!s)break}return{htm:e,content:a=a.length?a.join(""):"NA"}}function add_span_if_empty(e,t){t||-1!=e.search(/\S/)?-1==e.replace(/ | | | | /,"").search(/\S/)&&(e+='<span class="qwiz-avoid-br" style="display: none;">x</span>'):e="";return e}function htmlDecode(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}this.create_progress_bars3=function(e){debug[12]&&console.log("[create_progress_bars3] data:",e);var t,s=document_qwiz_user_logged_in_b,i=e.qname,a=e.i_qwiz_qdeck,r=e.qrecord_id;if(s){var o=e.units,n=e.n_correct_by_unit_topic,_=e.n_questions_by_unit_topic;t=o.length;for(var c=0,d=0,l=0;l<t;l++)c+=n[l],d+=_[l]}var u=[];const p=qwiz_.get_qwizdata(a,"qwiz_timer");if(u.push('<div id="progress_bars_leaderboard_tabs_'+i+a+'" class="progress_bars_leaderboard_tabs">'),u.push("<ul>"),p&&(u.push("<li>"),u.push('<a href="#leaderboard_tab_'+i+a+'">'),u.push("Fastest finish times"),u.push("</a>"),u.push("</li>")),u.push("</ul>"),p){u.push('<div id="leaderboard_tab_'+i+a+'" class="leaderboard">'),u.push('<div id="leaderboard-quiz_times_histogram-qwiz'+a+'">'),u.push("</div>"),u.push('<div class="refresh_leaderboard">'),u.push("Refresh every"),u.push('<select onchange="'+qqcname+".refresh_leaderboard_change (this, '"+i+"', "+a+", '"+r+"')\">");var g=["","5","10","15","30","60"],h=g.length;for(l=0;l<h;l++){var q=leaderboard_refresh_sec==g[l]?" selected":"";u.push('<option value="'+g[l]+'"'+q+">"),u.push(g[l]),u.push("</option>")}u.push("</select>"),u.push(" seconds"),u.push("</div>"),u.push('<button class="qwiz_button exit_progress_bars" style="float: right;" onclick="'+i+".no_login ("+a+', false, true, event)">'),u.push("Continue"),u.push("</button>"),u.push("</div>")}
3u.push("</div>"),$(i?"qwiz_"==i?"#qwiz_login-qwiz"+a:"div.qcard_card-qdeck"+a+" div.qcard-front div.qcard_content_size":"#progress_bars"+a).html(u.join("\n")).show();var m=0;if("leaderboard"==progress_bars_leaderboard[i+a]&&(m=1,qqc.qjax(i,a,r,"get_quiz_times",{full_quiz_f:1,summary:0})),$("#progress_bars_leaderboard_tabs_"+i+a).tabs({active:m,activate:function(e,t){t.newPanel.hasClass("leaderboard")&&(debug[12]&&console.log("[create_progress_bars3 > leaderboard activate] qrecord_id:",r),qqc.qjax(i,a,r,"get_quiz_times",{full_quiz_f:1,summary:0}))}}),s){if(t>1)for(l=0;l<t;l++){if("(excluded)"!=o[l]){var f=parseInt(100*n[l]/_[l],10),w=$("#unit_progress_bar-"+i+a+"-unit"+l);w.progressbar({value:f});var b=n[l]+"/"+_[l];w.find("div.progress-label").text(b)}}var v=$("#course_progress_bar-"+i+a);f=parseInt(100*c/d,10);v.progressbar({value:f});b=c+"/"+d;v.find("div.progress-label").text(b)}},this.refresh_leaderboard_change=function(e,t,s,i){if(void 0!==refresh_leaderboard_timeout[s]&&clearTimeout(refresh_leaderboard_timeout[s]),leaderboard_refresh_sec=e.value){var a=function(){qqc.qjax(t,s,i,"get_quiz_times",{summary:0}),refresh_leaderboard_timeout[s]=setTimeout(a,1e3*leaderboard_refresh_sec)};refresh_leaderboard_timeout[s]=setTimeout(a,1e3*leaderboard_refresh_sec)}},this.update_leaderboard_opt_out=function(e,t,s){var i=s.checked?1:0;qqc.qjax(e,t,"","update_leaderboard_opt_out",{opt_out_f:i})},this.create_use_dataset_options=function(e,t,s){"qwiz_"==e?$("#progress-qwiz"+s).html(""):$("#progress-qdeck"+s).html(""),plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));const i='<img src="'+(plugin_url+"images/spinner40x40.gif")+'" class="qwiz-center" style="margin-top: 100px;" />';qqc.$get_login_div(e,s).html(i).show(),use_dataset_options_display_name[e+s]=t[s].use_dataset_options_display_name;const a=t[s].qrecord_id,r=t[s].use_dataset;qqc.create_use_dataset_options2(e,s,r,a)},this.create_use_dataset_options2=function(e,t,s,i){if(debug[11]&&console.log("[create_use_dataset_options2] dataset:",s,", qrecord_id:",i),/\|\s*unit:/.test(s))var[s,a,r]=qqc.parse_use_dataset(s);else var a=[],r=[];"qwiz_"==e&&qwiz_.get_qwizdata(t,"combo")?get_combo_units_topics(e,t,i,s,a,r):get_dataset_units_topics(e,t,i,s,a,r)},this.create_use_dataset_options3=function(e,t,s){var i,a,r,o;debug[11]&&console.log("[create_use_dataset_options3] data:",e),dataset_units_topics_data=e;var n,_=[],c=[],d=[],l=[],u=[],p=[],g=[],h=[],q=[],m=[],f=1,w=[0],b=[],v={},k=[];if(selected_levels[t+s]&&(k=selected_levels[t+s]),void 0!==e.datasets_data){f=e.datasets_data.length,w=[...Array(f).keys()],n=[],o=[],a=[];for(let t of w){let s=e.datasets_data[t];[_[t],c[t],d[t],l[t],u[t],p[t],g[t],h[t],q[t],n[t],m[t],v]=units_topics_counts(s,v,k),o.push(s.dataset),a.push(s.qrecord_id),b.push(s.q_f),u[t].NA=1,g[t].NA=1,p[t].NA__NA=0,h[t].NA__NA=0}debug[11]&&console.log("[create_use_dataset_options3] n_cg_by_unit_topic:",h),n=-1==n.indexOf(!1);var z=e.datasets_data[0];t=z.qname,s=z.i_qwiz_qdeck,r=o.join("; "),i=a.join("; ");for(var y=create_units_topics_correspondence(_,c),x=[],T=[],S=y[0].length,j="",C=0;C<S;C++){if(-1!=(re=y[0][C]))ee=_[0][re],te=c[0][re];else for(let e=1;e<f;e++)-1!=(re=y[e][C])&&(ee=_[e][re],te=c[e][re]);x.push(ee),T.push(te),j=ee}l[0]=units_topics_sort(x,T),debug[0]&&(console.log("[create_use_dataset_options3] sort_units:",x),console.log("[create_use_dataset_options3 sort_topics:",T),console.log("[create_use_dataset_options3 unit_topic_order[0]:",l[0]))}else[_[0],c[0],d[0],l[0],u[0],p[0],g[0],h[0],q[0],n,m[0],v]=units_topics_counts(e,v,k),a=[i=e.qrecord_id],o=[r=e.dataset],b=[e.q_f];(v=Object.keys(v)).sort();var M=e.dataset_reset_questions_date;M||(M="");e.maker_specific_random;var A=e.maker_specific_questions_cards_to_show;A||(A=0);var P=qqc.$get_login_div(t,s);if(e.errmsg)return P.html("<br /><b>"+e.errmsg+"</b>").show(),!1;var O,N=0;for(var S of d)N+=S;if(0==N)return O="qwiz_"==t?qqc.T("You have completed all questions correctly"):qqc.T("You have marked all cards")+" “"+qqc.T("Got it!")+"”",P.html("<br /><b>"+O+"</b>").show(),!1;maker_specific_n_qs_by_unit_topic=[];for(let e of w)maker_specific_n_qs_by_unit_topic[e]={};"not ready"==icon_expand_src&&(plugin_url||(plugin_url=qqc.get_qwiz_param("url","./")),icon_expand_src=plugin_url+"images/icon_expand.gif",icon_collapse_src=plugin_url+"images/icon_collapse.gif");var I=[],E=o[0];use_dataset_options_display_name[t+s]&&(E=use_dataset_options_display_name[t+s]),E=E.replace(/_/g," "),/cb=1/.test(document.location.search)&&(E=E.replace(/(AP|HS|High School) Bio(logy)*/gi,"Biology"));var D="topics_only"==get_qwizdeckdata(t,s,"dataset_intro_f"),R=get_qwizdeckdata(t,s,"dataset_intro_info_only_msg"),B="qwiz_"==t?qqc.T("questions"):qqc.T("cards");R&&I.push('<span class="qwiz_errmsg">'+R+"</span><br />"),I.push('<div class="use_dataset_options_header">'+E+"</div>");var F="";const H=m[0].Other;if(!n||void 0!==H&&!H){n&&qqc.set_qwizdeckdata(t,s,"expand_topics",!0),D||("qwiz_"==t?qwiz_.get_qwizdata(s,"qwiz_timer")?I.push('<p class="use_dataset_options">'+qqc.T("Note: you can do subsets, but you have to do all questions for the leaderboard")+"</p>"):I.push('<p class="use_dataset_options">'+qqc.T("Choose the type of questions you want to practice")+"</p>"):I.push('<p class="use_dataset_options">'+qqc.T("Choose the type of cards you want to practice")+"</p>")),I.push('<table id="dataset_units_topics-'+t+s+'" class="dataset_units_topics" align="center">'),I.push("<tr>"),I.push("<th>"),I.push("</th>");var L=D?"hidden":"visible";I.push("<th>"),I.push('<input type="checkbox" onclick="qwiz_qcards_common.dataset_units_topics_toggle_all (this)" style="visibility: '+L+'" checked />'),I.push("</th>"),I.push("<th>"),I.push('<span class="units_header">Unit</span>'),I.push("</th>"),I.push("<th>"),I.push('<span class="topics_header">Topic</span>'),I.push("</th>");let e=selected_levels[t+s],a="",r="",o="",b="";
3if(v.length&&(o='<span style="visibility: hidden;">*</span>',e&&e.length>1&&(a=1==v.length?qqc.T("Includes additional questions if level selected below"):qqc.T("Includes additional questions if levels selected below"),r="*",o="",F=" qwiz-blue",b='style="cursor: help;" ')),I.push(`<th class="qwiz-center${F}" ${b}colspan="9" title="${a}">`),i&&!0===document_qwiz_user_logged_in_b?"qwiz_"==t?I.push(o+qqc.T("Correct")+r):I.push(o+"“"+qqc.T("Got it!")+"”"+r):"qwiz_"==t?I.push(o+"Qs"+r):I.push(o+"Cards"+r),I.push("</th>"),I.push("</tr>"),f>1){I.push("<tr>"),I.push("<td>"),I.push("</td>");L=D?"hidden":"visible";I.push("<td>"),I.push("</td>"),I.push("<td>"),I.push("</td>"),I.push("<td>"),I.push("</td>");var J=qwiz_.get_qwizdata(s,"dataset_labels");for(var Y of((J=J.split("; ")).length!=f&&(J=[...Array(f+1).keys()].slice(1)),J))I.push('<td class="qwiz-right qwiz-bold" style="padding-right: 8px;">'),I.push(Y),I.push("</td>");I.push("</tr>")}j="";var U,V,Q=-1,W=new Array(f).fill(0),K=new Array(f).fill(0),G=new Array(f).fill(0),X=new Array(f).fill(0),Z=A/q[0];Z>1&&(Z=1),V=f>1?y[0].length:d[0];for(C=0;C<V;C++){var ee,te,se=l[0][C],ie=[],ae=[];if(f>1){ee=x[se],te=T[se];for(let e of w){var re;-1!=(re=y[e][se])?(ie[e]=_[e][re],ae[e]=c[e][re]):(ee=j,ie[e]="NA",ae[e]="NA")}C}else{let e=0;ee=_[e][se],te=c[e][se],ie[0]=ee,ae[0]=te,se}if(ee!=j){Q++,j=ee;var oe=t+s+"-unit"+Q,ne=ee.replace(/[^a-z0-9 ]/gi,"_"),_e=[];for(let e of w)_e[e]=ie[e].replace(/[^a-z0-9 ]/gi,"_");var ce=[],de=0;for(let e of w)ce[e]=u[e][_e[e]],A&&(ce[e]=Math.ceil(ce[e]*Z),G[e]+ce[e]>A&&(ce[e]=Math.max(A-G[e],0)),X[e]=0),de+=ce[e];if(de>0){I.push('<tr id="'+oe+'" class="unit_head">'),I.push('<td style="padding-right: 5px;">'),m[_e[0]]||I.push('<img src="'+icon_expand_src+'" class="expand expand_collapse expand_collapse_unit qwiz-inline" onclick="qwiz_qcards_common.dataset_unit_expand_collapse (\''+t+"', "+s+', this)" title="'+qqc.T("Show/hide topics in this unit")+'" />'),I.push("</td>"),I.push("<td>"),I.push('<input type="checkbox" class="toggle_topics" style="visibility: '+L+'" onclick="qwiz_qcards_common.dataset_unit_toggle_topics (this)" title="'+qqc.T("Select/deselect all topics in this unit")+'" checked />'),I.push("</td>"),I.push('<td colspan="2" class="unit">'),I.push("<b>"),I.push(ee.replace(/_/g," ")),I.push("</b>"),I.push("</td>");for(let e of w){I.push('<td class="qwiz-right qwiz-nowrap nquestions '+ne+'">');var le="";i&&!0===document_qwiz_user_logged_in_b&&(le=`${g[e][_e[e]]}/`),le+=ce[e],I.push("<b>"),I.push(le),I.push("</b>"),I.push("</td>"),G[e]+=ce[e]}I.push("</tr>")}}var ue=ee+"__"+te;ue=ue.replace(/[^a-z0-9 ]/gi,"_");var pe=[],ge=[];for(let e of w)pe[e]=ie[e]+"__"+ae[e],pe[e]=pe[e].replace(/[^a-z0-9 ]/gi,"_"),ge[e]=p[e][pe[e]];if(debug[11]&&console.log("[create_use_dataset_options3] ounit_otopic_class:",pe),de>0){var he=0;for(let e of w)A&&(ge[e]=Math.ceil(ge[e]*Z),X[e]+ge[e]>ce[e]&&(ge[e]=Math.max(ce[e]-X[e],0)),maker_specific_n_qs_by_unit_topic[e][pe[e]]=ge[e]),he+=ge[e];if(he>0||f>1){I.push('<tr class="unit_topic unit_topic'+Q+'" data-unit="'+btoa(ee)+'">'),I.push("<td>"),I.push("</td>");var qe=t+s+"-unit_topic"+se;I.push("<td>"),I.push('<input type="checkbox" id="'+qe+'" style="visibility: '+L+'" checked />'),I.push("</td>"),I.push("<td>"),I.push("</td>");const e=te.replace(/^(\d{1,2}\.\d+-*(\d\.*\d*)*[\., _]*)*/,"").replace(/_/g," ");I.push('<td class="topic" data-topic="'+btoa(te)+'">'),I.push(e),I.push("</td>");for(let e of w){I.push(`<td class="qwiz-right qwiz-nowrap nquestions ${ue}" data-unit="${btoa(ie[e])}" data-topic="${btoa(ae[e])}">`);le="";i&&!0===document_qwiz_user_logged_in_b&&(debug[11]&&void 0===h[e][pe[e]]&&console.log(`n_cg_by_unit_topic[${e}][${pe[e]}]`),le=`${h[e][pe[e]]}/`),le+=ge[e],I.push(le),I.push("</td>"),W[e]+=ge[e],K[e]+=h[e][pe[e]],X[e]+=ge[e]}I.push("</tr>")}}}I.push('<tr class="border-top">'),I.push("<td>"),I.push("</td>"),I.push("<td>"),I.push("</td>"),I.push('<td colspan="2">'),I.push("<b>"),I.push(qqc.T("Total")),I.push("</b>"),I.push("</td>"),U=0;for(let e of w){I.push('<td class="qwiz-right qwiz-nowrap">');le="";W[e]?(i&&!0===document_qwiz_user_logged_in_b&&(le=`${K[e]}/`),le+=W[e],U+=W[e]):le="–",I.push("<b>"),I.push(le),I.push("</b>"),I.push("</td>")}I.push("</tr>"),I.push("</table>")}else{let e=0;U=A||p[e].Other__Other;K=h[e].Other__Other;I.push("<br /><br />"),"qwiz_"==t?(I.push("<b>"+qqc.T("Questions")+": "+U),i&&!0===document_qwiz_user_logged_in_b&&I.push("  "+qqc.T("Correct")+": "+K),I.push("</b><br />")):(I.push("<b>"+qqc.T("Cards")+": "+U),i&&!0===document_qwiz_user_logged_in_b&&I.push("  “"+qqc.T("Got it!")+"”: "+K),I.push("</b><br />"))}if(!R){var me,fe;if(me=A?0:get_qwizdeckdata(t,s,"qwiz_"==t?"questions_to_show":"cards_to_show"),I.push('<p class="use_dataset_options">'),fe="qwiz_"==t?qqc.T("'Redo' - questions done before this date will not be counted in totals"):qqc.T("'Redo' - cards done before this date will not be counted in totals"),I.push("Restart:"),I.push('<input type="date" id="dataset_reset_questions_date_'+t+s+'" class="dataset_reset_questions_date" value='+M+" />"),I.push('<img src="'+plugin_url+'images/info_icon.png" class="qwiz_icon_smaller qwiz-inline" style="cursor: help;" title="'+fe+'">'),I.push(" "),D?I.push(B):I.push(qqc.T("Max to practice in this session")+":"),I.push('<select id="dataset_max_q_'+t+s+'" class="dataset_max_q">'),D)I.push("<option selected>"),I.push(U),I.push("</option>");else{var we=[5,10,20,30,50];debug[11]&&we.unshift(3);var be=!1;if("qwiz_"==t){const e=get_qwizdeckdata(t,s,"default_max_to_practice");e&&(me=e)}var ve=we.length;for(se=0;se<ve;se++){if(!be&&me&&we[se]>=me&&(I.push("<option selected>"),I.push(me),I.push("</option>"),be=!0),we[se]>=U){const e=be?"":" selected";I.push("<option"+e+">"),I.push(U),I.push("</option>");break}me&&we[se]==me||(I.push("<option>"),I.push(we[se]),I.push("</option>"))}if(U>we[ve-1]){const e=be?"":" selected";I.push("<option"+e+">"),I.push(U),I.push("</option>")}}if(I.push("</select>"),fe="qwiz_"==t?"Note: questions that you miss will be repeated within this session":"Note: cards that you mark “Need more practice” will be repeated within this session",I.push('<img src="'+plugin_url+'images/info_icon.png" class="qwiz_icon_smaller qwiz-inline" style="cursor: help;" title="'+fe+'">'),I.push("</p>"),i&&!0===document_qwiz_user_logged_in_b&&!D){var ke;I.push('<span class="use_dataset_options">'),I.push("Do "+B+":"),I.push("</span>"),I.push('<label class="qwiz_label use_dataset_options">'),ke="qwiz_"==t?qqc.T("Priority is questions you answered incorrectly and new questions, but questions you answered correctly will sometimes be shown for review"):qqc.T("Priority is cards you marked")+" “"+qqc.T("Need more practice")+"” "+qqc.T("and new cards, but cards you marked")+" “"+qqc.T("Got it!")+"” "+qqc.T("will sometimes be shown for review"),I.push('<input type="radio" name="spaced_repetition" class="qwiz_radio_smaller" value="spaced_repetition" checked />'+qqc.T("Spaced repetition")+'<img src="'+plugin_url+'images/info_icon.png" class="qwiz_icon_smaller qwiz-inline" style="cursor: help;" title="'+ke+'" />  '),I.push("</label>"),I.push('<label class="qwiz_label use_dataset_options">'),I.push('<input type="radio" name="spaced_repetition" class="qwiz_radio_smaller" value="new" />'+qqc.T("New")+" "),I.push("</label>"),I.push('<label class="qwiz_label use_dataset_options">');let e="qwiz_"==t?qqc.T("Incorrect"):"“"+qqc.T("Need more practice")+"”";I.push('<input type="radio" name="spaced_repetition" class="qwiz_radio_smaller" value="incorrect" />'+e+"  "),I.push("</label>"),I.push('<label class="qwiz_label use_dataset_options">'),I.push('<input type="radio" name="spaced_repetition" class="qwiz_radio_smaller" value="all" />'+qqc.T("All")),I.push("</label>"),I.push("<br />")}if(v.length){let e;e=1==v.length?qqc.T("Include level"):qqc.T("Include levels");let i=selected_levels[t+s],a="";for(var ze of(i&&i.length>
31&&(a='<span class="qwiz-bold">*</span>'),I.push(`<span class="use_dataset_options${F}">${a} ${e}:</span>`),v)){let e=`onclick="qwiz_qcards_common.select_level (this, '${ze}', '${t}', ${s})"`,a=i&&-1!=i.indexOf(ze)?"checked":"";I.push(`<label class="use_dataset_options${F}">`),I.push(`<input type="checkbox" class="select_level qwiz_radio_smaller" data-level="${ze}" ${e} ${a} />`+qqc.capitalize(ze)+" "),I.push("</label>")}I.push("<br />")}var ye=qqc.T("Begin practice");let e=0;var $e=`'${qqc.addSlashes(r)}', '${t}', ${s}, '${qqc.addSlashes(i)}', ${q[e]}, 0, 0, '${M}', ${A}, '${b.join("; ")}'`;I.push(`<button class="qwiz_button begin_practice" onclick="qwiz_qcards_common.begin_dataset_quiz_deck (${$e})">`),D&&(ye="qwiz_"==t?qqc.T("Start questions"):qqc.T("Start cards")),I.push(ye),I.push("</button>"),I.push("<br />"),I.push("<br />")}P.html(I.join("\n")).show(),"qcard_"==t&&qcard_.set_container_width_height(s),"qwiz_"==t?$(`div.qwiz-progress_meter-qwiz${s}`).css({"--n":U}):$(`div.qcard-progress_meter-qdeck${s}`).css({"--n":U}),D||get_qwizdeckdata(t,s,"expand_topics")?$("table#dataset_units_topics-qwiz_"+s+" img.expand_collapse_unit").each((function(){qqc.dataset_unit_expand_collapse(t,s,this)})):restore_units_topics_state(t,s)},this.select_level=function(e,t,s,i){var a=qqc.$get_login_div(s,i);selected_levels[s+i]=[""],a.find("input.select_level").each((function(){if(this.checked){let e=$(this).data("level");selected_levels[s+i].push(e)}})),record_units_topics_state(s,i),qqc.create_use_dataset_options3(dataset_units_topics_data,s,i)},this.offset_height_rescale=function(e,t,s){var i=e.outerHeight()*(t-1);s&&(i+=s),e.css({"margin-bottom":i.toFixed(1)+"px"})},this.create_sortable_unit_number=function(e){var t="",s=typeof e;if("number"!=s&&"string"!=s)t="z";else if(""==e)t="z";else{var i=e.split("."),a=i.length;if(a>1){var r=i[1].split("-");i[1]=r[0]}for(var o=Math.min(2,a),n=0;n<o;n++)isNaN(i[n])||(i[n]=("++++++"+i[n]).slice(-6));t=i.join(".")+" "+e}return t},this.shuffle=function(e){for(var t,s,i=e.length;0!==i;)s=Math.floor(Math.random()*i),t=e[i-=1],e[i]=e[s],e[s]=t;return e},firstBy=function(){function e(e,t){if("function"!=typeof e){var s=e,i=window.navigator.userLanguage||window.navigator.language;e=function(e,t){if("number"==typeof e[s]&&"number"==typeof t[s])return e[s]-t[s];var a=e[s]||"zzz",r=t[s]||"zzz";return a.toString().toLowerCase().localeCompare(r.toString().toLowerCase(),i)}}return-1===t?function(t,s){return-e(t,s)}:e}function t(t,i){return(t=e(t,i)).thenBy=s,t}function s(s,i){var a=this;return s=e(s,i),t((function(e,t){return a(e,t)||s(e,t)}))}return t}(),this.create_paypal_subscription_screen=function(e,t,s){$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce");const i=qqc.$get_login_div(e,t),[a,r,o,n,_,c,d]=subscription_plan_data(e,t);var l=[];if(s&&!document_qwiz_user_logged_in_b)return l.push("Please log in"),void i.html(l.join("\n")).show();if(n){const e=new Date(parseInt(today_yyyy),_,c).getTime(),t=DateFormat.format.date(e,"MMMM d, yyyy");l.push(`\n Start your subscription with PayPal or credit card. \n The cost is $${o} for access through ${t}. \n There will no further charges.\n <br />\n `)}else l.push(`\n <b>Start your free trial</b>\n <br />\n Start your two-week free trial with a PayPal or credit card\n authorization. \n There is no charge; you can cancel any time. \n After two weeks you will be charged $${o} per month;\n again, you can cancel any time. \n `);document_qwiz_user_logged_in_b&&document_qwiz_good_through_date&&l.push('\n <br />\n <span class="qwiz-smaller">\n <i>Note: free trials cannot be started with an existing\n account/login name. \n You will have to create a new account with a new login\n name after returning from PayPal<i>.\n </span>\n ');get_qwizdeckdata(e,t,"display_pay_screen");if(debug[0]){const s="test"+(parseInt(1e6*Math.random())+1e5);document_qwiz_good_through_date?l.push(`\n <br />\n <button onclick="qwiz_qcards_common.register_taker_open_register_pay_feedback ('${e}', ${t})">\n open_register test (bypass PayPal)\n </button>\n <br />\n `):l.push(`\n <br />\n <button onclick="qwiz_qcards_common.new_student_license ('${e}', ${t}, {subscriptionID: '${s}'})">\n Test (bypass PayPal)\n </button>\n <br />\n `)}l.push("<br />"),plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));const u='<img src="'+plugin_url+'images/spinner16x16.gif" />';l.push(`\n <script src="https://www.paypal.com/sdk/js?client-id=${a}&vault=true&intent=subscription">\n <\/script>\n <div id="paypal-button-container-${e}${t}" class="qwiz-paypal-button-container" style="width: 250px; height: 150px; margin: auto;">\n ${u}\n </div>\n `),i.html(l.join("\n")).show();var p=0;const g=function(){if("undefined"==typeof paypal)++p<20&&setTimeout(g,250);else{var s=[];if(s.push(`\n <script>\n parent.jQuery ('#paypal-button-container-${e}${t}').html ('');\n paypal.Buttons({\n style: {\
3n height: 40,\n shape: 'pill',\n tagline: false\n },\n createSubscription: function (data, actions) {\n return actions.subscription.create({\n plan_id: '${r}',\n application_context: {\n shipping_preference: 'NO_SHIPPING'\n }\n });\n },\n onApprove: function (data, actions) {\n if (document_qwiz_user_logged_in_b) {\n parent.qwiz_qcards_common.new_student_license ('${e}', ${t}, data);\n } else {\n parent.qwiz_qcards_common.post_paypal_student_registration_and_license ('${e}', ${t}, data);\n }\n }\n }).render("#paypal-button-container-${e}${t}");\n <\/script>\n `),!get_qwizdeckdata(e,t,"display_pay_screen")){const i="qwiz_"==e?"quiz":"flashcard deck";s.push(`\n <div class="qwiz-smaller" style="text-align: right; margin-top: 18px;">\n <button onclick="${e}.no_login (${t}, false, true)">\n Return to ${i}\n </button>\n </div>\n `)}i.append(s.join("\n"))}};setTimeout(g,250)},this.post_paypal_student_registration_and_license=function(e,t,s){debug[0]&&console.log("[post_paypal_student_registration_and_license] data:",s),document_qwiz_subscription_id=s.subscriptionID;const i=get_qwizdeckdata(e,t,"display_pay_screen"),a=qqc.set_immediate_payment(e,t);if("special_offer"==i||document_qwiz_user_logged_in_b&&"free_trial"==i&&a){s={login_f:"",special_offer:1,register_v2:"1",subscription:1,payment_type_id:a?65:52,subscription_id:document_qwiz_subscription_id,called_from:"post_paypal_student_registration_and_license",callback:"special_offer_callback"};return debug[0]&&console.log("[post_paypal_student_registration_and_license] data",s),void qqc.qjax(e,t,"","new_student_registration",s)}var r;r=qqc.set_immediate_payment(e,t)?"Create a new account – or log in with your existing account":"Create a new Learn-Biology.com login account",r+='<br /><span class="qwiz-smaller qwiz-highlight">Please be sure to complete this step in order to access learn-biology.com</span>',"qwiz_"==e?qwiz_.display_login(t,!1,"register",r):qcard_.display_login(t,!1,"register",r)},this.new_student_license=function(e,t,s){debug[0]&&console.log("[new_student_license] data:",s);const i=qqc.$get_login_div(e,t);plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));const a='<img src="'+plugin_url+'images/spinner40x40.gif" />';i.html(a).show(),document_qwiz_subscription_id=s.subscriptionID;s={login_f:"",license_only:1,register_v2:"1",subscription:1,payment_type_id:qqc.set_immediate_payment(e,t)?65:52,subscription_id:document_qwiz_subscription_id,called_from:"new_student_license",callback:"new_student_license_feedback"};debug[0]&&console.log("[new_student_license] data",s),qqc.qjax(e,t,"","new_student_registration",s)},this.new_student_license_feedback=function(e){debug[0]&&console.log("[new_student_license_feedback] data:",e);var t=e.qname,s=e.i_qwiz;e.errmsg;if(e.errmsg){qqc.$get_login_div(t,s).html(e.errmsg).show()}else{if("learn-biology.com"==qqc.get_qwiz_param("server_name")||debug[0]){get_qwizdeckdata(t,s,"display_pay_screen")?document.location="https://learn-biology.com/getstarted":("qwiz_"==t?qwiz_.login_ok(s):qcard_.login_ok(s),window.open("https://learn-biology.com/getstarted","_blank").focus())}}},this.create_pay_screen=function(e,t,s,i,a){debug[0]&&console.log("[create_pay_screen] msg:",i,", pay_now_sign_up:",a);var r=qqc.$get_login_div(e,s),o=[];if(t[s].pay_errmsg)o.push("<strong>"+t[s].pay_errmsg+"</strong><br />");else{i&&o.push(i+"<br />");var n=t[s].taker_payment_type_ids.length;if(0==n||"paid"==qwiz_.get_qwizdata(s,"pay_quiz_ok")){const t=get_qwizdeckdata(e,s,"display_pay_screen");return o.push("<br />"),o.push("<br />"),o.push("<p>"),"open_register"==t?o.push("<b>You are currently signed in to Learn-Biology.com. </b>"):(o.push("<b>You are currently signed in with an account that has access to quizzes and decks. </b>"),o.push("</p>"),o.push("<p>"),o.push("If you need to sign up with a different account, or you need to register for a class, please sign out by clicking on the green down-triangle, above right."),o.push("</p>")),void r.html(o.join("\n")).show()}t[s].any_promo;o.push('<form action="https://www.paypal.com/cgi-bin/webscr" onSubmit="return qwiz_qcards_common.submit_for_payment (\''+e+"', "+s+', this)" method="post" target="_blank">'),o.push('<input type="hidden" name="cmd" value="_s-xclick">'),o.push('<input type="hidden" name="hosted_button_id" value="WH6FWJY29SWN8">');var _=-1,c=0,d=n;void 0!==t[s].i_promo&&-1!=(_=t[s].i_promo)&&(c=_,d=_+1,n=1,a="Pay now"),o.push('<table class="pay_options">'),o.push("<tr>"),o.push("<td>"),o.push('<input type="hidden" name="on0" value="Options">'),n>1&&o.push("Please choose:"),o.push("</td>"),o.push("</tr>"),o.push("<tr>"),o.push("<td>");var l="";n<=2?l=' size="2" style="min-height: 42px;"':3==n?l=' size="3" style="min-height: 64px;"':n>=4&&(l=' size="4" style="min-height: 86px;"'),o.push('<select name="os0" class="qwiz_paypal_select"'+l+" onchange=\"qwiz_qcards_common.update_pay_button (this, '"+e+"', "+s+')">');for(var u=!0,p=!1,g=c;g<d;g++){var h=t[s].taker_fees[g],q=t[s].taker_payment_type_ids[g];if(debug[0]&&19.99==h&&(h="1.00"),!(document_qwiz_good_through_date_ok&&h<=0||8==q||65==q)){var m,f=t[s].taker_good_for_n_periodss[g],w=t[s].taker_good_for_periods[g],b=t[s].taker_payment_descriptions[g],v=t[s].taker_payment_selected_bs[g];h<=0?(m=qqc.capitalize(qqc.number_to_word(f))+" "+qqc.plural(w,w+"s",f),0==g&&(v=!0,p=!0)):(m=qqc.currency(h)+" "+qqc.number_to_word(f)+" "+qqc.plural(w,w+"s",f),a&&"Pay now"==a&&(p||(v=!0,p=!0))),b&&(m+=" - "+(b=(b=b.replace(/<\/{0,1}b>/gi,"")).replace(/<[^>]+>.*/,"")));var k=v?" selected":"";o.push('<option value="'+h+'"'+k+">"),o.push(m),o.push("</option>"),h>0&&(u=!1)}}o.push("</select> "),o.push("</td>"),o.push("</tr>"),o.push("</table>"),o.push('<input type="hidden" name="currency_code" value="USD">'),u||t[s].taker_fees[0]<=0&&(!a||"Sign up"==a)?(sign_up_display="block",paypal_display="none"):(sign_up_display="none",paypal_display="block");var z='style="display: '+sign_up_display+';"';o.push('<div class="sign_up_button" '+z+">"),o.push('<input type="submit" class="qwiz_button" value="Sign up" />'),o.push('<div class="signup_confirm_email_errmsg qwiz_errmsg" style="display: none;">'),o.push("</div>"),o.push("</div>"),z='style="display: '+paypal_display+';"',o.push('<div class="paypal_button" '+z+">"),o.push('<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" style="border: none;" name="submit" alt="PayPal - The safer, easier way to pay online!">'),o.push('<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">'),o.push("</div>"),o.push('<input type="hidden" name="custom">'),o.push("</form>"),o.push("<button onclick=\"qwiz_qcards_common.payment_received (1, '"+e+"', "+s+')" class="qwiz_pay_cancel qwiz-smaller">'),o.push("Cancel"),o.push("</button>")}r.html(o.join("\n")).show()}
3,this.update_pay_button=function(e,t,s){var i=qwiz_deck_selector(t,s);$(i+" div.signup_confirm_email_errmsg").hide(),e.value<="0.00"?($(i+"div.sign_up_button").show(),$(i+"div.paypal_button").hide()):($(i+"div.sign_up_button").hide(),$(i+"div.paypal_button").show())},this.hide_signup_confirm_email_errmsg=function(e){$(e).parents("div.sign_up_button").find("div.signup_confirm_email_errmsg").hide()},this.update_email_callback=function(e,t,s){debug&&console.log("[update_email_callback] qname:",e,", i_qwiz:",t,", errmsg:",s);var i=qwiz_deck_selector(e,t);if("need_password"==s)return qqc.create_password_dialog(e,t),$dialog_current_password.dialog("open"),!1;"password_incorrect"==s?$("#current_password_errmsg").html("Password incorrect"):"not_unique"==s?($(i+" div.update_email_errmsg").html("Email address already in use"),$(i+" span.confirm_email_address").addClass("qwiz_button_disabled")):"fail"==s?$(i+" div.update_email_errmsg").html("Sorry, unable to update email"):"ok"==s&&(document_qwiz_email=$(i+" input.confirm_email_address").val(),qqc.confirm_email2(e,t)),$dialog_current_password&&$dialog_current_password.dialog("close")},this.update_email_hide_error=function(e,t){var s=qwiz_deck_selector(e,t);return $(s+" div.update_email_errmsg").html(""),$(s+" span.confirm_email_address").removeClass("qwiz_button_disabled"),!1},this.confirm_email=function(e,t,s){if($(e).hasClass("qwiz_button_disabled"))return!1;var i=qwiz_deck_selector(t,s),a=$(i+"input.confirm_email_address").val();if(""==a)return $(i+" div.update_email_errmsg").html("Please enter email address"),$(e).addClass("qwiz_button_disabled"),!1;if(a!=document_qwiz_email){return/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(a)?(update_email_data={field:"email",value:a,callback:"qwiz_qcards_common.update_email_callback"},$(i+" span.confirm_email_address").addClass("qwiz_button_disabled"),qqc.qjax(t,s,"","update_my_account",update_email_data)):($(i+" div.update_email_errmsg").html("Not a valid email address"),$(e).addClass("qwiz_button_disabled")),!1}qqc.confirm_email2(t,s)},this.confirm_email2=function(e,t){var s=qwiz_deck_selector(e,t);$(s+" .signup_confirm_email").css({visibility:"visible"}),$(s+" input.signup_confirm_email").val("").focus(),$(s+" input.sign_up").removeClass("qwiz_button_disabled").prop("disabled",!1),$(s+" div.signup_confirm_email_errmsg").hide();var i={field:"email_confirm",value:"",email_address:$(s+" input.confirm_email_address").val(),username:document_qwiz_username,callback:"qwiz_qcards_common.confirm_email_callback"};qqc.qjax(e,t,"","update_my_account",i)},this.confirm_email_callback=function(e,t,s){debug[0]&&console.log("[confirm_email_callback] errmsg:",s),"need_password"==s&&(qqc.create_password_dialog(e,t),$dialog_current_password.dialog("open"))},this.hide_current_password_errmsg=function(){$("#current_password_errmsg").html("")},this.create_password_dialog=function(e,t){var s=[];s.push('<div id="dialog_current_password" title="Security check: re-enter password">'),s.push("<tr>"),s.push("<td>"),s.push("Password"),s.push("</td>"),s.push("<td>"),s.push('<input id="current_password" type="password" onfocus="qwiz_qcards_common.hide_current_password_errmsg ()" />'),s.push("<br />"),s.push('<div id="current_password_errmsg" class="qwiz_errmsg">'),s.push("</div>"),s.push("</td>"),s.push("</tr>"),s.push("</div>"),$("body").append(s.join("\n")),$dialog_current_password=$("#dialog_current_password").dialog({autoOpen:!1,height:200,width:350,modal:!0,buttons:{Submit:function(){qqc.update_session_id(e,t)},Cancel:function(){$dialog_current_password.dialog("close")}}})},this.update_session_id=function(e,t){var s=$("#current_password").val();""!=s?(update_email_data.sha3_current_password=CryptoJS.SHA3(s).toString(),update_email_data.current_username=document_qwiz_username,qqc.qjax(e,t,"","update_my_account",update_email_data)):$("#current_password_errmsg").html("Please enter password")},this.create_enroll_screen=function(e,t){var s=[];s.push('<p style="font-weight: normal; text-align: left; margin: 0 0 0 10px;">'),s.push("You are currently registered as an “independent student,” not enrolled in a school or class. "),s.push("If you have a registration code you can join a class. "),s.push("<br />(Any work you have completed on quizzes and flashcard decks will be transferred to the teacher’s gradebook.)"),s.push("</p>"),s.push('<table class="qwiz-border-none qwiz-padding" border="0" align="center"'),s.push("<tr>"),s.push('<td style="vertical-align: top;">'),s.push("<b>Registration code</b>"),s.push("</td>"),s.push("<td>"),s.push('<input type="text" class="enroll_screen_reg_code" style="padding: 2px;" onfocus="qwiz_qcards_common.hide_enroll_error ()" onkeydown="qwiz_qcards_common.enroll_registration_code_keydown (\''+e+"', "+t+');" />'),s.push('<div class="enroll_screen_reg_code_errmsg qwiz_errmsg"></div>'),s.push('<div class="enroll_screen_reg_code_class_name"></div>'),s.push("</td>"),s.push("</tr>"),s.push("<tr>"),s.push("<td>"),s.push("</td>"),s.push("<td>"),s.push('<button class="enroll_check_reg_code qwiz_button" onclick="qwiz_qcards_common.check_reg_code (\''+e+"', "+t+')">'),s.push("Check code"),s.push("</button>"),s.push('<button class="enroll_join_class qwiz_button" style="display: none;" onclick="qwiz_qcards_common.reset_independent_student (\''+e+"', "+t+')">'),s.push("Join class"),s.push("</button>"),plugin_url||(plugin_url=qqc.get_qwiz_param("url","./")),s.push('<img class="enroll_spinner" style="display: none;" src="'+plugin_url+'images/spinner16x16.gif" />'),s.push("</td>"),s.push("</tr>"),s.push("</table>"),s.push('<div style="text-align: right; padding-right: 10px;">'),s.push('<button class="qwiz-smaller" onclick="'+e+".no_login ("+t+', false, true)">'),s.push("Cancel"),s.push("</button>"),s.push("</div>");qqc.$get_login_div(e,t).html(s.join("\n")).show()},this.create_refresh_page_notice=function(e,t){qqc.$get_login_div(e,t).html('\n <div class="qwiz-center">\n <br />\n <br />\n <p>\n <b>Score-recording authentication expired.\n <br />\n Please re-load this page to continue</b>\n </p>\n </div>\n ').show()}
3,this.check_reg_code=function(e,t){var s=qwiz_deck_selector(e,t),i=$(s+"input.enroll_screen_reg_code").val();if(""!=i){$(".enroll_spinner").show();var a={reg_code:i,js_f:1};qqc.qjax(e,t,"","check_reg_code",a)}return!1},this.reg_code_ok_or_no=function(e){debug[0]&&console.log("[reg_code_ok_or_no] data:",e);var t=qwiz_deck_selector(e.qname,e.i_qwiz);$(t+".enroll_spinner").hide(),(enroll_reg_code_ok_f=1==e.num_rows)?(enroll_reg_code_school_id=e.school_id,enroll_reg_code_school_name=e.school_name,enroll_reg_code_class_id=e.class_id,enroll_reg_code_class_name=e.class_name,$(t+"div.enroll_screen_reg_code_class_name").html("<b>Registration for class "+e.class_name+", "+e.school_name+"</b>").show(),$(t+"button.enroll_check_reg_code").hide(),$(t+"button.enroll_join_class").show()):($(t+"div.enroll_screen_reg_code_errmsg").html("Could not find registration code").show(),$(t+"div.enroll_screen_reg_code_class_name").html("").hide())},this.hide_enroll_error=function(){$("div.enroll_screen_reg_code_errmsg").html("").hide()},this.enroll_registration_code_keydown=function(e,t){debug[0]&&console.log("[enroll_registration_code_keydown] enroll_reg_code_ok_f:",enroll_reg_code_ok_f);var s=qwiz_deck_selector(e,t);enroll_reg_code_ok_f?($(s+"button.enroll_join_class").hide(),$(s+"button.enroll_check_reg_code").show()):($(s+"div.enroll_screen_reg_code_errmsg").html("").hide(),$(s+"div.enroll_screen_reg_code_class_name").html("").hide())},this.reset_independent_student=function(e,t){debug[0]&&console.log("[reset_independent_student]");var s=qwiz_deck_selector(e,t);if(""==$(s+"input.enroll_screen_reg_code").val())return $("div.enroll_screen_reg_code_errmsg").html("Please enter registration code").show(),!1;$(s+".enroll_spinner").show();var i={jjax:1,school_id:enroll_reg_code_school_id,class_id:enroll_reg_code_class_id,taker_id:document_qwiz_taker_id};return qqc.qjax(e,t,"","reset_independent_student",i),!1},this.reset_independent_student_callback=function(e){if(debug[0]&&console.log("[reset_independent_student_callback] data:",e),"ok"==e.errmsg)e.jjax=1,qqc.qjax(e.qname,e.i_qwiz,"","add_to_class",e);else{var t=[];t.push("<br /><p><b>Sorry, unable to reset status</b></p>"),t.push('<button class="qwiz_button" onclick="'+e.qname+".no_login ("+e.i_qwiz+', false, true, event)">'),t.push("Continue"),t.push("</button>"),t=t.join("\n"),qqc.$get_login_div(e.qname,e.i_qwiz).html(t).show()}},this.add_to_class_callback=function(e){debug[0]&&console.log("[add_to_class_callback] data:",e);const t=e.qname,s=e.i_qwiz;var i=qwiz_deck_selector(t,s);$(i+".enroll_spinner").hide();var a=[];"ok"==e.errmsg?(document_qwiz_school_id=enroll_reg_code_school_id,document_qwiz_class_id=enroll_reg_code_class_id,document_qwiz_independent_taker_f=!1,qqc.set_user_menus_and_icons(),qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(s,s),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(s,s),a.push("<br /><p><b>You are now enrolled in "+enroll_reg_code_class_name+", "+enroll_reg_code_school_name+"</b></p>")):a.push("<br /><p><b>Sorry, unable to reset status</b></p>"),a.push('<button class="qwiz_button" onclick="'+t+".no_login ("+s+', false, true, event)">'),a.push("Continue"),a.push("</button>"),a=a.join("\n"),qqc.$get_login_div(t,s).html(a).show()},this.create_provide_feedback_screen=function(e,t,s){var i,a,r=[];if(r.push('<div style="margin-top: 5px">'),r.push("<b>Feedback - bugs, errors, suggestions...?</b>"),r.push("</div>"),r.push('<div class="qwiz-normal qwiz-smaller">'),r.push("Feel free to copy and paste, including screenshots!"),r.push("</div>"),"qcard_"==e){var o=$("div.qcard_card-qdeck"+t),n=o.width()-16,_=.62*o.height();i=' style="width: '+parseInt(n)+"px; height: "+parseInt(_)+'px;"',a="div.qcard_card-qdeck"+t}else i=' style="min-height: 175px;"',a="div#qwiz"+t;r.push('<div class="qwiz-provide_feedback"'+i+' contenteditable="true">'),provide_feedback_html[a]&&r.push(provide_feedback_html[a]),r.push("</div>"),r.push('<div class="qwiz-normal qwiz-smaller" style="text-align: left;">'),r.push("From: "+document_qwiz_username),r.push("</div>"),r.push("<div>"),r.push('<button class="qwiz_button" onclick="qwiz_qcards_common.submit_feedback (\''+e+"', "+t+", "+s+')">'),r.push("Submit"),r.push("</button>"),r.push(" "),r.push('<button class="qwiz_button_small qwiz-b_and_w" onclick="qwiz_qcards_common.cancel_provide_feedback (\''+e+"', "+t+')">'),r.push("Back"),r.push("</button>"),r.push('<span class="qwiz-smaller qwiz-normal">'),r.push("(you can return to complete your comments)"),r.push("</span>"),r.push("</div>"),qqc.$get_login_div(e,t).html(r.join("\n")).show();$("div.qwiz-provide_feedback").on("paste",(function(e){var t=this;setTimeout((function(){resize_feedback_images(t)}),100)}))},this.submit_feedback=function(e,t,s){var i=$(("qwiz_"==e?"div#qwiz"+t:"div.qcard_card-qdeck"+t)+" div.qwiz-provide_feedback").html();if(-1!=i.indexOf("<img")){var a=i.match(/<img src="blob:[^"]+/g);if(a){global_blob_urls=[],global_data_urls=[];for(var r=a.length,o=0;o<r;o++){a[o].length;global_blob_urls.push(a[o].substr(10))}qqc.get_blobs_as_data_urls(e,t,s,r,i,a)}else submit_feedback2(e,t,s,i)}else{if(qqc.is_only_tags_and_whitespace(i))return!1;submit_feedback2(e,t,s,i)}},this.remove_empty_opening_tags=function(e){return e=e.replace(/^\s*<(p|h\d)>\s*<\/(p|h\d)>/,"")},this.is_only_tags_and_whitespace=function(e){return-1==(e=(e=qqc.remove_tags_eols(e,!0)).replace(/ | | | | /,"")).search(/\S/)},this.get_blobs_as_data_urls=function(e,t,s,i,a,r){i--;var o=new XMLHttpRequest;o.responseType="blob",o.onload=function(){var n=o.response,_=new FileReader;_.onload=function(){debug[0]&&console.log("[get_blobs_as_data_urls] i_do:",i,", reader.result.length:",_.result.length),global_data_urls.push(_.result),0==i?submit_feedback2(e,t,s,a,r):qqc.get_blobs_as_data_urls(e,t,s,i,a,r)}
3,_.readAsDataURL(n)},o.open("GET",global_blob_urls[i]),o.send()},this.blob_data={},this.get_blob_as_data_url=function(e,t){debug[0]&&console.log("[get_blob_as_data_url] imageUrl:",t);const s=new FileReader;s.onloadend=()=>{const t=s.result;debug[0]&&(console.log("[get_blob_as_data_url] base64data.length:",t.length),console.log("[get_blob_as_data_url] base64data.substr (0, 50):",t.substr(0,50))),qqc.blob_data[e]=t},(async()=>{const e=await fetch(t),i=await e.blob();s.readAsDataURL(i)})()},this.submit_feedback_callback=function(e,t,s,i,a){var r=[];r.push("<p>"),r.push("<b>"+a+"</b>"),r.push("</p>"),i?(provide_feedback_html[s]="",r.push('<button class="qwiz_button" onclick="'+e+".no_login ("+t+', false, true)">'),r.push("Continue"),r.push("</button>")):(r.push('<button class="qwiz-smaller" onclick="'+e+".no_login ("+t+', false, true)">'),r.push("Back"),r.push("</button>")),qqc.$get_login_div(e,t).html(r.join("\n")).show()},this.cancel_provide_feedback=function(e,t){var s,i=$((s="qwiz_"==e?"div#qwiz"+t:"div.qcard_card-qdeck"+t)+" div.qwiz-provide_feedback");provide_feedback_html[s]=i.html(),provide_feedback_html[s].length>2e7&&alert("Please note: the images in your feedback are large. You may want to submit your comments so far before adding more images."),("qwiz_"==e?qwiz_:qcard_).no_login(t,!1,!0)},this.preview_iframe_close=function(){$("div#preview_iframe_wrapper").remove()},this.init_hide_show_password=function(e){$(e).hidePassword(!0,{states:{shown:{toggle:{className:"qwiz-hideShowPassword-toggle-hide"}},hidden:{toggle:{className:"qwiz-hideShowPassword-toggle-show"}}}})},this.create_register_taker_screen=function(e,t,s,i,a){register_taker_global_reg_code_ok_f=!1,register_taker_global_username="",register_taker_global_first_name="",register_taker_global_last_name="",register_taker_global_sha3_password="",register_taker_global_username_unique_f=!1,register_taker_global_email_unique_f=!1;var r=set_display_pay_screen(e,t),o=!1;r||get_qwizdeckdata(e,t,"pay_quiz_deck_id")||(qqc.set_qwizdeckdata(e,t,"display_pay_screen","open_register"),o=!0,r="open_register",i="<b>Create an account to save your work</b>");var n=[];if(i&&(n.push(i+"<br />"),/free/.test(i)&&"free"),n.push(`<form name="register_taker_'${e}${t}" action="nada.php" onSubmit="return qwiz_qcards_common.register_taker ('${e}', ${t}, ${s}, '${a}')">`),n.push('<table class="register_taker">'),"subscribe"!=r&&"special_offer"!=r&&"open_register"!=r){if(n.push("<tr>"),n.push('<td colspan="3" class="register_taker_if_your_teacher" style="font-weight: normal; text-align: center;">'),"signup"==r)n.push("<i>Please enter the registration code you received"),n.push("from Mr. W on TikTok, Youtube, etc.");else if("free_trial"==r||"free_trial"==a){const[s,i,a,o,_,c,d]=subscription_plan_data(e,t);if(o){const e=new Date(parseInt(today_yyyy),_,c).getTime();DateFormat.format.date(e,"MMMM d, yyyy");n.push("<b>Please create an account first. \n Then we will set up your free trial with a PayPal or credit card authorization. </b>\n There is no charge; you can cancel any time.")}else n.push(`<b>Please create an account first. \n Then we will set up your free trial with a PayPal or credit card authorization. </b>\n <br />\n There is no charge; you can cancel any time. \n After two weeks you will be charged $${a} per month;\n again, you can cancel any time. \n `),"free_trial"!=r&&(n.push("(Registering for a class? Go"),n.push('<a href="https://learn-biology.com/register" target="_blank">'),n.push("here</a>)"))}else"special_offer"!=r&&(n.push("<i>Enter the registration code that your teacher gave you</i>"),n.push("<br />"),n.push("(Not in a class? Go"),n.push('<a href="https://learn-biology.com/student-free-trial" target="_blank">'),n.push("here</a>)"));n.push("</td>"),n.push("</tr>"),"free_trial"!=r&&"free_trial"!=a&&(n.push("<tr>"),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="reg_code">'),n.push("Registration code"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push('<input type="text" class="register_taker_reg_code" onchange="qwiz_qcards_common.register_taker_check_reg_code (\''+e+"', "+t+', this.value)" onfocus="qwiz_qcards_common.register_taker_hide_error (\''+e+"', "+t+', this);"> <span class="qwiz-required">*</span>'),n.push('<div class="register_taker_reg_code_errmsg qwiz_errmsg"></div>'),n.push('<div class="register_taker_reg_code_class_name"></div>'),n.push("</td>"),n.push("</tr>"),n.push('<tr class="register_taker_please_continue_below">'),n.push("<td>"),n.push("</td>")),n.push('<td colspan="2" style="font-weight: normal;">'),"signup"==r&&n.push("<i>Please provide the following information. "),n.push("</td>"),n.push("</tr>")}n.push('<tr class="register_taker_login_name_exists">'),n.push("<td>"),n.push("</td>"),n.push('<td colspan="2">'),n.push("<i>This login name exists."),"free_trial"==r||"free_trial"==a?n.push("Either log in to set up a free trial for your account or choose another name to set up a free trial for a new account</i>"):n.push("Either log in or choose another name</i>"),n.push("</td>"),n.push("</tr>"),n.push("<tr>"),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="username">'),n.push("Login name"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push(`<input type="text" class="register_taker_username" onchange="qwiz_qcards_common.register_taker_check_unique ('${e}', ${t}, 'username', '${a}', 'onchange')" onblur="qwiz_qcards_common.register_taker_check_unique ('${e}', ${t}, '${a}', 'username', 'onblur')" onfocus="qwiz_qcards_common.register_taker_hide_error ('${e}', ${t}, this);" /> <span class="qwiz-required">*</span>`),n.push('<div class="register_taker_username_errmsg qwiz_errmsg"></div>'),n.push("</td>"),n.push("</tr>"),n.push('<tr class="register_taker_first_name_last_name">'),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="first_name">'),n.push("First name"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push('<input type="text" class="register_taker_first_name" onfocus="qwiz_qcards_common.register_taker_hide_error (\''+e+"', "+t+', this);" /> <span class="qwiz-required">*</span>'),n.push('<div class="register_taker_first_name_errmsg qwiz_errmsg"></div>'),n.push("</td>"),n.push("</tr>"),n.push('<tr class="register_taker_first_name_last_name">'),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="last_name">'),n.push("Last name"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push('<input type="text" class="register_taker_last_name" onfocus="qwiz_qcards_common.register_taker_hide_error (\''+e+"', "+t+', this);" /> <span class="qwiz-required">*</span>'),n.push('<div class="register_taker_last_name_errmsg qwiz_errmsg"></div>'),n.push("</td>"),n.push("</tr>"),n.push("<tr>"),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="password">'),n.push("Password"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push('<input type="password" class="register_taker_password" onchange="qwiz_qcards_common.register_taker_check_password_match (\''+e+"', "+t+')" onfocus="qwiz_qcards_common.register_taker_hide_error (\''+e+"', "+t+', this);" /> <span class="qwiz-required">*</span>'),n.push('<div class="register_taker_password_errmsg register_taker_confirm_password_errmsg qwiz_errmsg"></div>'),n.push("</td>"),n.push("</tr>"),n.push('<tr class="register_taker_confirm_password register_taker_confirm_password_email">'),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="confirm_password">'),n.push("Confirm password"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push('<input type="password" class="register_taker_confirm_password" onchange="qwiz_qcards_common.register_taker_check_password_match (\''+e+"', "+t+')" onfocus="qwiz_qcards_common.register_taker_hide_error (\''+e+"', "+t+', this);" /> <span class="qwiz-required">*</span>'),n.push("</td>"),n.push("</tr>"),n.push('<tr class="register_taker_email register_taker_confirm_password_email">'),n.push("<td>"),n.push("</td>"),n.push("<td>"),n.push('<label for="email">'),n.push("Email"),n.push("</label>"),n.push("</td>"),n.push("<td>"),n.push(`<input type="text" class="register_taker_email" onchange="qwiz_qcards_common.register_taker_validate_email ('${e}', ${t}, false, true, '${a}')" onfocus="qwiz_qcards_common.register_taker_hide_error ('${e}', ${t}, this);" /> <span class="qwiz-required register_taker_email_required">*</span>`),n.push('<div class="register_taker_email_errmsg qwiz_errmsg"></div>'),n.push("</td>"),n.push("</tr>"),n.push("</tr>"),n.push('<td colspan="2">'),n.push("</td>"),n.push("<td>"),n.push('<span style="float: right;">'),n.push('<span class="qwiz-required ">*</span>'),n.push('<span class="qwiz-smaller">required</span>'),n.push("</span>"),n.push('<button type="submit" class="register_taker_submit qwiz_button">'),n.push('<span class="register_taker_login" style="font-size: 12pt !important;">'),n.push(qqc.T("Register")),n.push("</span>"),n.push("</button>"),n.push(" "),/register|free_trial/.test(r)&&!o||(n.push('<span class="qwiz_button" style="font-size: 9pt !important;" onclick="'+e+".no_login ("+t+', false, true, event)">'),n.push("Cancel"),n.push("</span>")),n.push("<br />"),n.push('<span class="register_taker_forgot_password">'),"not ready"==server_loc&&(secure_server_loc=qqc.get_qwiz_param("secure_server_loc")),n.push('<a href="'+secure_server_loc+'/password_reset_request" target="_blank">'),n.push("Forgot password?</a>"),n.push("</span>"),n.push("</td>"),n.push("</tr>"),n.push("<tr>"),n.push("<td>"),n.push("</td>"),n.push('<td colspan="2" class="register_taker_errmsg qwiz_errmsg">'),n.push("</td>"),n.push("</tr>"),n.push("</table>"),n.push("</form>"),qqc.$get_login_div(e,t).html(n.join("\n")).show();
3var _=qwiz_deck_selector(e,t);if(qqc.init_hide_show_password(_+"input.register_taker_password"),qqc.init_hide_show_password(_+"input.register_taker_confirm_password"),debug[0]){console.log("[create_register_taker_screen] (show email) display_pay_screen:",r);const e=$(_+"tr.register_taker_email");console.log("[create_register_taker_screen] $email:",e)}if($(_+"tr.register_taker_email").hide(),"subscribe"==r||"open_register"==r||"open_register"==a||"free_trial"==r||"free_trial"==a||"special_offer"==r){setTimeout((function(){$(_+"tr.register_taker_email").show(),$(_+".register_taker_username").val("")}),200)}else"signup"==r?($(_+"tr.register_taker_email").show(),$(_+".register_taker_reg_code").val("")):$(_+".register_taker_reg_code").val("");$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce")},this.register_taker_check_password_match=function(e,t){var s=qwiz_deck_selector(e,t);$(s+"button.register_taker_submit").prop("disabled",!0);setTimeout((function(){$(s+"button.register_taker_submit").prop("disabled",!1)}),1e3),$(s+".register_taker_password_errmsg").hide();var i=$(s+".register_taker_password").val();if(""!=i&&/[#?]/.test(i)){setTimeout((function(){$(s+".register_taker_password_errmsg").html("Note: Biomania app will not work with passwords containing “#” or “?”").show()}),20)}var a=$(s+"input.register_taker_confirm_password").val();if(a&&""!=i&&i!=a){return setTimeout((function(){$(s+".register_taker_password_errmsg").html("Password and Confirm password do not match").show()}),40),!1}},this.register_taker_check_reg_code=function(e,t,s){if(""==s){var i=qwiz_deck_selector(e,t);$(i+"tr.register_taker_first_name_last_name").show(),$(i+".register_taker_reg_code_class_name").html("").hide(),$(i+".register_taker_login_name_exists,"+i+" .register_taker_forgot_password").hide(),$(i+"span.register_taker_login").html(qqc.T("Register")),$(i+"tr.register_taker_confirm_password_email").show(),$(i+"tr.register_taker_please_continue_below").show(),$(i+".register_taker_email_required, "+i+"tr.register_taker_email").show(),register_taker_global_reg_code_ok_f=!1,qqc.register_taker_check_unique(e,t,"","username")}else{var a={reg_code:s,callback:"register_taker_reg_code_ok_or_no"};register_taker_global_in_process_b=!0,qqc.qjax(e,t,"","check_reg_code",a)}return!1},this.set_immediate_payment=function(e,t){var s=!1;return void 0===document_qwiz_immediate_payment?"qwiz_"==e&&(s=qwiz_.get_qwizdata(t,"immediate_payment")):s=document_qwiz_immediate_payment,s},this.register_taker_reg_code_ok_or_no=function(e){debug[0]&&console.log("[register_taker_reg_code_ok_or_no] data:",e),register_taker_global_reg_code_ok_f=1==e.num_rows;var t=qwiz_deck_selector(e.qname,e.i_qwiz);if(register_taker_global_reg_code_ok_f){$(t+".register_taker_if_your_teacher").hide(),$(t+"tr.register_taker_please_continue_below").hide(),$(t+"tr.register_taker_first_name_last_name").show(),"signup"!=set_display_pay_screen(e.qname,e.i_qwiz)&&$(t+".register_taker_email_required, "+t+"tr.register_taker_email").hide(),register_taker_global_reg_code_maker_id=e.maker_id,register_taker_global_reg_code_school_id=e.school_id,register_taker_global_reg_code_class_id=e.class_id,register_taker_global_reg_code_class_name=e.class_name,register_taker_global_reg_code_school_name=e.school_name,register_taker_global_reg_code_professor_f=e.professor_f,$(t+".register_taker_reg_code_class_name").html("<b>Registration for class "+register_taker_global_reg_code_class_name+", "+register_taker_global_reg_code_school_name+"</b>").show()}else{var s=e.errmsg?e.errmsg:"Could not find registration code";$(t+".register_taker_reg_code_errmsg").html(s).show(),$(t+".register_taker_reg_code_class_name").html("").hide()}register_taker_global_in_process_b=!1},this.register_taker_check_unique=function(e,t,s,i,a){debug[0]&&console.log("[register_taker_check_unique] field:",s,"which:",a);var r=qwiz_deck_selector(e,t),o=$(r+"input.register_taker_"+s).val();if(debug[0]&&console.log("[register_taker_check_unique] value:",o),o){if("username"==s){if(/["\\;]/.test(o))return $(r+".register_taker_username_errmsg").html("Invalid characters").show(),!1;if(/[#?]/.test(o))return $(r+".register_taker_username_errmsg").html("Note: Biomania app will not work with login names containing “#” or “?”").show(),!1}var n={field:s,value:o,login_alt:i,callback:"register_taker_unique_or_no"};register_taker_global_in_process_b=!0,qqc.qjax(e,t,"","check_taker_name_email_unique",n)}return!1},this.register_taker_unique_or_no=function(e){debug[0]&&console.log("[register_taker_unique_or_no] data:",e);
3var t=qwiz_deck_selector(e.qname,e.i_qwiz),s=e.field,i=e.unique_f;if("username"==s){var a=e.login_alt;get_qwizdeckdata(e.qname,e.i_qwiz,"display_pay_screen");register_taker_global_username_unique_f=i,0==i?(debug[0]&&console.log('[register_taker_unique_or_no] "username already in use"'),$(t+".register_taker_login_name_exists, "+t+".register_taker_forgot_password").show(),$(t+"tr.register_taker_first_name_last_name").hide(),$(t+"tr.register_taker_confirm_password_email").hide(),$(t+"span.register_taker_login").html(qqc.T("Log in")),$(t+".register_taker_password").focus()):($(t+"span.register_taker_login").html(qqc.T("Register")),$(t+".register_taker_username_errmsg").hide(),$(t+"tr.register_taker_first_name_last_name").show(),$(t+".register_taker_login_name_exists, "+t+".register_taker_forgot_password").hide(),$(t+"tr.register_taker_confirm_password").show(),"register"==a?$(t+"tr.register_taker_email").hide():$(t+"tr.register_taker_email").show(),$(t+".register_taker_first_name").focus())}else register_taker_global_email_unique_f=i,0==i&&(debug[0]&&console.log('[register_taker_unique_or_no] "email already in use"'),$(t+".register_taker_email_errmsg").html("Email already in use").show());register_taker_global_in_process_b=!1},this.register_taker=function(e,t,s,i){debug[0]&&console.log("[register_taker] register_taker_global_in_process_b:",register_taker_global_in_process_b);var a=0,r=function(){if(register_taker_global_in_process_b){if(debug[0]&&console.log("[delay_register_taker] n_tries:",a),a>40)return alert("Sorry, unable to process request"),!1;a++,setTimeout(r,250)}else qqc.register_taker2(e,t,s,i)};return setTimeout(r,250),!1},this.register_taker2=function(e,t,s,i){debug[0]&&console.log("[register_taker2] proceed_to_pay:",s);var a=!0,r=qwiz_deck_selector(e,t),o="";"register"==i&&(o=$(r+".register_taker_reg_code").val(),""==(o=qqc.trim(o))&&($(r+".register_taker_reg_code_errmsg").html("Please enter registration code").show(),a=!1)),""==(register_taker_global_username=$(r+".register_taker_username").val())&&($(r+".register_taker_username_errmsg").html("Please enter login name").show(),a=!1),/["\\;]/.test(register_taker_global_username)&&($(r+".register_taker_username_errmsg").html("Invalid characters").show(),a=!1);var n=$(r+".register_taker_password").val();""==n&&($(r+".register_taker_password_errmsg").html("Please enter password").show(),a=!1);var _=$(r+"input.register_taker_email").val();s||(s=register_taker_global_reg_code_professor_f);const c=$(r+"span.register_taker_login").html()==qqc.T("Log in");if(!c&&(!register_taker_global_reg_code_ok_f&&!s||1==register_taker_global_username_unique_f||""==register_taker_global_username)){(a=a&®ister_taker_global_username_unique_f)&&""!=register_taker_global_username&&!register_taker_global_username_unique_f&&($(r+".register_taker_username_errmsg").html("Login name already in use").show(),a=!1),""==(register_taker_global_first_name=$(r+".register_taker_first_name").val())&&($(r+".register_taker_first_name_errmsg").html("Please enter first name").show(),a=!1),""==(register_taker_global_last_name=$(r+".register_taker_last_name").val())&&($(r+".register_taker_last_name_errmsg").html("Please enter last name").show(),a=!1),!o||register_taker_global_reg_code_ok_f||register_taker_display_pay_screen||(a=!1,$(r+".register_taker_reg_code_errmsg").html("Could not find registration code").show());var d=set_display_pay_screen(e,t);if(!c)if(""==_?register_taker_global_reg_code_ok_f&&"signup"!=d||($(r+".register_taker_email_errmsg").html("Please enter email").show(),a=!1):register_taker_global_email_unique_f?a=qqc.register_taker_validate_email(e,t,a,!1,i):($(r+".register_taker_email_errmsg").html("Email already in use").show(),a=!1),""!=n)n!=$(r+"input.register_taker_confirm_password").val()&&($(r+".register_taker_password_errmsg").html("Password and Confirm password do not match").show(),a=!1);o||"signup"!=d||($(r+".register_taker_reg_code_errmsg").html("Please enter registration code").show(),$(r+".register_taker_reg_code_class_name").html("").hide()),a?"register"!=i||o||(a=confirm('You have not entered a registration code;\nyou will be an "independent student," not in a class.\n\nIs this OK? If not, click "Cancel" and enter a code.')):"qcard_"==e&&qcard_.set_container_width_height(t)}if(register_taker_global_sha3_password=CryptoJS.SHA3(n).toString(),a){const i=qqc.set_immediate_payment(e,t);
3var l={login_f:c?1:"",reg_code:o,school_id:register_taker_global_reg_code_school_id,username:register_taker_global_username,firstname:register_taker_global_first_name,lastname:register_taker_global_last_name,sha3_password:register_taker_global_sha3_password,email:_,register_v2:"1",payment_type_id:i?65:52,called_from:"register_taker2",callback:"taker_registered"};s&&(l.proceed_to_pay_f="1"),document_qwiz_subscription_id&&(l.subscription_id=document_qwiz_subscription_id,l.subscription="1"),debug[0]&&console.log("[register_taker2] data",l),qqc.qjax(e,t,"","new_student_registration",l)}return!1},this.register_taker_hide_error=function(e,t,s){var i=s.className.split(/\s+/)[0],a=qwiz_deck_selector(e,t);$(a+"."+i+"_errmsg").hide(),$(a+".register_taker_errmsg").hide()},this.taker_registered=function(e){debug[0]&&(console.log("[taker_registered] data:",e),console.log("[taker_registered] register_taker_global_reg_code_ok_f:",register_taker_global_reg_code_ok_f,", register_taker_global_username_unique_f:",register_taker_global_username_unique_f),console.log("[taker_registered] register_taker_display_pay_screen:",register_taker_display_pay_screen));var t=e.errmsg,s="";const i=e.qname,a=parseInt(e.i_qwiz);if(t)s="login unsuccessful"==t?"Incorrect username/password":"duplicate username"==t?"Login name is already in database":t;else{document_qwiz_user_logged_in_b=!0,document_qwiz_session_id=e.session_id,document_qwiz_username=register_taker_global_username,document_qwiz_school_id=e.school_id,document_qwiz_taker_id=e.taker_id,document_qwiz_email=e.email,document_qwiz_independent_taker_f=1==e.school_id,e.university_discount&&(document_qwiz_university_discount=!0),document_qwiz_good_through_date=e.good_through_date;$.cookie("qwiz_session_id",document_qwiz_session_id,{path:"/",expires:1}),document_qwiz_remember_f=!0,qqc.set_user_menus_and_icons();var r="";if(e.show_paypal_screen_f)if(document_qwiz_good_through_date){qqc.$get_login_div(i,a).html("<i>Sorry; a free trial subscription is not available to existing users</i>")}else qqc.create_paypal_subscription_screen(i,a);else{var o="";if(e.add_and_provide_f||e.login_f)if("open_register"==(r=get_qwizdeckdata(i,a,"display_pay_screen")))o=`<br />\n <b>Thanks! You now have a Learn-Biology.com account and your work will be saved.</b>\n <br />\n <br />\n <button class="qwiz_button" onclick="${i}.no_login (${a})">\n Continue\n </button>`;else{o=qqc.set_immediate_payment(i,a)?"<b>Thanks! You now have a Learn-Biology.com subscription.</b>":1==e.school_id?"<b>Thanks! You now have a free-trial subscription.</b>":"<b>Thanks! You now have a free account.</b>"}if("open_register"!=r&&get_qwizdeckdata(i,a,"pay_quiz_deck_id"))qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(a,a,void 0,void 0,o),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(a,a,void 0,void 0,o);else{qqc.$get_login_div(i,a).html(o)}if(register_taker_global_reg_code_ok_f){e.login_f&&(register_taker_global_first_name=e.firstname,register_taker_global_last_name=e.lastname);var n={};n.First_name=[register_taker_global_first_name],n.Last_name=[register_taker_global_last_name];var _={userids:[document_qwiz_taker_id],usernames:[register_taker_global_username],passwords:[register_taker_global_sha3_password],custom_input_data:{input_field_names:["First_name","Last_name"],fields:n}};e.proceed_to_pay_f&&(_.proceed_to_pay_f=e.proceed_to_pay_f),qqc.input_data_to_db(i,a,register_taker_global_reg_code_maker_id,register_taker_global_reg_code_school_id,register_taker_global_reg_code_class_id,register_taker_global_reg_code_class_name,_),document_qwiz_class_id=register_taker_global_reg_code_class_id}}}if(s){var c=qwiz_deck_selector(i,a);$(c+".register_taker_errmsg").html(s).show()}return!1},this.special_offer_callback=function(e){debug[0]&&console.log("[special_offer_callback] data:",e);var t="<br /><br />";t+=qqc.set_immediate_payment(e.qname,e.i_qwiz)?"<b>Thanks! You now have a Learn-Biology.com subscription.</b>":"<b>Thanks! You now have a new free-trial subscription.</b>";qqc.$get_login_div("qwiz_",e.i_qwiz).html(t)},this.register_taker_validate_email=function(e,t,s,i,a){var r=qwiz_deck_
3selector(e,t),o=$(r+"input.register_taker_email").val();if(""!=o){/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(o)?i&&qqc.register_taker_check_unique(e,t,"email",a,"email"):($(r+".register_taker_email_errmsg").html("Not a valid email address").show(),s=!1)}return s},this.input_data_to_db=function(e,t,s,i,a,r,o){debug[0]&&console.log("[input_data_to_db] taker_data:",o);var n={};n.qname=e,n.i_qwiz=t,n.class_id=a,n.class_name=r,n.school_id=i,n.maker_id=s,n.taker_data=o,n.callback="register_taker_input_data_to_db_callback",debug[0]&&console.log("[input_data_to_db] data:",n),qwiz_qcards_common.qjax(e,t,"","new_class",n)},this.register_taker_input_data_to_db_callback=function(e){if(debug[0]&&console.log("[input_data_to_db_callback] data:",e),e.error_f)alert("Sorry, registration did not work");else{const t=1==e.proceed_to_pay_f;register_taker_registered_feedback(e.qname,e.i_qwiz,!1,t)}},this.check_promo_code=function(e,t){var s=$("#"+e+"promo_code"+t+" input").val();if(""!=s){var i={qname:e,promo_code:s,pay_quiz_deck_id:get_qwizdeckdata(e,t,"pay_quiz_deck_id")};qqc.qjax(e,t,"","check_promo_code",i)}return!1},this.check_promo_code2=function(e){debug[0]&&console.log("[check_promo_code2] data:",e);var t=e.qname,s=e.i_qwiz,i=$("p#"+t+"promo_code"+s);e.errmsg?(i.find("span.promo_code_errmsg").html("<br />"+e.errmsg),i.find("span.promo_code_okmsg").html("")):(qqc.set_qwizdeckdata(t,s,"promo_code",e.promo_code),"qwiz_"==t?qwiz_.pay_lock_settings(s,s):qcard_.pay_lock_settings(s,s))},this.clear_promo_code_msgs=function(e,t){$("p#"+e+"promo_code"+t+" span.promo_code_msg").html("")},this.submit_for_payment=function(e,t,s){debug[0]&&console.log("[submit_for_payment] qname:",e,", i_qwiz:",t,", form_el:",s);var i=get_qwizdeckdata(e,t,"pay_quiz_deck_id"),a=s.os0.selectedIndex;if(-1==a){var r=qwiz_deck_selector(e,t);return $(r+" div.signup_confirm_email_errmsg").html("Please choose a payment option").show(),!1}if(!document_qwiz_session_id){r=qwiz_deck_selector(e,t);return $(r+" div.signup_confirm_email_errmsg").html("Sorry, login session not set. Please refresh this page in your browser and try again, or contact [email protected]").show(),!1}var o=get_qwizdeckdata(e,t,"taker_payment_type_ids")[a],n=s.os0.value;if(pay_qwiz_qdeck_=e,pay_i_qwiz_deck=t,n<=0)return!1;var _={m:0,pid:i,ptid:o,sid:document_qwiz_session_id,url:qqc.get_qwiz_param("url","./")};return debug[0]&&console.log("[submit_for_payment] custom_data:",_),s.custom.value=btoa(JSON.stringify(_)),!0},this.create_maker_pay_screen=function(e,t,s,i){var a=qqc.$get_login_div(e,s),r=[];if(t[s].pay_errmsg)r.push("<strong>"+t[s].pay_errmsg+"</strong><br />");else{i&&r.push("<strong>"+i+"</strong><br />");var o=t[s].maker_payment_type_ids.length;r.push('<form action="https://www.paypal.com/cgi-bin/webscr" onSubmit="return qwiz_qcards_common.submit_for_payment (\''+e+"', "+s+', this)" method="post" target="_blank">'),r.push('<input type="hidden" name="cmd" value="_s-xclick">'),r.push('<input type="hidden" name="hosted_button_id" value="QK2XZUEFF9RNS">'),r.push('<table class="pay_options">'),r.push("<tr>"),r.push("<td>"),r.push('<input type="hidden" name="on0" value="Options">'),o>1&&r.push("Please choose:"),r.push("</td>"),r.push("</tr>"),r.push("<tr>"),r.push("<td>"),r.push('<select name="os0" class="qwiz_paypal_select">');for(var n=0;n<o;n++){var _=t[s].maker_fees[n],c=t[s].maker_good_for_n_periodss[n],d=t[s].maker_good_for_periods[n],l=t[s].maker_payment_descriptions[n],u=qqc.currency(_)+" "+qqc.number_to_word(c)+" "+qqc.plural(d,d+"s",c);l&&(u+=" - "+l),r.push('<option value="'+_+'">'),r.push(u),r.push("</option>")}r.push("</select> "),r.push("</td>"),r.push("</tr>"),r.push("</table>"),r.push('<input type="hidden" name="currency_code" value="USD">'),r.push('<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" style="border: none;" name="submit" alt="PayPal - The safer, easier way to pay online!">'),r.push('<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">'),r.push('<input type="hidden" name="custom">'),r.push("</form>")}a.html(r.join("\n")).show()},this.submit_for_maker_payment=function(e,t,s){debug[0]&&console.log("[submit_for_maker_payment] qname:",e,", i_qwiz:",t,", form_el:",s);var i=get_qwizdeckdata(e,t,"pay_quiz_deck_id"),a=s.os0.selectedIndex,r={m:1,pid:i,ptid:get_qwizdeckdata(e,t,"maker_payment_type_ids")[a],sid:qqc.maker_session_id,url:qqc.get_qwiz_param("url","./")};return debug[0]&&console.log("[submit_for_maker_payment] custom_data:",r),s.custom.value=btoa(JSON.stringify(r)),pay_qwiz_qdeck_=e,pay_i_qwiz_deck=t,!0},this.payment_received=function(e,t,s,i){if(debug[0]&&console.log("[payment_received] no_set_f:",e,", confirm_email_errmsg:",i),i){var a=qwiz_deck_
3selector(t,s);return $(a+" div.signup_confirm_email_errmsg").html(i).show(),!1}if(e)pay_qwiz_qdeck_=t,pay_i_qwiz_deck=s;else{document_qwiz_email_confirm=1;const e=get_qwizdeckdata(t,s,"display_pay_screen");qwiz_&&qwiz_.any_pay_quiz_f&&(e&&(payment_received_f=!0),qwiz_.pay_lock_settings()),qcard_&&qcard_.any_pay_deck_f&&(e&&(payment_received_f=!0),qcard_.pay_lock_settings())}"qwiz_"==pay_qwiz_qdeck_?($("#qwiz_login-qwiz"+pay_i_qwiz_deck).hide(),-1==qwiz_.get_qwizdata(pay_i_qwiz_deck,"i_question")?($(".intro-qwiz"+pay_i_qwiz_deck).show(),qwiz_.position_show_next_button(pay_i_qwiz_deck)):qwiz_.login_ok_start_quiz(pay_i_qwiz_deck)):($("#qdeck_login-qdeck"+pay_i_qwiz_deck).hide(),qcard_.login_ok_start_deck(pay_i_qwiz_deck))},this.registration_complete=function(e,t,s,i){debug[0]&&console.log("[registration_complete] qname:",e,", i_qwiz:",t,", session_id:",s,", username:",i),document_qwiz_session_id=s,document_qwiz_username=i,document_qwiz_school_id=1,document_qwiz_independent_taker_f=1,("qwiz_"==e?qwiz_:qcard_).login_ok(t,s,0)},this.maker_login_registration_complete=function(e,t,s,i){debug[0]&&console.log("[maker_login_registration_complete] qname:",e,", i_qwiz:",t,", maker_session_id:",s,", username:",i),qqc.maker_session_id=s;$.cookie("maker_session_id",s,{path:"/",expires:1}),("qwiz_"==e?qwiz_:qcard_).hide_menu_and_display_login(t,!1,"maker_pay"),setTimeout((function(){alert("Admin registration/login successful")}),250)},this.set_login_expiry=function(){debug[0]&&console.log("[set_login_expiry]"),clearTimeout(document_qwiz_login_timeout),document_qwiz_login_timeout=setTimeout("qwiz_qcards_common.login_expired ()",864e5)},this.login_expired=function(){document_qwiz_user_logged_in_b=!1,qqc.set_user_menus_and_icons(),qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(),document_qwiz_pay_registration_date_unix=0;setTimeout((function(){document_qwiz_wp_user_session_id?alert(qqc.T("Score-recording authentication expired. Please re-load this page")):alert(qqc.T("Qwizcards login session expired. Please log in again"))}),20)},this.is_mobile=function(e){var t;return document_qwiz_force_mobile_f||(t="Disabled"!=e&&(window.innerWidth<961||window.innerHeight<450)),t},this.set_force_mobile=function(){parent!==window&&-1!=document.location.href.search(/(localhost|192.168.1.120|qwizcards.com|swinginghotspot.com)\/u\//)&&(document_qwiz_force_mobile_f=!0)},this.process_textentry_terms=function(e){debug[0]&&console.log("process_textentry_terms] data:",e.substr(0,50),"..."),terms={singular:[],plural:[]};for(var t=e.split(/\n|;/),s=t.length,i=0;i<s;i++){var a,r,o=t[i];if(-1!=o.search(/\S/)){var n=o.indexOf("/");if(-1==n){a=o;var _=o.length-1,c=o[_],d=o.substr(_-1);r="es"==d?o:"y"==c?o.substr(0,_)+"ies":"s"==c||"sh"==d||"ch"==d?o+"es":"x"==c?o:o+"s"}else a=o.substr(0,n),r=n==o.length-1?o.substr(0,n):o.substr(n+1);terms.singular.push([a,qqc.metaphone(a)]),terms.plural.push([r,qqc.metaphone(r)])}}return terms},this.process_inline_textentry_terms=function(e,t,s,i){s.additional_errmsgs=[];var a=extract_delete_shortcode_content(e,t,"add_terms"==t,s);if("NA"==a.content)return e;for(var r=[a.content],o=new RegExp('<a.*?href="([^"]*)"[\\s\\S]*?<\\/a>',"m");;){var n=r[0].match(o);if(!n)break;var _=n[1],c=qqc.get_textentry_terms(_,s);c&&(".txt"!=_.substr(_.length-4)||-1!=c.indexOf("[terms]")?(r_remote=extract_delete_shortcode_content(c,"terms",!1,s),"NA"==r_remote.content?s.additional_errmsgs.push(qqc.T("Did not find [terms]...[/terms] shortcode pair in file")+" "+_):r.push(r_remote.content)):r.push(c)),r[0]=r[0].replace(o,"")}return r=(r=r.join("")).replace(/<[^>]+>| /g,"\n"),s[i][t]=r,a.htm},this.sort_dedupe_terms_metaphones=function(e){var t=window.navigator.userLanguage||window.navigator.language;e.sort((function(e,s){return e[0].toLowerCase().localeCompare(s[0].toLowerCase(),t,{numeric:!0})}));for(var s=[e[0]],i=e.length,a=1;a<i;a++)e[a][0]!=e[a-1][0]&&s.push(e[a]);return s},this.get_textentry_terms=function(e,t){debug[0]&&console.log("[get_textentry_terms] terms_url:",e);var s=!1,i="";return $.ajax({type:"GET",async:!1,url:e,dataType:"text",error:function(i,a){t.additional_errmsgs.push(qqc.T("Could not read terms file")+": "+e),s=!0},success:function(e){i=e}}),s||i||t.additional_errmsgs.push(qqc.T("No data read from terms file")+": "+e),i},this.create_hangman_entry=function(e){var t='<span class="qwiz-hairsp"></span>',s=0;e&&(s=e.length);for(var i=[],a=0;a<s;a++)e[a].match(/[a-z0-9]/i)?i.push("<u>"+e[a]+"</u>"+t):" "==e[a]?i.push(" "+t):i.push(e[a]+t);e=i.join("");return debug[9]&&console.log("[create_hangman_entry] entry:",e),e},this.create_hangman_incorrect_chars_display=function(e,t,s){var i=e.length,a=[];0==t?a.push('<span class="hangman_incorrect_letters_exceeded inline-block entry">'):a.push('<span class="hangman_incorrect_letters_allowed inline-block entry">');for(var r=s?12:i,o=0;o<r;
3o++){var n=o<i?e[o]:'<span class="qwiz_spacer">x</span>';a.push(n),o+1==t&&a.push('</span><span class="hangman_incorrect_letters_exceeded inline-block entry">')}return a.push("</span>"),a="Incorrect: "+a.join("")},this.setCharAt=function(e,t,s){return t>e.length-1?e:e.substr(0,t)+s+e.substr(t+1)},this.make_inline=function(e,t){var s=e.substr(t),i=s.match(/<[hp][^>]*>/)[0],a=i[1];"h"==a&&(a+=i[2]);var r=qqc.add_attr_value("style","display: inline;",i);debug[9]&&console.log("[make_inline] new_tag:",r);var o=s.replace(i,r),n="</"+a+">";-1!=(o=r.replace(a,"div")+o).search(n)?o=o.replace(n,n+"</div>"):o+="</div>";var _="</"+a+">";return r="<"+a+' style="display: inline;">',e=(e=e.substr(0,t)+o).replace(/\[hangman[^\]]*\]/,_+"$&"+r),debug[9]&&console.log("[make_inline] htm:",e),e},this.add_attr_value=function(e,t,s){var i=new RegExp(e+"\\s*=\\s*[\"']","im"),a=s.match(i);return a?-1==s.search(t)&&(s=s.replace(i,a[0]+t+" ")):s=s.replace(">"," "+e+'="'+t+'">'),debug[0]&&console.log("[add_attr_value] attributes:",s),s},this.remove_tags_eols=function(e,t){return e&&(t&&(e=e.replace(/<img/g,"xXximg")),e=qqc.trim(e.replace(/<[^>]+>/g,"").replace(/\n| /g," ").replace(/ {2,}/g," ")),t&&(e=e.replace(/xXximg/g,"<img"))),e},this.q_and_a_hash=function(e){return e.length>200&&(e=e.substr(0,184)+"CRC32:"+qwiz_crc32(e)),e},this.init_enter_intercept=function(){init_enter_intercept_f||(init_enter_intercept_f=!0,$("html").on("keydown",(function(e){if(document_active_qwiz_qdeck&&13==e.keyCode){debug[7]&&(console.log("[init_enter_intercept] document_active_qwiz_qdeck:",document_active_qwiz_qdeck),console.log("[init_enter_intercept] e.target:",e.target));var t=e.target.tagName.toLowerCase();if("input"==t||"textarea"==t)if(-1==(i=e.target.id.toLowerCase()).indexOf("qwiz")&&-1==i.indexOf("qdeck"))return;if(-1!=e.target.className.indexOf("user_html"))if(-1==(i=e.target.id.toLowerCase()).indexOf("qwiz")&&-1==i.indexOf("qdeck"))return;var s=$(document_active_qwiz_qdeck);if(-1==document_active_qwiz_qdeck.className.toLowerCase().indexOf("qcard_window"))if(s.find("div.next_button").is(":visible"))debug[7]&&(console.log("[init_enter_intercept] qwiz next_button trigger"),console.log("[init_enter_intercept] $document_active_qwiz_qdeck.find ('div.next_button button'):",s.find("div.next_button button"))),qqc.next_button_active_b||s.find("div.next_button button").trigger("click");else if(s.find("div.textentry_check_answer_div").is(":visible")){debug[7]&&console.log("[init_enter_intercept] qwiz call text_entry_check_answer ()");var i=document_active_qwiz_qdeck.id,a=parseInt(i.substr(4),10);qwiz_.textentry_check_answer(a)}else s.find("button.login_button").is(":visible")?(debug[7]&&console.log("[init_enter_intercept] qwiz login_button trigger"),s.find("div.qwiz-login button.login_button").trigger("click")):s.find("button.begin_practice").is(":visible")?(debug[7]&&console.log("[init_enter_intercept] qwiz begin_practice trigger"),s.find("div.qwiz-login button.begin_practice").trigger("click")):s.find(".exit_progress_bars").is(":visible")&&(debug[7]&&console.log("[init_enter_intercept] qwiz exit_progress_bars trigger"),s.find("div.qwiz-login button.exit_progress_bars").trigger("click"));else if(!qcard_.qwizard_b){if(-1!=e.target.className.indexOf("flip"))return;s.find("button.login_button").is(":visible")?(debug[7]&&console.log("[init_enter_intercept] qdeck login_button trigger"),s.find("button.login_button").trigger("click")):s.find("button.begin_practice").is(":visible")?(debug[7]&&console.log("[init_enter_intercept] qdeck begin_practice trigger"),s.find("div.button.begin_practice").trigger("click")):s.find(".exit_progress_bars").is(":visible")?(debug[7]&&console.log("[init_enter_intercept] qdeck exit_progress_bars trigger"),s.find(".exit_progress_bars").trigger("click")):s.find("div.qcard_next_buttons button.flip.qwiz_button").length&&(debug[7]&&(console.log("[init_enter_intercept] qdeck Check answer trigger"),console.log("[init_enter_intercept] find:",s.find("div.qcard_next_buttons button.flip"))),s.find("div.qcard_next_buttons button.flip").trigger("click"))}}})))}
3,this.$get_login_div=function(e,t){var s;return"qwiz_"==e?(s="#qwiz_login-qwiz"+t,$("#progress-qwiz"+t).html("")):(s="div.qcard_card-qdeck"+t+" div.qcard-front div.qcard_content_size",$("#progress-qdeck"+t).html("")),$(s)},this.get_attr=function(e,t){var s="",i=new RegExp("(\\s|^)"+t+'\\s*=\\s*("([^"]+)")*',"m"),a=e.match(i);return a&&a[3]&&(s=qqc.trim(a[3])),s},this.opening_tag_shortcode_pos=function(e,t){e=e.replace(/([\[\]\*])/g,"\\$1");var s=new RegExp("(<[^\\/][^>]*>\\s*)*?"+e+"[\\s\\S]*"),i=t.search(s);if(-1==i)i=t.length;else{var a=new RegExp(e),r=t.search(a),o=!1,n=t.substring(i,r).lastIndexOf("<img");-1!=n&&(i+=n+3,o=!0);var _=t.substring(i,r).lastIndexOf("<input");-1!=_&&(i+=_+3,o=!0);var c=t.substring(i,r).lastIndexOf('<span class="qwizard_placeholder">');-1!=c&&(i+=c+3,o=!0);var d,l=t.substring(i,r).lastIndexOf("<br");if(-1!=l&&(i+=l+3,o=!0),-1!=(d=t.substring(i,r).lastIndexOf("<video"))&&(i+=d+3,o=!0),-1!=(d=t.substring(i,r).lastIndexOf("<iframe"))&&(i+=d+3,o=!0),o)i+=t.substr(i).search(s)}return i},this.replace_smart_quotes=function(e){var t=e.replace(/[\u201C\u201D\u2033\u00AB\u00BB]/gm,'"');return t=(t=(t=t.replace(/[\u2018\u2019]/gm,"'")).replace(/ |\u000A0/gm," ")).replace(/–|\u2013/gm,"-")},this.balance_closing_tag=function(e){var t=e.search(/<\/[ph]/);if(-1!=t){var s,i=e.substr(t+2,2);s=">"==i.substr(1)?"<p":"<"+i;var a=new RegExp(s),r=e.search(a);(-1==r||r>t)&&(e=s+">"+e)}return e},this.remove_unmatched_tag=function(e,t,s){var i=e,a=e.split(/(<[ph][^>]*>[^]*?<\/[ph][^>]*>)/),r=a.length,o=a[r-1],n=o.replace(/<\/{0,1}[ph][^>]*>/g,""),_=!0;if(-1!=o.search(/<\/{0,1}[ph]/)&&!(s&&-1==o.search(/<[ph]/)||t&&-1==o.search(/<[ph]/)||-1==n.search(/\S/))){var c=new RegExp(/<[ph][^>]*>/),d=o.match(c),l="<p>",u=-1;if(d)l=d[0],u=o.search(c);else if(r>1){(d=a[r-2].match(c))&&(l=d[0])}if(-1!=u){var p,g=new RegExp(/<\/{0,1}([ph][^>\s]*)/);l?p=l.match(g)[1]:l="<"+(p=o.match(g)[1])+">";var h,q="</"+p+">",m=o.split(c,2);sub_piece1=m[0].replace(/<\/{0,1}[ph][^>]*>/g,""),sub_piece2=m[1].replace(/<\/{0,1}[ph][^>]*>/g,""),h=-1!=l.search("class")?l.replace(/class\s*=\s*"/,'class="qwiz-inline '):"<"+p+' class="qwiz-inline">',sub_piece1=add_span_if_empty(sub_piece1),sub_piece2=add_span_if_empty(sub_piece2),sub_piece1&&(sub_piece1=h+sub_piece1+q),sub_piece2&&(sub_piece2=h+sub_piece2+q),n=sub_piece1,sub_piece1&&sub_piece2&&(n+=l+add_span_if_empty("",!0)+q),n+=sub_piece2,_=!1}}return _&&(n='<p class="qwiz-inline">'+add_span_if_empty(n,!0)+"</p>"),e=a.slice(0,r-1).join("")+n,debug[0]&&e!=i&&(console.log("[remove_unmatched_tag] part_orig:",i),console.log("[remove_unmatched_tag] part: ",e)),e},this.number_to_word=function(e){return number_word||(number_word=[qqc.S("zero"),qqc.S("one"),qqc.S("two"),qqc.S("three"),qqc.S("four"),qqc.S("five"),qqc.S("six"),qqc.S("seven"),qqc.S("eight"),qqc.S("nine"),qqc.S("ten")]),e>10?e.toString():number_word[e]},this.number_to_ordinal_word=function(e,t){var s;if(ordinal_words||(ordinal_words=[qqc.T("zeroth"),qqc.T("first"),qqc.T("second"),qqc.T("third"),qqc.T("fourth"),qqc.T("fifth"),qqc.T("sixth"),qqc.T("seventh"),qqc.T("eighth"),qqc.T("ninth"),qqc.T("tenth"),qqc.T("eleventh"),qqc.T("twelfth"),qqc.T("thirteenth")]),e<14)s=ordinal_words[e];else{var i=e%10;s=1==i?e+"st":2==i?e+"nd":3==i?e+"rd":e+"th"}return t&&(s=qqc.capitalize(s)),s},this.capitalize=function(e){return e=e.substr(0,1).toUpperCase()+e.substr(1)},this.plural=function(e,t,s){return 1==s?e:t},this.S=function(e){return qqc.T(e)},this.T=function(e){var t="";return"undefined"!=typeof qwiz_params?void 0!==qwiz_params.T&&(e=htmlDecode(e),void 0!==qwiz_params.T[e]&&(t=qwiz_params.T[e])):"undefined"!=typeof qwizzled_params&&void 0!==qwizzled_params.T&&(e=htmlDecode(e),void 0!==qwizzled_params.T[e]&&(t=qwizzled_params.T[e])),""==t&&(t=e),t},this.currency=function(e){if(0==e)return"$0.00";var t=""+parseInt(100*e+.5,10),s=t.length;return"$"+t.substr(0,s-2)+"."+t.substr(s-2)},this.get_qwiz_param=function(e,t){var s="";return"undefined"!=typeof qwiz_params?void 0!==qwiz_params[e]&&(s=qwiz_params[e]):"undefined"!=typeof qwizzled_params&&void 0!==qwizzled_params[e]&&(s=qwizzled_params[e]),s||null!=t&&(s=t),s},this.trim=function(e){return e&&(e=e.toString(),e="a".trim?e.trim():e.replace(/^\s+|\s+$/g,"")),e},this.add_script=function(e){var t=document.createElement("script");t.setAttribute("charset","utf-8"),t.src=e;var s=[];try{s=$("head")}catch(e){}s.length?s.append(t):$("body").append(t)},this.dataset_units_topics_toggle_all=function(e){$(e).parents("table.dataset_units_topics").find("input:checkbox").prop("checked",e.checked),e.checked?$(e).attr("checked",!0):$(e).removeAttr("checked")},this.dataset_unit_toggle_topics=function(e){var t=$(e).parents("tr.unit_head").attr("id").match(/-unit([0-9]+)/)[1];$(e).parents("table.dataset_units_topics").find("tr.unit_topic"+t+" input
3:checkbox").prop("checked",e.checked),e.checked?$(e).attr("checked",!0):$(e).removeAttr("checked")};var n_dataset_units_expanded=[];function separate_combo(e,t,s){var i=e.split("[qQq]"),a=t.split("[qQq]");const r=i.length;e=[];for(var o=[],n=[],_=[],c=0;c<r;c++)"Q"==a[c]?(e.push(i[c]),o.push(s[c])):(n.push(i[c]),_.push(s[c]));const d=e.length;e=e.join("");const l=n.length;return[e,o,d,n=n.join(""),_,l]}function combo_switch(e,t,s,i){const a=$(`#qwiz${s}`),r=$(`#qcard_window-qdeck${i}`);t!=e&&("Q"==t?(a.css({display:"block"}),r.css({display:"none"})):(r.css({display:"block"}),a.css({display:"none"})))}function filter_maker_specific_questions_cards(e,t){var s=e.split("[qQq]"),i=[],a={};for(var r of s){var o="",n="",_=r.match(/\[(<code><\/code>)*q\s*([^\]]*)\]/gm);if(_&&_.length){var c=_[0];c=qqc.replace_smart_quotes(c),o=qqc.get_attr(c,"unit"),n=qqc.get_attr(c,"topic")}o||(o="Other"),n||(n="Other");var d=o+"__"+n;void 0===a[d=d.replace(/[^a-z0-9 ]/gi,"_")]&&(a[d]=0),(void 0===maker_specific_n_qs_by_unit_topic||a[d]<maker_specific_n_qs_by_unit_topic[d])&&(i.push(r),a[d]++)}const l=i.length;if(t<l){const e=l-t;for(var u=0;u<e;u++){const e=i.length,t=Math.floor(Math.random()*e);i.splice(t,1)}}return i.join("")}function insert_dataset_questions(e,t,s){for(var i=t.split("[qQq]"),a=i.length,r={},o=0;o<a;o++){r[parse_dataset_question_ids(i[o],"dataset_id")[0]]=o}var n=e.match(/\[q[^\]]* use_dataset_(question|card)\s*=\s*\S[^\]]+/g);a=n.length;for(ii=0;ii<a;ii++){o=r[qqc.replace_smart_quotes(n[ii]).match(/use_dataset_[^"]+"([^"]+)/)[1]];e=e.replace(/\[q([^\]]* )use_dataset_(question|card)\s*=\s*[^\]]+\]/,i[o])}var _="qwiz_"==s?"use_dataset_question":"use_dataset_card";return e=e.replace(/dataset_id/g,_)}function parse_dataset_question_ids(e,t){var s=new RegExp(t+"\\s*=\\s*\\S[^\\]]+","g"),a=e.match(s),r=a.length,o=[];for(i=0;i<r;i++){var n=qqc.replace_smart_quotes(a[i]).match(/"([^"]+)/)[1];o.push(n)}return o}function start_dataset_questions_countdown(e,t,s,i,a,r){var o=$("#dataset_questions_countdown_display-"+e+t),n=31,_=function(){if(--n>0){var c=qqc.T("Trying for")+" "+n+" "+qqc.T("more")+" "+qqc.plural(qqc.T("second"),qqc.T("seconds"),n)+"...";o.html(c),dataset_questions_countdown_timeout[e+t]=setTimeout(_,1e3)}else{$("#dataset_questions_spinner-"+e+t).css({visibility:"hidden"});var d="qwiz_"==e?qqc.T("questions"):qqc.T("cards"),l=`'${qqc.addSlashes(s)}', '${e}', ${t}, '${qqc.addSlashes(i)}', ${a}, ${r}, 0, ''`;c=qqc.T("Sorry, could not get")+" "+d+"<br /><br />"+`<button class="qwiz_button begin_practice" onclick="qwiz_qcards_common.begin_dataset_quiz_deck (${l})">`+qqc.T("Try again")+"</button>";o.html(c),dataset_questions_countdown_timeout[e+t]="fail"}};_()}function get_qwizdeckdata(e,t,s){return"qwiz_"==e?qwiz_.get_qwizdata(t,s):qcard_.get_deckdata(t,s)}function parse_html_block_pattern(e){var t="("+e.join(")|(")+")";return t="(("+(t=t.replace(/([\[\]\*])/g,"\\$1"))+")\\s*)"}function select_text(e){if(document.body.createTextRange)(t=document.body.createTextRange()).moveToElementText(e),t.select();else if(window.getSelection){var t,s=window.getSelection();(t=document.createRange()).selectNodeContents(e),s.removeAllRanges(),s.addRange(t)}}this.dataset_unit_expand_collapse=function(e,t,s){$icon_el=$(s);var i=$icon_el.parents("tr.unit_head").attr("id").match(/-unit([0-9]+)/)[1],a=$icon_el.parents("table.dataset_units_topics").find("tr.unit_topic"+i);$icon_el.hasClass("expand")?($icon_el.removeClass("expand").addClass("collapse").attr("src",icon_collapse_src),a.show(),void 0===n_dataset_units_expanded[t]?n_dataset_units_expanded[t]=1:n_dataset_units_expanded[t]++,$icon_el.parents("table.dataset_units_topics").find("span.topics_header").css({visibility:"visible"}),$icon_el.parents("table.dataset_units_topics").find("span.units_header").css({"vertical-align":"top"})):($icon_el.removeClass("collapse").addClass("expand").attr("src",icon_expand_src),a.hide(),n_dataset_units_expanded[t]--,0==n_dataset_units_expanded[t]&&($icon_el.parents("table.dataset_units_topics").find("span.topics_header").css({visibility:"hidden"}),$icon_el.parents("table.dataset_units_topics").find("span.units_header").css({"vertical-align":"bottom"}))),"qcard_"==e&&qcard_.set_container_width_height(t)},this.begin_dataset_quiz_deck=function(e,t,s,i,a,r,o,n,_,c){var d=e.split("; "),l=i.split("; ");c&&(c=c.split("; "));var u=d.length,p=[],g=[];for(let e=0;e<u;e++)if(p.push([]),g.push([]),c){c&&"F"==c[e]&&(qcard_.set_deckdata(0,"qrecord_id",l[e]),qcard_.set_deckdata(0,"combo",!0),qcard_.set_deckdata(0,"combo_i_qwiz",s)),qwiz_.set_qwizdata(s,"combo_i_deck",0)}var h=$("#dataset_units_topics-"+t+s+" tr.unit_topic");if(h.length)h.each((function(){if($tr=$(this),$tr.find("input:checkbox").prop("checked")){var e=0;$tr.find("td.nquestions").each((function(){let t=$(this),s=t.data("unit"),i=t.data("topic");p[e].push(s),g[e].push(i),e++})),$tr.prev("tr.unit_head").find("input:checkbox").prop("checked",!0)}}));else for(let e=0;e<u;e++)p[e].push(btoa("Other")),g[e].push(btoa("Other"));if(debug[11]&&(console.log("[begin_dataset_quiz_deck] selected_units:",p),console.log("[begin_dataset_quiz_deck] selected_topics:",g)),0==p[0].length)return alert(qqc.T("Please select at least one unit/topic")),!1;record_units_topics_state(t,s);var q=$("#dataset_reset_questions_date_"+t+s).val();q==n&&(q=""),r||(r=$("#dataset_max_q_"+t+s).val()),o||(o=$('input[name="spaced_repetition"]:checked').val()),_||(_=0);var m=get_qwizdeckdata(t,s,"random_b");i&&document_qwiz_user_logged_in_b||r<a&&(m=!0),qqc.get_dataset_questions(e,t,s,i,p,g,r,o,m,!1,!1,q,_,a,c)},this.parse_use_dataset=function(e){var t=[],s=[],i=[];const a=e.split(";");for(var r of a){const e=r.split(/\|\s*unit:/i);for(var o of(t.push(e[0].trim()),e.slice(1))){const e=o.split(/\|\s*topic:/i);var n=e[0].trim().replace(/ /g,"_");
3if(n="%"+n,1==e.length)s.push(n),i.push("*");else for(var _ of e.slice(1)){var c=_.trim().replace(/ /g,"_");c="%"+c,s.push(n),i.push(c)}}}return[t=t.join(";"),s,i]},this.get_dataset_questions=function(e,t,s,i,a,r,o,n,_,c,d,l,u,p,g){if(debug[11]&&(console.log("[get_dataset_questions] dataset:",e),console.log("[get_dataset_questions] qrecord_id:",i),console.log("[get_dataset_questions] units:",a),console.log("[get_dataset_questions] topics:",r),console.log("[get_dataset_questions] q_fs:",g)),!c){var h="qwiz_"==t?"questions":"cards";plugin_url||(plugin_url=qqc.get_qwiz_param("url","./"));var q='<div id="dataset_questions_spinner-'+t+s+'" style="margin-top: 100px;" >Getting '+h+' from Qwizcards server...<br /><img src="'+(plugin_url+"images/spinner40x40.gif")+'" class="qwiz-center" /><br /></div><p id="dataset_questions_countdown_display-'+t+s+'" style="text-align: center;"></p>';qqc.$get_login_div(t,s).html(q).show();dataset_questions_countdown_timeout[t+s]=setTimeout((function(){start_dataset_questions_countdown(t,s,e,i,o,n)}),5e3)}var m="";void 0!==document_qwiz_session_id&&(m=document_qwiz_session_id);var f=window.location.href,w=_?1:0,b="qwiz_"==t&&qwiz_.wordpress_page_f?1:0,v={action:"get_dataset_questions",dataset:e,qname:t,i_qwiz_qdeck:s,units:a,topics:r,n_questions_in_set:o,questions_to_do:n,random_f:w,qf_f:b,qwiz_session_id:m,page_url:f};if(c){var k=parse_dataset_question_ids(c,"qwiz_"==t?"use_dataset_question":"use_dataset_card");v.use_dataset_question_ids=k,v.maker_session_id="qwiz_"==t&&qwiz_.qwizard_b?qwizzled.maker_session_id:0}
3d&&(v.no_display_f=1),l&&(v.dataset_reset_questions_date=l),u&&(v.maker_specific_questions_cards=u),p&&(v.n_qs=p),g&&(v.q_fs=g);let z=selected_levels[t+s];z&&z.length>1&&(v.selected_levels=z);var y=qqc.get_qwiz_param("ajaxurl","");debug[11]&&(console.log("[get_dataset_questions] data:",v),console.log("[get_dataset_questions] local_ajaxurl:",y)),y?(v.qrecord_id=i,$.ajax({type:"POST",url:y,data:v,success:qqc.receive_and_place_dataset_questions})):(v.callback="receive_and_place_dataset_questions",v.units=btoa(JSON.stringify(v.units)),v.topics=btoa(JSON.stringify(v.topics)),v.use_dataset_question_ids=btoa(JSON.stringify(v.use_dataset_question_ids)),qqc.qjax(t,s,i,"get_dataset_questions_v3",v))},this.receive_and_place_dataset_questions=function(response){if(debug[11]&&console.log("[receive_and_place_dataset_questions] response:",response),response){var dataset=response.dataset,ok_f=response.ok_f,qname=response.qname,i_qwiz_qdeck=response.i_qwiz_qdeck,no_display_f=response.no_display_f,n_questions_in_set=response.n_questions_in_set,maker_specific_questions_cards=parseInt(response.maker_specific_questions_cards),n_qs=parseInt(response.n_qs);if("fail"!=dataset_questions_countdown_timeout[qname+i_qwiz_qdeck]){if(response.cv_index&&qwiz_.set_qwizdata(i_qwiz_qdeck,"cv_index",response.cv_index),response.rvt&&(qwiz_.set_qwizdata(i_qwiz_qdeck,"random_b",!0),qwiz_.set_qwizdata(i_qwiz_qdeck,"repeat_incorrect_b",!1)),0==ok_f){var errmsg=response.errmsg;if(errmsg){if(qqc.isInteger(errmsg)){var beg_time_unix=errmsg,beg_date=DateFormat.format.date(1e3*beg_time_unix,"h:mm a");errmsg="Test will be available at "+beg_date+'<br /><br /><button class="qwiz_button" onclick="'+qname+".next_question ("+i_qwiz_qdeck+')"><span id="next_button_text-qwiz'+i_qwiz_qdeck+'">'+qqc.T("Start quiz")+"</span></button>\n"}else if("Quiz completed"==errmsg||"Quiz not available"==errmsg||"Quiz no longer available"==errmsg){var dataset_intro_f=qwiz_.get_qwizdata(i_qwiz_qdeck,"dataset_intro_f");if((!dataset_intro_f||"topics_only"==dataset_intro_f)&&dataset){if("Quiz not available"==errmsg&&(errmsg+='</span><br /><button class="qwiz_button" onclick="'+qname+".next_question ("+i_qwiz_qdeck+')"><span id="next_button_text-qwiz'+i_qwiz_qdeck+'">'+qqc.T("Try again")+"</span></button><span>\n"),qwiz_.set_qwizdata(i_qwiz_qdeck,"dataset_intro_f","topics_only"),qwiz_.set_qwizdata(i_qwiz_qdeck,"dataset_intro_info_only_msg",errmsg),/\|\s*unit:/.test(dataset))var[dataset,units,topics]=qqc.parse_use_dataset(dataset);else var units=[],topics=[];return get_dataset_units_topics(qname,i_qwiz_qdeck,response.qrecord_id,dataset,units,topics),!1}}}else{var no_datasets=response.no_datasets;if(no_datasets.length)errmsg="Could not find dataset(s): "+no_datasets.join(", ");else{var s=-1!=dataset.indexOf(";")?"s":"";errmsg="Permission needed for questions from dataset"+s+" "+dataset+" (see qwizcards.com/admin/manage_datasets.php)"}alert(errmsg)}clearTimeout(dataset_questions_countdown_timeout[qname+i_qwiz_qdeck]);var $use_dataset_options_div=qqc.$get_login_div(qname,i_qwiz_qdeck);return $use_dataset_options_div.html("<br /><b>"+errmsg+"</b>").show(),!1}!qwiz_.preview&&response.rvt&&eval(atob(response.rvt));var n_questions=response.n_questions,questions_html=response.questions_html,questions_q_f=response.questions_q_f,question_qrecord_ids=response.question_qrecord_ids,card_qrecord_ids,use_dataset_questions_f=response.use_dataset_questions_f;if(clearTimeout(dataset_questions_countdown_timeout[qname+i_qwiz_qdeck]),0==n_questions){var dataset_intro_f=qwiz_.get_qwizdata(i_qwiz_qdeck,"dataset_intro_f");if(dataset_intro_f){var msg;msg="qwiz_"==qname?qqc.T("There are no questions available of the type you selected"):qqc.T("There are no cards available of the type you selected"),alert(msg),qqc.create_use_dataset_options3(dataset_units_topics_data,qname,i_qwiz_qdeck)}else{var msg=qqc.T("Sorry, could not get questions"),$use_dataset_options_div=qqc.$get_login_div(qname,i_qwiz_qdeck);$use_dataset_options_div.html("<br /><b>"+msg+"</b>").show()}return!1}questions_html=qqc.decodeHtmlEntities(questions_html);var cards_html="",n_cards=0;if(questions_q_f&&([questions_html,question_qrecord_ids,n_questions,cards_html,card_qrecord_ids,n_cards]=separate_combo(questions_html,questions_q_f,question_qrecord_ids)),"qwiz_"==qname&&n_questions){if(1==use_dataset_questions_f){var htm=qwiz_.get_qwizdata(i_qwiz_qdeck,"use_dataset_questions_htm");if(questions_html=insert_dataset_questions(htm,questions_html,qname),no_display_f)return}else questions_html=maker_specific_questions_cards?filter_maker_specific_questions_cards(questions_html,n_questions_in_set):questions_html.replace(/\[qQq\]/g,"");n_qs&&qwiz_.set_qwizdata(i_qwiz_qdeck,"n_qs",n_qs);var new_htm=qwiz_.process_questions(questions_html,"",i_qwiz_qdeck,void 0,qwiz_.qwizard_b,!1,question_qrecord_ids);qwiz_.display_progress(i_qwiz_qdeck);
3var $login_div=$("#qwiz_login-qwiz"+i_qwiz_qdeck).hide(),$questions=$("#dataset_questions-qwiz"+i_qwiz_qdeck),typeset_latex_f;if(qwiz_.init_question_order(i_qwiz_qdeck),[new_htm,typeset_latex_f]=qqc.qlatex_convert(new_htm),$questions.html(new_htm),qwiz_.preview&&(qwiz_.init_preview(i_qwiz_qdeck),response.rvt)){var delay_setp=function(){eval(atob(response.rvt))};setTimeout(delay_setp,500)}if(qwiz_.qwizard_b){qwizard.questions_list_html();var ii_question=qwiz_.no_intro_b[i_qwiz_qdeck]?-1:0;qwizard.highlight_accordion_question(ii_question)}if(qwiz_.init_textentry_autocomplete($questions),$questions.find(".wp-audio-shortcode").css({visibility:"visible"}),"undefined"!=typeof Prism){const e=$questions[0];Prism.highlightAllUnder(e)}else"undefined"!=typeof hljs&&$questions.find("code").each((function(e,t){hljs.highlightBlock(t),this.style.display="inline-block"}));if(typeset_latex_f&&qqc.qlatex_init($questions),response.run_get_dataset_units_topics_f){if(/\|\s*unit:/.test(dataset))var[dataset,units,topics]=qqc.parse_use_dataset(dataset);else var units=[],topics=[];get_dataset_units_topics(qname,i_qwiz_qdeck,response.qrecord_id,dataset,units,topics,"restore_topic_question_counts")}else qwiz_.set_qwizdata(i_qwiz_qdeck,"login_show_b",!1),qwiz_.get_qwizdata(i_qwiz_qdeck,"bck_f")&&(qwiz_.set_qwizdata(i_qwiz_qdeck,"bck_f",!1),qwiz_.reset_counters(i_qwiz_qdeck)),qwiz_.set_qwizdata(i_qwiz_qdeck,"i_question",-1),qwiz_.preview||qwiz_.next_question(i_qwiz_qdeck,!0,!0),qwiz_.next_question_from_intro(i_qwiz_qdeck,0)}if("qwiz_"==qname&&0==n_questions&&(qwiz_.set_qwizdata(i_qwiz_qdeck,n_questions_done,0),qwiz_.set_qwizdata(i_qwiz_qdeck,n_questions_for_done,0)),"qcard_"==qname||cards_html&&n_cards){var i_deck=i_qwiz_qdeck;if(cards_html&&(questions_html=cards_html,i_deck=0),1==use_dataset_questions_f){var htm=qcard_.get_deckdata(i_deck,"use_dataset_card_html");if(questions_html=insert_dataset_questions(htm,questions_html,qname),no_display_f)return}else questions_html=questions_html.replace(/\[qQq\]/g,"");var card_tags=questions_html.match(/\[q[^\]]*\]/gm);qcard_.process_card_attributes(i_deck,card_tags);var n_cards=qcard_.process_cards(questions_html,i_deck,void 0,qcard_.qwizard_b,card_qrecord_ids);if(qcard_.set_deckdata(i_deck,"n_cards",n_cards),qcard_.set_deckdata(i_deck,"n_to_go",n_cards),qcard_.init_card_order(i_deck),$("#qcard_next_buttons-qdeck"+i_deck).css("visibility","visible"),qcard_.set_deckdata(i_deck,"bck_f",!1),qcard_.qwizard_b&&(qwizard.set_qwizard_data("n_questions",n_cards),qwizard.cards_list_html(),qwizard.highlight_accordion_question(0)),qcard_.set_deckdata(i_deck,"no_flip_b",!1),0==use_dataset_questions_f||qcard_.no_intro_b[i_deck]||1==n_cards)qcard_.start_deck2(i_deck,void 0,!0);else{var intro_html=qcard_.get_deckdata(i_deck,"intro_html");qcard_.qwizard_b?(qcard_.set_editable_parts_front(i_deck,intro_html),qwizard.highlight_accordion_question(-1)):(qcard_.get_card_front(i_deck,-1).html(intro_html),qcard_.set_deckdata(i_deck,"no_flip_b",!0)),qcard_.qwiz_icon_stop_propagation(i_deck),qcard_.set_container_width_height(i_deck)}}if(questions_q_f&&0==n_cards){var i_deck=0;qcard_.set_deckdata(i_deck,"n_cards",0),qcard_.set_deckdata(i_deck,"n_to_go",0)}questions_q_f&&qqc.combo_next("",i_qwiz_qdeck,i_deck)}}},this.combo_next=function(e,t,s,i){var a=qwiz_.get_qwizdata(t,"n_correct");qwiz_.get_qwizdata(t,"repeat_incorrect_b")||(a+=qwiz_.get_qwizdata(t,"n_incorrect"));const r=qwiz_.get_qwizdata(t,"n_questions_for_done")-a,o=qcard_.get_deckdata(s,"n_cards"),n=qcard_.get_deckdata(s,"n_to_go"),_=r+n;var c;if(0==_)c="Q";else{const e=r/_;c=Math.random()<e?"Q":"F"}combo_switch(e,c,t,s),"Q"==c?a>0&&qwiz_.next_question(t,!0,!0,!0):o>n&&qcard_.next_card(s,i,!0)},this.qlatex_convert=function(e){var t;return/\[qlatex|\[latex\]/.test(e)?(e=(e=e.replace(/\[qlatex\]/g,"\\[").replace(/\[\/qlatex\]/g,"\\]")).replace(/\[qlatexinline\]|\[latex\]/g,"\\(").replace(/\[\/qlatexinline\]|\[\/latex\]/g,"\\)"),t=!0):t=/\\[(\]]/.test(e),[e,t]},this.qlatex_init=function(e){if(!window.MathJax){debug[0]&&console.log("[qwiz_mathjax.js] (load MathJax)");var t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",document.head.appendChild(t)}var s=0;const i=function(){if(debug[0]&&console.log("[qlatex_init > delay_qwiz_mathjax_config] window.MathJax:",window.MathJax),window.MathJax&&window.MathJax.version){"2"==MathJax.version[0]?MathJax.Hub.Queue(["Typeset",MathJax.Hub],e[0]):MathJax.typeset()}else++s<20?setTimeout(i,200):console.log("[qlatex_init] unable to configure MathJax")};setTimeout(i,10)},this.restore_topic_question_counts=function(e){debug[0]&&console.log("[restore_topic_question_counts] data:",e);for(var t=e.i_qwiz_qdeck,s=e.topics.length,i=qwiz_.get_qwizdata(t,"topic_statistics"),a=qwiz_.get_qwizdata(t,"topics"),r=0,o=0,n=0,_=0;_<s;_++){var c=e.topics[_].replace(/\s/g,"_");c||(c="Other"),i||(i={}),i[c]||(i[c]={},i[c].n_correct=0,i[c].n_incorrect=0,-1==a.indexOf(c)&&a.push(c)),i[c].n_correct+=e.n_correct_by_unit_topic[_],i[c].n_incorrect+=e.n_incorrect_by_unit_topic[_],r+=e.n_correct_by_unit_topic[_],o+=e.n_incorrect_by_unit_topic[_],n+=e.n_questions_by_unit_topic[_]}debug[0]&&console.log("[restore_topic_question_counts] topic_statistics:",i),qwiz_.set_qwizdata(t,"topic_statistics",i),qwiz_.set_qwizdata(t,"topics",a),qwiz_.set_qwizdata(t,"n_correct",r),qwiz_.set_qwizdata(t,"n_incorrect",o),qwiz_.set_qwizdata(t,"restore_n_questions",n),qwiz_.set_qwizdata(t,"n_questions_for_done",n
3),qwiz_.set_qwizdata(t,"login_show_b",!1),qwiz_.set_qwizdata(t,"i_question",-1),qwiz_.next_question(t,!0,!0),qwiz_.next_question_from_intro(t,0),qwiz_.display_progress(t)},this.preview_limit=function(e,t,s){var i,a,r,o;"qwiz"==e?(i="quiz",a=qqc.T("question"),questions_cards=qqc.T("questions"),r="qwiz_",o=qwiz_):(i="flashcard deck",a=qqc.T("card"),questions_cards=qqc.T("cards"),r="qcard_",o=qcard_);var n="",_=!1;if("preview_period_expired"==t[s].pay_quiz_ok||"no_free_trial"==t[s].pay_quiz_ok)n="preview_period_expired"==t[s].pay_quiz_ok?"Your free trial period for quizzes has expired":"Sorry, no free trial for this quiz/deck.",o.display_login(s,!1,"pay",n),_=!0;else{if(-1==t[s].n_preview_questions)n="Sorry, you must register/log in to do this "+i,_=!0;else{t[s].n_preview_questions--;var c=$("div#pay_unlock_menu-"+("qwiz"==e?"qwiz":"qdeck")+s).find(" div.pay_preview_status");0==t[s].n_preview_questions?(n="Please log in or register to do more of this "+i,t[s].n_preview_questions=-1,_=!0,$("#unlocked-"+e+s).css({display:"none"}),$("#locked-"+e+s).css({display:"block"}),c.html(qqc.T("Preview mode. You have no")+" "+questions_cards+" "+qqc.T("remaining. Please log in or register to continue")+".")):c.html(qqc.T("Preview mode. You have")+" "+qqc.number_to_word(t[s].n_preview_questions)+" "+qqc.plural(a,questions_cards,t[s].n_preview_questions)+" "+qqc.T("remaining"))}_&&(n="Preview limit reached",!0===document_qwiz_user_logged_in_b?document_qwiz_university_discount?o.hide_menu_and_display_login(s,!1,"pay",n,!0,"Pay now"):o.hide_menu_and_display_login(s,!1,"paypal_subscription"):qqc.pay_unlock_menu_display_login(r,s,"free_trial",n,"","Sign up"))}return _},this.pay_lock_settings=function(e,t,s,i,a,r,o,n){var _=0,c=function(){if("not ready"==document_qwiz_user_logged_in_b)debug[0]&&console.log("[pay_lock_settings] n_tries:",_),++_<20?setTimeout(c,"100"):console.log("[pay_lock_settings] document_qwiz_user_logged_in_b not set");else{var d=0,l=s;void 0!==o&&(l=(d=parseInt(o))+1);for(var u=[],p=[],g=[],h=d;h<l;h++)if(t[h].pay_quiz_deck_id){u.push(h),p.push(t[h].pay_quiz_deck_id);var q=t[h].promo_code;q=q||"",g.push(q)}n=void 0!==n?n:"";var m={logged_in_f:document_qwiz_user_logged_in_b?1:0,i_qwizzes_decks:btoa(JSON.stringify(u)),pay_quiz_deck_ids:btoa(JSON.stringify(p)),promo_codes:btoa(JSON.stringify(g)),pay_registration_date_unix:document_qwiz_pay_registration_date_unix,msg:n};void 0!==i&&(m.i_login_qwiz=i,void 0===a&&(a=0,r=0),m.escaped_session_id=a,m.remember_f=r),debug[0]&&(m.qdebug=1);var f="get_pay_settings";/xget=/.test(document.location.search)&&(f="x"+f),qqc.qjax(e,h,"",f,m)}};c()},this.set_pay_settings=function(e){debug[0]&&(console.log("[set_pay_settings] data:",e),console.log("[set_pay_settings] document_qwiz_university_discount:",document_qwiz_university_discount));var t,s,i,a,r=void 0!==e.i_login_qwiz,o=e.qname;"qwiz_"==o?(t="qwiz",s=qqc.T("question"),questions_cards=qqc.T("questions"),i=qqc.T("quiz"),a=qwiz_):(t="deck",s=qqc.T("card"),questions_cards=qqc.T("cards"),i=qqc.T("flashcard deck"),a=qcard_);for(var n=e.pay_qwiz_decks_data,_=e.pay_qwiz_decks_maker_options,c=n.length,d=(new Date).getTime()/1e3,l=0;l<c;l++){var u=n[l],p=u.i_qwiz_deck,g=u.pay_errmsg,h="",q="";if(g)qqc.set_qwizdeckdata(o,p,"pay_errmsg",g);else{for(var m,f,w=u.payment_type_via,b=u.payment_type_id,v=u.maker_f,k=u.fee,z=u.good_for_n_periods,y=u.good_for_period,x=u.payment_description,T=u.n_preview_free_default,S=(u.registration_required,u.unpaid_msg),j=u.parallel_payment_type_id,C=u.n_preview_free,M=u.registration_trial_days,A=u.registration_trial_days_default,P=u.good_through_date_unix,O=(u.promo_code,u.promo_fee),N=u.promo_description,I=b.length,E=[],D=0,R="",B=-1,F=0,H=0,L=0,J=0,Y=[],U=[],V=[],Q=[],W=[],K=[],G=[],X=!1,Z=!0,ee=!1,te=!1,se=!1,ie=-1,ae=0;ae<I;ae++){if(f=!1,!v[ae]&&(!P[ae]||P[ae]+259200<d)){if(-1!=j.slice(0,ae).indexOf(b[ae]))continue;var re=!1;if(k[ae]<=0&&document_qwiz_good_through_date_ok&&(re=!0),65==b[ae]&&(re=!0),document_qwiz_independent_taker_f&&47==b[ae]&&(re=!0),document_qwiz_university_discount&&47!=b[ae]&&(debug[0]&&console.log("[set_pay_settings] skipping payment_type_id:",b[ae]),re=!0),!re){var oe;if(k[ae]<=0?(oe='<div style="margin-left: 10px; padding: 0;">',oe+=qqc.capitalize(qqc.number_to_word(z[ae])),X=!0):(oe='<div style="padding: 0;">',oe+="<b>College students</b>: $"+k[ae]+" for "+qqc.number_to_word(z[ae]),Z=!1),oe+=" "+y[ae]+qqc.plural("’s","s’",z[ae])+" access",x[ae]&&(oe+=" to "+x[ae],k[ae]<=0)){var ne="Sign up for a free trial";oe+=' <a href="javascript: '+(!0===document_qwiz_user_logged_in_b?`${o}.hide_menu_and_display_login (${p}, false, 'paypal_subscription')`:`qwiz_qcards_common.pay_unlock_menu_display_login ('${o}', ${p}, 'free_trial', ' ${ne}', '', 'Sign up')`)+'" class="qwiz_login">sign up</a>'}oe+="</div>",E.push(oe),-1!=O[ae]&&(te=!0,k[ae]=O[ae],x[ae]+=" - "+N[ae],f=!0,se=!0,ie=J),Y.push(b[ae]),U.push(k[ae]),V.push(z[ae]),Q.push(y[ae]),W.push(x[ae]),K.push(f),S[ae]&&G.push(S[ae]),J++;var _e=C[ae];-1==_e&&(_e=T[ae]),_e>
3H&&(H=_e);var ce=M[ae],de=A[ae];-1==ce&&(ce=de),ce>L&&(L=ce,m=de)}}(!0===document_qwiz_user_logged_in_b||r)&&P[ae]>=D&&(D=P[ae],k[ae]>B&&(B=k[ae]),F=v[ae],R=w[ae])}qqc.set_qwizdeckdata(o,p,"taker_payment_type_ids",Y),qqc.set_qwizdeckdata(o,p,"taker_fees",U),qqc.set_qwizdeckdata(o,p,"taker_good_for_n_periodss",V),qqc.set_qwizdeckdata(o,p,"taker_good_for_periods",Q),qqc.set_qwizdeckdata(o,p,"taker_payment_descriptions",W),qqc.set_qwizdeckdata(o,p,"taker_payment_selected_bs",K),qqc.set_qwizdeckdata(o,p,"taker_unpaid_msgs",G),qqc.set_qwizdeckdata(o,p,"any_taker_options_free_b",X),qqc.set_qwizdeckdata(o,p,"all_taker_options_free_b",Z),qqc.set_qwizdeckdata(o,p,"any_promo",te),-1!=ie&&qqc.set_qwizdeckdata(o,p,"i_promo",ie);var le=get_qwizdeckdata(o,p,"pay_quiz_deck_id");qqc.set_qwizdeckdata(o,p,"taker_pay_quiz_deck_id",le),qqc.set_qwizdeckdata(o,p,"promo_applied",se);var ue=[],pe=!1;if(!document_qwiz_user_logged_in_b&&_.length){var ge=_[l],he=(b=ge.payment_type_id,k=ge.fee,z=ge.good_for_n_periods,y=ge.good_for_period,x=ge.payment_description,[]),qe=[],me=[],fe=[],we=[],be=k.length;for(ae=0;ae<be;ae++){var ve;k[ae]<-1.5||(k[ae]<0?ve=x[ae]:(pe=!0,ve="$"+k[ae]+" for "+qqc.number_to_word(z[ae])+" "+y[ae]+qqc.plural("","s",z[ae]),x[ae]&&(ve+=" - "+x[ae])),ue.push(ve),he.push(b[ae]),qe.push(k[ae]),me.push(z[ae]),fe.push(y[ae]),we.push(x[ae]))}qqc.set_qwizdeckdata(o,p,"maker_payment_type_ids",b),qqc.set_qwizdeckdata(o,p,"maker_fees",k),qqc.set_qwizdeckdata(o,p,"maker_good_for_n_periodss",z),qqc.set_qwizdeckdata(o,p,"maker_good_for_periods",y),qqc.set_qwizdeckdata(o,p,"maker_payment_descriptions",x);le=get_qwizdeckdata(o,p,"pay_quiz_deck_id");qqc.set_qwizdeckdata(o,p,"maker_pay_quiz_deck_id",le)}}var ke=$("#locked-"+t+p),ze=$("#unlocked-"+t+p);if(qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_questions"),!0===document_qwiz_user_logged_in_b||r){document_qwiz_pay_registration_date_unix||(document_qwiz_pay_registration_date_unix=parseInt(e.pay_registration_date_unix,10));d=(new Date).getTime()/1e3;var ye=!1;if(document_qwiz_maker_privileges){ye=!0,qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","paid"),ze.css({display:"block",filter:"none"}),ke.css({display:"none"}),document_qwiz_good_through_date_ok=!0,document_qwiz_good_through_date=DateFormat.format.date(1e3*D,"yyyy-MM-dd");h="Available through "+DateFormat.format.date(1e3*D,"MMMM d, yyyy")}else if(B>=0||1==F)if(D+259200>d){ye=!0,qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","paid"),get_qwizdeckdata(o,p,"display_pay_screen")&&!0,ze.css({display:"block",filter:"none"}),document_qwiz_good_through_date=DateFormat.format.date(1e3*D,"yyyy-MM-dd");const e=DateFormat.format.date(1e3*D,"MMMM d, yyyy");h="student"==R?0==B?"Subscription - free trial through "+e:document_qwiz_university_discount?"University discount good to "+e:"Subscription good through "+e:"teacher"==R?"Class access available through "+e:"Available through "+e,void 0===document_qwiz_good_through_date_ok&&(document_qwiz_good_through_date_ok=!0),ke.css({display:"none"})}else if(ye=!0,document_qwiz_good_through_date_ok=!1,D){document_qwiz_good_through_date=DateFormat.format.date(1e3*D,"yyyy-MM-dd");const e=DateFormat.format.date(1e3*D,"MMMM d, yyyy");h=qqc.T("Access expired "+e),ze.css({display:"none"}),ke.css({display:"block"}),qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_period_expired")}else document_qwiz_good_through_date="",h=qqc.T("Limited preview."),ze.css({display:"block",filter:""}),ke.css({display:"none"}),qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_questions"),qqc.set_qwizdeckdata(o,p,"n_preview_questions",H);if(!ye)if(document_qwiz_good_through_date_ok=!1,ee)if(document_qwiz_pay_registration_date_unix+48*L*3600<d)ke.css({display:"block"}),0==L?(h="Preview mode. You have "+qqc.number_to_word(H)+" "+qqc.plural(s,questions_cards,H)+" remaining",qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_questions"),qqc.set_qwizdeckdata(o,p,"n_preview_questions",H),B<0&&D+172800>d&&(h+="<br />This "+i+" is not part of the free trial")):L==de?(h="Sorry, your free trial period for quizzes has expired",q="To continue use:<br />",qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_period_expired")):(h="Sorry, your free trial period for this quiz/deck has expired",q="To continue use:",qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_period_expired")),ze.css({display:"none"});else{var $e=parseInt((document_qwiz_pay_registration_date_unix+24*L*3600-d)/86400,10);h=$e>0?L==de?"You have "+qqc.number_to_word($e)+" "+qqc.plural(qqc.T("day"),qqc.T("days"),$e)+" "+qqc.T("left in your free trial of quizzes/flashcard decks"):"You have "+qqc.number_to_word($e)+" "+qqc.plural(qqc.T("day"),qqc.T("days"),$e)+" "+qqc.T("left in your free trial of this quiz/flashcard deck"):qqc.T("You have less than one day left in your free trial"),q=qqc.T("After your free trial:"),ke.css({display:"none"}),ze.css({display:"block"}),qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","preview_period")}else 0==H?qqc.set_qwizdeckdata(o,p,"n_preview_questions",-1):qqc.set_qwizdeckdata(o,p,"n_preview_questions",H),ze.css({display:"block"}),h=qqc.T("Preview mode. You have")+" "+qqc.number_to_word(H)+" "+qqc.plural(s,questions_cards,H)+" "+qqc.T("remaining"),ke.css({display:"none"})}else if(0==H)qqc.set_qwizdeckdata(o,p,"n_preview_questions",-1),ke.css({display:"block"}),h=qqc.T("Sorry, no preview available for this quiz/deck."),q="",qqc.set_qwizdeckdata(o,p,"pay_quiz_ok","no_free_trial"),ze.css({display:"none"});else{if(0==L)h=qqc.T("Preview mode. You have")+" "+qqc.number_to_word(H)+" "+qqc.plural(s,questions_cards,H)+" "+qqc.T("remaining"),q="<b>Students working on their own:</b>";else{ne=qqc.T("Log in")+" – "+qqc.T("or register for a free trial");h=qqc.T("Please")+" <a href=\"javascript: qwiz_qcards_common.pay_unlock_menu_display_login ('"+o+"', "+p+", '', '"+ne+'\')" class="qwiz_login">'+qqc.T("log in or register")+"</a> for a "+qqc.number_to_word(L)+"-day free trial of ",h+=L==m?qqc.T("quizzes on this site."):qqc.T("this quiz/deck."),q=qqc.T("After your free trial:")}qqc.set_qwizdeckdata(o,p,"n_preview_questions",H),ke.css({display:"none"}),ze.css({display:"block",filter:""})}var xe=set_pay_unlock_menu(o,p,g,h,q,E,Z,ue,pe);
3if("qwiz_"==o){var Te=$("div#summary-qwiz"+p+" span.unpaid_msg");Te.length&&("paid"==qwiz_.get_qwizdata(p,"pay_quiz_ok")?Te.hide():Te.show());var Se=$("div#summary-qwiz"+p+" span.unpaid_msg_payment_type");if(Se.length)if("paid"!=qwiz_.get_qwizdata(p,"pay_quiz_ok"))if((S=qwiz_.get_qwizdata(p,"taker_unpaid_msgs")).length){var je=Math.floor(Math.random()*S.length);Se.html(S[je])}}}xe&&check_maker_session_id();const Ce=set_display_pay_screen(o,p);if(Ce||e.msg){$("div.qwiz-progress-container.qwiz"+p).show();ne=e.msg?e.msg:"";const t=qqc.$get_login_div(o,p);if(document_qwiz_user_logged_in_b)if("free_trial"==Ce){const e=qqc.set_immediate_payment(o,p);ne="<br /><br />";if(e){const e=(new Date).getTime()/1e3;Date.parse(document_qwiz_good_through_date+"T00:00:00Z")/1e3>e+1209600?(ne+="<i>Thanks for using Learn-Biology.com!</i>",t.append(ne).show()):a.hide_menu_and_display_login(p,!1,"free_trial")}else document_qwiz_good_through_date_ok?(ne+="<i>Thanks for using Learn-Biology.com!</i>",t.append(ne).show()):document_qwiz_good_through_date?(ne+="<i>Sorry; a free trial subscription is not available to existing users</i>",t.html(ne).show()):a.hide_menu_and_display_login(p,!1,"paypal_subscription")}else if("special_offer"==Ce)document_qwiz_good_through_date>"2024-03-26"?(ne="<br />\n <br />\n <i>Sorry; special offer not available</i>\n ",t.append(ne).show()):a.hide_menu_and_display_login(p,!1,"free_trial");else if("login"==Ce)$(`#qwiz${p}-q0`).html(' <br />\n <p class="qwiz-center qwiz-bold">\n You are currently logged in.\n </p>\n <p>\n If you want to log in as a different user, hover on the green down-triangle (above right) and click "Sign out".\n </p>\n ');else if("open_register"==Ce)ne||(ne="<br />\n <b>You are currently logged in.</b>\n <br />\n <i>If you want to create a new account hover over the green down-triangle to sign out.</i>\n "),t.append(ne).show();else{/register/.test(Ce)&&qqc.check_session_id(p,!0);setTimeout((function(){void 0===document_qwiz_university_discount&&"paid"!=qwiz_.get_qwizdata(p,"pay_quiz_ok")?a.hide_menu_and_display_login(p,!1,"register",ne):register_taker_global_reg_code_ok_f||a.hide_menu_and_display_login(p,!1,"pay",ne,!0,"Pay now")}),500)}else if("register"==Ce||"open_register"==Ce||"subscribe"==Ce||"signup"==Ce){var Me="register";"open_register"==Ce&&(Me="open_register"),a.hide_menu_and_display_login(p,!1,Me,ne,!1)}else"free_trial"==Ce?a.hide_menu_and_display_login(p,!1,"free_trial"):"special_offer"==Ce?(ne="Please log in (black down-triangle above right)",t.append(ne).show()):"login"==Ce?a.hide_menu_and_display_login(p,!1,""):(ne="Please log in or register so you can get credited for your payment",qqc.pay_unlock_menu_display_login(o,p,"",ne));$("div#mode-qwiz"+p).hide(),$("div.lock_unlock.qwiz"+p).hide(),$("div#qwiz_login-qwiz"+p+" button.qwiz_pay_cancel").hide(),$("div#qwiz_login-qwiz"+p+" .qwiz_login_cancel_no_thanks").hide(),$("div#next_button-qwiz"+p+" button").hide()}},this.set_qwizdeckdata=function(e,t,s,i){"qwiz_"==e?qwiz_.set_qwizdata(t,s,i):qcard_.set_deckdata(t,s,i)},this.find_opening_tags_at_end=function(e){var t=e.match(/(\s*(<[^/][^>]*>\s*)*)$/);debug[10]&&(console.log("[find_opening_tags_at_end] htm:",e),console.log("[find_opening_tags_at_end] all_opening_tags_match:",t));var s="";if(t&&void 0!==t[1]){var i=t[1],a=i.match(/\s*(<[^/][^>]*>\s*)|([^<]*$)/g);if(debug[10]&&(console.log("[find_opening_tags_at_end] all_opening_tags:",i),console.log("[find_opening_tags_at_end] opening_tags_match:",a)),a){for(var r=[],o=a.length-1;o>=0;o--){var n=a[o];if(""!=n){if("<"!=n[0]&&!/\s/.test(n[0]))break;var _=n.replace(/\s/g,"").substr(0,4);if("<br>"==_)break;if("<img"==_||"<inp"==_)break;r.unshift(n)}}s=r.join("")}}return debug[10]&&console.log("[find_opening_tags_at_end] opening_tags:",s),s},this.parse_html_block=function(e,t,s,i){debug[10]&&console.log("[parse_html_block] shortcodes: ",t,", htm: ",e);var a,r="string"==typeof i,o=0,n="";if("^"!=t[0]){var _=parse_html_block_pattern(t),c=new RegExp(_),d=e.search(c);if(-1==d)return debug[10]&&console.log("[parse_html_block] html_block: NA"),"NA";o=3;var l=e.substr(0,d);n=qqc.find_opening_tags_at_end(l)}var u=-1;if(s.length){_=parse_html_block_pattern(s);c=new RegExp(_),u=e.substr(d+o).search(c)}if(-1==u)a=n+e.substr(d);else if(0==u)a="";else{var p,g,h=e.substr(d,o+u);if(""!=(p=qqc.find_opening_tags_at_end(h)))c=new RegExp(p+"$"),g=h.replace(c,"");else g=h;if(""!=(a=n+g)){var q=g.replace(/<[^>]+>/gm,"");null!=i&&(q=q.replace(/ | |<br[^>]*>/gm,""));var m=-1==q.search(/\S/);m&&(r||(a=""))}}return r&&!m&&(a=""),debug[10]&&console.log("[parse_html_block] html_block:",a),a},this.find_matching_block=function(e){for(var t="",s=e.length,i=0,a=0,r=[],o=!1;i<s;
3){if("<"==e[i]){if("<br>"==e.substr(i,4)||"<hr>"==e.substr(i,4)){i+=3;continue}if("\x3c!--"==e.substr(i,4)){i+=4;continue}if("<img"==e.substr(i,4)||"<input"==e.substr(i,6)||"<br"==e.substr(i,3)||"<hr"==e.substr(i,3)){for(i+=3;i<s&&">"!=e[++i];);continue}if("<p"==e.substr(i,2)){if(o){i++;continue}o=!0}if("/"==e[++i]){"/div"==e.substr(i,4)?o&&(a--,o=!1):"/p"==e.substr(i,2)&&(o=!1),a--,i++;for(var n="";i<s&&">"!=e[i];)n+=e[i],i++;if(debug[5]&&console.log("[find_matching_block] i_level: ",a,", closing_tag:",n,", tags:",r.slice(0,a+1)),n!=r[a]&&(debug[5]&&console.log("XXX"),a++),a<=0){for(t=e.substring(0,i);i<s&&">"!=e[i];)t+=e[i];t+=">";break}}else{for(var _="";i<s&&">"!=e[i]&&!/\s/.test(e[i]);)_+=e[i],i++;r[a]=_,debug[5]&&(console.log("[find_matching_block] (new_level) tag_i_level:",_,", (followed by): ",e.substr(i+1,30)),console.log("[find_matching_block] tags:",r.slice(0,a+1))),a++}}else"/"==e[i]&&">"==e[++i]&&a--;i++}return debug[5]&&console.log("[find_matching_block] htm_block:",t),t},this.select_placeholder=function(e){debug[0]&&console.log("[select_placeholder] $edit_field:",e);var t=e.find("span.qwizard_placeholder");if(0!=t.length){document_qwiz_bubblebar_enabled_b=!1,setTimeout((function(){t[0];var s,i=e.attr("id");if(i&&(s=tinyMCE.get(i),debug[0]&&console.log("[select_placeholder] ed:",s),!s)){setTimeout((function(){s=tinyMCE.get(i),debug[0]&&console.log("[select_placeholder > delay_get ] ed:",s)}),500)}if(s&&s.selection&&s.dom.select("span")&&s.selection.select(s.dom.select("span")[0]),i&&"qcard"==i.substr(0,5)){e.off("keydown").off("
3click");var a="span"==e[0].tagName.toLowerCase();e.on("click keydown",(function(t){qwizard.remove_placeholder(t,e,a)}))}setTimeout("document_qwiz_bubblebar_enabled_b = true",200)}),500)}else debug[0]&&console.log("[select_placeholder] $placeholder.length: 0")},this.check_pairs=function(e,t,s){for(var i="",a=0,r=0;opening_pos=s.indexOf(e,a),closing_pos=s.indexOf(t,r),-1!=opening_pos||-1!=closing_pos;){if(i="ok",closing_pos<=opening_pos||-1==opening_pos||opening_pos<r){i="Mis-matched pairs for "+e+"..."+t;break}a=opening_pos+1,r=closing_pos+1}return i},this.qdebug=function(e){if(/qdebug=/.test(document.location.search)){e[0]=!0;let t=decodeURIComponent(document.location.search).match(/qdebug=([\d,]+)/)[1];if(t){t=t.split(",");for(const s of t){e[parseInt(s)]=!0}}}},this.hex_to_rgb=function(e){const t=e.substr(0,2),s=e.substr(2,2),i=e.substr(4,2);return[parseInt(t,16),parseInt(s,16),parseInt(i,16)]},this.decodeHtmlEntities=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value},this.encodeHtmlEntities=function(e){for(var t=[],s=e.length-1;s>=0;s--)t.unshift(["&#",e[s].charCodeAt(),";"].join(""));return t.join("")},this.addSlashes=function(e){return(e+"").replace(/[\\"']/g,"\\$&").replace(/\n/g,"\\n").replace(/\u0000/g,"\\0")},this.decode_image_tags=function(e){return e=e.replace(/<input[^>]+?name="qwiz_img"/g,"<img")},this.shortcodes_to_video_elements=function(e){if(e=e.replace(/\[audio(.*?)(src|mp3|m4a|ogg|wav|wma|mp4|m4v|webm|ogv|wmv|flv)([^\]]*)\]/g,'<video controls$1src$3 data-audio_video="audio" height="30" width="280"></video>').replace(/\[video(.*?)(src|mp3|m4a|ogg|wav|wma|mp4|m4v|webm|ogv|wmv|flv)([^\]]*)\]/g,'<video controls$1src$3 data-audio_video="video"></video>'),qwizzled.wp_editing_page_f){var t=e.match(/\[embed\][^\[]+\[\/embed\]/g);if(t){for(var s=[],i=[],a=t.length,r=0;r<a;r++)s.push(t[r].replace(/\[\/{0,1}embed\]/g,"")),i.push({width:500});"not ready"==qwiz_ajaxurl&&(qwiz_ajaxurl=qqc.get_qwiz_param("ajaxurl",""));var o={action:"process_embeds",urls:encodeURIComponent(JSON.stringify(s)),args:encodeURIComponent(JSON.stringify(i))};$.ajax({type:"POST",async:!1,url:qwiz_ajaxurl,data:o,success:function(s){for(var i=0;i<a;i++){var r=s[i].replace(">",' data-embed="true">');e=e.replace(t[i],r)}}})}}return debug[0]&&console.log("[shortcodes_to_video_elements] htm:",e),e},this.init_image_swap=function(e,t){var s=$(e),i=s.find("img");if(i.length){var a=i.attr("src"),r=$("img"),o=r.eq(r.index(i)-1),n=o.attr("src");o.removeAttr("srcset"),s.hasClass("hover")?o.attr("onmouseenter",`qwiz_qcards_common.img_swap (this, 'hover', '${a}')`).attr("onmouseleave",`this.src="${n}"`):(t&&o.click((function(e){e.stopPropagation()})),o.attr("onclick",`qwiz_qcards_common.img_swap (this, 'click', '${a}', '${n}')`).css({cursor:"pointer"})),s.removeClass("not_inited")}},this.img_swap=function(e,t,s,i){if(!e.style.width){var a=e.width,r=e.height;$(e).css({width:a+"px",height:r+"px"})}"hover"==t?e.src=s:e.qwiz_alt_img?(e.src=i,e.qwiz_alt_img=!1):(e.src=s,e.qwiz_alt_img=!0)},this.hhmmss_from_sec=function(e){var t=e%60;t<10&&(t="0"+t);var s=parseInt(e/60)%60,i=s+":"+t;if(e>=3600){s<10&&(s="0"+s);i=parseInt(e/3600)+":"+i}return i},this.isInteger=function(e){return(0^e)===e},this.bin2hex=function(e){var t,s,i,a="";for(t=0,s=(e+="").length;t<s;t++)a+=(i=e.charCodeAt(t).toString(16)).length<2?"0"+i:i;return a},$.fn.changeElements=function(e){return $(this).each((function(){var t={};$.each(this.attributes,(function(e,s){t[s.nodeName]=s.nodeValue}));var s=$("<"+e+"/>",t);$(this).replaceWith(s)})),$([])},this.metaphone=function(e,t){var s=typeof e;if("undefined"===s||"object"===s&&null!==e)return null;if("number"===s&&(isNaN(e)?e="NAN":isFinite(e)||(e="INF")),t<0)return!1;t=Math.floor(+t)||0;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="AEIOU",r="EIY",o=new RegExp("^[^"+i+"]+");if(!(e=(e="string"==typeof e?e:"").toUpperCase().replace(o,"")))return"";var n,_,c=function(e,t){return""!==t&&-1!==e.indexOf(t)},d=0,l=e.charAt(0),u=e.charAt(1),p=e.length,g="";switch(l){case"A":g+="E"===u?u:l,d+=1;break;case"G":case"K":case"P":"N"===u&&(g+=u,d+=2);break;case"W":"R"===u?(g+=u,d+=2):("H"===u||c(a,u))&&(g+="W",d+=2);break;case"X":g+="S",d+=1;break;case"E":case"I":case"O":case"U":g+=l,d++}for(;d<p&&(0===t||g.length<t);d+=1)if(l=e.charAt(d),u=e.charAt(d+1),_=e.charAt(d-1),n=e.charAt(d+2),l!==_||"C"===l)switch(l){case"B":"M"!==_&&(g+=l);break;case"C":c(r,u)?"I"===u&&"A"===n?g+="X":"S"!==_&&(g+="S"):"H"===u?(g+="X",d+=1):g+="K";break;case"D":"G"===u&&c(r,n)?(g+="J",d+=1):g+="T";break;case"G":"H"===u?c("BDH",e.charAt(d-3))||"H"===e.charAt(d-4)||(g+="F",d+=1):"N"===u?c(i,n)&&"NED"!==e.substr(d+1,3)&&(g+="K"):c(r,u)&&"G"!==_?g+="J":g+="K";break;case"H":c(a,u)&&!c("CGPST",_)&&(g+=l);break;case"K":"C"!==_&&(g+="K");break;case"P":g+="H"===u?"F":l;break;case"Q":g+="K";break;case"S":"I"===u&&c("AO",n)?g+="X":"H"===u?(g+="X",d+=1):g+="S";break;
3case"T":"I"===u&&c("AO",n)?g+="X":"H"===u?(g+="0",d+=1):"CH"!==e.substr(d+1,2)&&(g+="T");break;case"V":g+="F";break;case"W":case"Y":c(a,u)&&(g+=l);break;case"X":g+="KS";break;case"Z":g+="S";break;case"F":case"J":case"L":case"M":case"N":case"R":g+=l}return g}};qwiz_qcards_common_f.call(qwiz_qcards_common), 4/*! 5 * jQuery Cookie Plugin v1.4.1 6 * https://github.com/carhartl/jquery-cookie 7 * 8 * Copyright 2013 Klaus Hartl 9 * Released under the MIT license 10 */ 11function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}((function(e){var t=/\+/g;function s(e){return r.raw?e:encodeURIComponent(e)}function i(e){return s(r.json?JSON.stringify(e):String(e))}function a(s,i){var a=r.raw?s:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),r.json?JSON.parse(e):e}catch(e){}}(s);return e.isFunction(i)?i(a):a}var r=e.cookie=function(t,o,n){if(void 0!==o&&!e.isFunction(o)){if("number"==typeof(n=e.extend({},r.defaults,n)).expires){var _=n.expires,c=new Date;c.setMilliseconds(c.getMilliseconds()+864e5*_)}const a=[s(t),"=",i(o),n.expires?";expires="+c.toUTCString():"",n.path?";path="+n.path:"",n.domain?";domain="+n.domain:"",n.secure?";secure":""].join("");return document.cookie=a}for(var d,l=t?void 0:{},u=document.cookie?document.cookie.split("; "):[],p=0,g=u.length;p<g;p++){var h=u[p].split("="),q=(d=h.shift(),r.raw?d:decodeURIComponent(d)),m=h.join("=");if(t&&t===q){l=a(m,o);break}t||void 0===(m=a(m))||(l[q]=m)}return l};r.defaults={},e.removeCookie=function(t,s){return void 0!==e.cookie(t)&&(e.cookie(t,"",e.extend({},s,{expires:-1})),!e.cookie(t))}}));var CryptoJS=CryptoJS||function(e,t){var s={},i=s.lib={},a=function(){},r=i.Base={extend:function(e){a.prototype=this;var t=new a;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||_).stringify(this)},concat:function(e){var t=this.words,s=e.words,i=this.sigBytes;if(e=e.sigBytes,this.clamp(),i%4)for(var a=0;a<e;a++)t[i+a>>>2]|=(s[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535<s.length)for(a=0;a<e;a+=4)t[i+a>>>2]=s[a>>>2];else t.push.apply(t,s);return this.sigBytes+=e,this},clamp:function(){var t=this.words,s=this.sigBytes;t[s>>>2]&=4294967295<<32-s%4*8,t.length=e.ceil(s/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var s=[],i=0;i<t;i+=4)s.push(4294967296*e.random()|0);return new o.init(s,t)}}),n=s.enc={},_=n.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var s=[],i=0;i<e;i++){var a=t[i>>>2]>>>24-i%4*8&255;s.push((a>>>4).toString(16)),s.push((15&a).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,s=[],i=0;i<t;i+=2)s[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new o.init(s,t/2)}},c=n.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var s=[],i=0;i<e;i++)s.push(String.fromCharCode(t[i>>>2]>>>24-i%4*8&255));return s.join("")},parse:function(e){for(var t=e.length,s=[],i=0;i<t;i++)s[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new o.init(s,t)}},d=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var s=this._data,i=s.words,a=s.sigBytes,r=this.blockSize,n=a/(4*r);if(t=(n=t?e.ceil(n):e.max((0|n)-this._minBufferSize,0))*r,a=e.min(4*t,a),t){for(var _=0;_<t;_+=r)this._doProcessBlock(i,_);_=i.splice(0,t),s.sigBytes-=a}return new o.init(_,a)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=l.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,s){return new e.init(s).finalize(t)}},_createHmacHelper:function(e){return function(t,s){return new u.HMAC.init(e,s).finalize(t)}}});var u=s.algo={};return s}(Math);!function(e){var t,s=(t=CryptoJS).lib,i=s.Base,a=s.WordArray;(t=t.x64={}).Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,s=[],i=0;i<t;i++){var r=e[i];s.push(r.high),s.push(r.low)}return a.create(s,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),s=t.length,a=0;a<s;a++)t[a]=t[a].clone();return e}})}(),function(e){for(var t=CryptoJS,s=(r=t.lib).WordArray,i=r.Hasher,a=t.x64.Word,r=t.algo,o=[],n=[],_=[],c=1,d=0,l=0;24>l;l++){o[c+5*d]=(l+1)*(l+2)/2%64;var u=(2*c+3*d)%5;c=d%5,d=u}for(c=0;5>c;c++)for(d=0;5>d;d++)n[c+5*d]=d+(2*c+3*d)%5*5;for(c=1,d=0;24>d;d++){for(var p=u=l=0;7>p;
11p++){if(1&c){var g=(1<<p)-1;32>g?u^=1<<g:l^=1<<g-32}c=128&c?c<<1^113:c<<1}_[d]=a.create(l,u)}var h=[];for(c=0;25>c;c++)h[c]=a.create();r=r.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;25>t;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var s=this._state,i=this.blockSize/2,a=0;a<i;a++){var r=16711935&((r=e[t+2*a])<<8|r>>>24)|4278255360&(r<<24|r>>>8),c=16711935&((c=e[t+2*a+1])<<8|c>>>24)|4278255360&(c<<24|c>>>8),d=s[a];d.high^=c,d.low^=r}for(i=0;24>i;i++){for(a=0;5>a;a++){for(var l=r=0,u=0;5>u;u++)r^=(d=s[a+5*u]).high,l^=d.low;(d=h[a]).high=r,d.low=l}for(a=0;5>a;a++)for(d=h[(a+4)%5],c=(r=h[(a+1)%5]).high,u=r.low,r=d.high^(c<<1|u>>>31),l=d.low^(u<<1|c>>>31),u=0;5>u;u++)(d=s[a+5*u]).high^=r,d.low^=l;for(c=1;25>c;c++)a=(d=s[c]).high,d=d.low,32>(u=o[c])?(r=a<<u|d>>>32-u,l=d<<u|a>>>32-u):(r=d<<u-32|a>>>64-u,l=a<<u-32|d>>>64-u),(d=h[n[c]]).high=r,d.low=l;for(d=h[0],a=s[0],d.high=a.high,d.low=a.low,a=0;5>a;a++)for(u=0;5>u;u++)d=s[c=a+5*u],r=h[c],c=h[(a+1)%5+5*u],l=h[(a+2)%5+5*u],d.high=r.high^~c.high&l.high,d.low=r.low^~c.low&l.low;d=s[0],a=_[i],d.high^=a.high,d.low^=a.low}},_doFinalize:function(){var t=(r=this._data).words,i=8*r.sigBytes,a=32*this.blockSize;t[i>>>5]|=1<<24-i%32,t[(e.ceil((i+1)/a)*a>>>5)-1]|=128,r.sigBytes=4*t.length,this._process();for(var r=this._state,o=(i=(t=this.cfg.outputLength/8)/8,a=[],0);o<i;o++){var n=16711935&((n=(_=r[o]).high)<<8|n>>>24)|4278255360&(n<<24|n>>>8),_=16711935&((_=_.low)<<8|_>>>24)|4278255360&(_<<24|_>>>8);a.push(_),a.push(n)}return new s.init(a,t)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),s=0;25>s;s++)t[s]=t[s].clone();return e}}),t.SHA3=i._createHelper(r),t.HmacSHA3=i._createHmacHelper(r)}(Math);var DateFormat={};!function(e){var t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],r={Jan:"01",Feb:"02",Mar:"03",Apr:"04",May:"05",Jun:"06",Jul:"07",Aug:"08",Sep:"09",Oct:"10",N
11ov:"11",Dec:"12"},o=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d{0,3}[Z\-+]?(\d{2}:?\d{2})?/;DateFormat.format=function(){function e(e){return t[parseInt(e,10)]||e}function n(e){return s[parseInt(e,10)]||e}function _(e){var t=parseInt(e,10)-1;return i[t]||e}function c(e){var t=parseInt(e,10)-1;return a[t]||e}function d(e){return r[e]||e}function l(e){var t,s,i,a,r,o=e,n="";return-1!==o.indexOf(".")&&(a=o.split("."),o=a[0],n=a[1]),3===(r=o.split(":")).length?(t=r[0],s=r[1],i=r[2].replace(/\s.+/,"").replace(/[a-z]/gi,""),{time:o=o.replace(/\s.+/,"").replace(/[a-z]/gi,""),hour:t,minute:s,second:i,millis:n}):{time:"",hour:"",minute:"",second:"",millis:""}}function u(e,t){for(var s=t-String(e).length,i=0;i<s;i++)e="0"+e;return e}return{parseDate:function(e){var t={date:null,year:null,month:null,dayOfMonth:null,dayOfWeek:null,time:null};if("number"==typeof e)return this.parseDate(new Date(e));if("function"==typeof e.getFullYear)t.year=String(e.getFullYear()),t.month=String(e.getMonth()+1),t.dayOfMonth=String(e.getDate()),t.time=l(e.toTimeString()+"."+e.getMilliseconds());else if(-1!=e.search(o))values=e.split(/[T\+-]/),t.year=values[0],t.month=values[1],t.dayOfMonth=values[2],t.time=l(values[3].split(".")[0]);else switch(values=e.split(" "),6===values.length&&isNaN(values[5])&&(values[values.length]="()"),values.length){case 6:t.year=values[5],t.month=d(values[1]),t.dayOfMonth=values[2],t.time=l(values[3]);break;case 2:subValues=values[0].split("-"),t.year=subValues[0],t.month=subValues[1],t.dayOfMonth=subValues[2],t.time=l(values[1]);break;case 7:case 9:case 10:t.year=values[3],t.month=d(values[1]),t.dayOfMonth=values[2],t.time=l(values[4]);break;case 1:subValues=values[0].split(""),t.year=subValues[0]+subValues[1]+subValues[2]+subValues[3],t.month=subValues[5]+subValues[6],t.dayOfMonth=subValues[8]+subValues[9],t.time=l(subValues[13]+subValues[14]+subValues[15]+subValues[16]+subValues[17]+subValues[18]+subValues[19]+subValues[20]);break;default:return null}return t.time?t.date=new Date(t.year,t.month-1,t.dayOfMonth,t.time.hour,t.time.minute,t.time.second,t.time.millis):t.date=new Date(t.year,t.month-1,t.dayOfMonth),t.dayOfWeek=String(t.date.getDay()),t},date:function(t,s){try{var i=this.parseDate(t);if(null===i)return t;i.date;for(var a=i.year,r=i.month,o=i.dayOfMonth,d=i.dayOfWeek,l=i.time,p="",g="",h="",q=!1,m=0;m<s.length;m++){var f=s.charAt(m),w=s.charAt(m+1);if(q)"'"==f?(g+=""===p?"'":p,p="",q=!1):p+=f;else switch(h="",p+=f){case"ddd":g+=e(d),p="";break;case"dd":if("d"===w)break;g+=u(o,2),p="";break;case"d":if("d"===w)break;g+=parseInt(o,10),p="";break;case"D":g+=o=1==o||21==o||31==o?parseInt(o,10)+"st":2==o||22==o?parseInt(o,10)+"nd":3==o||23==o?parseInt(o,10)+"rd":parseInt(o,10)+"th",p="";break;case"MMMM":g+=c(r),p="";break;case"MMM":if("M"===w)break;g+=_(r),p="";break;case"MM":if("M"===w)break;g+=u(r,2),p="";break;case"M":if("M"===w)break;g+=parseInt(r,10),p="";break;case"y":case"yyy":if("y"===w)break;g+=p,p="";break;case"yy":if("y"===w)break;g+=String(a).slice(-2),p="";break;case"yyyy":g+=a,p="";break;case"HH":g+=u(l.hour,2),p="";break;case"H":if("H"===w)break;g+=parseInt(l.hour,10),p="";break;case"hh":hour=0===parseInt(l.hour,10)?12:l.hour<13?l.hour:l.hour-12,g+=u(hour,2),p="";break;case"h":if("h"===w)break;hour=0===parseInt(l.hour,10)?12:l.hour<13?l.hour:l.hour-12,g+=parseInt(hour,10),p="";break;case"mm":g+=u(l.minute,2),p="";break;case"m":if("m"===w)break;g+=l.minute,p="";break;case"ss":g+=u(l.second.substring(0,2),2),p="";break;case"s":if("s"===w)break;g+=l.second,p="";break;case"S":case"SS":if("S"===w)break;g+=p,p="";break;case"SSS":g+=l.millis.substring(0,3),p="";break;case"a":g+=l.hour>=12?"PM":"AM",p="";break;case"p":g+=l.hour>=12?"p.m.":"a.m.",p="";break;case"E":g+=n(d),p="";break;case"'":p="",q=!0;break;default:g+=f,p=""}}return g+=h}catch(e){return console&&console.log&&console.log(e),t}},toBrowserTimeZone:function(e,t){return this.date(new Date(e),t||"MM/dd/yyyy HH:mm:ss")}}}()}(),function(){"use strict";var e="object"==typeof window?window:{};!e.JS_CRC_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=global);var t,s,i,a,r=!e.JS_CRC_NO_COMMON_JS&&"object"==typeof module&&module.exports,o="function"==typeof define&&define.amd,n=!e.JS_CRC_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,_="0123456789abcdef".split(""),c=[{name:"qwiz_crc32",polynom:3988292384,initValue:-1,bytes:4},{name:"qwiz_crc16",polynom:40961,initValue:0,bytes:2}];for(t=0;t<c.length;++t){for((u=c[t]).method=function(e){return function(t){return d(t,e)}}(u),u.table=[],s=0;256>s;++s){for(a=s,i=0;8>i;++i)a=1&a?u.polynom^a>>>1:a>>>1;u.table[s]=a>>>0}}var d=function(e,t){var s="string"!=typeof e;s&&n&&e instanceof ArrayBuffer&&(e=new Uint8Array(e));
11var i,a,r=t.initValue,o=e.length,c=t.table;if(s)for(a=0;o>a;++a)r=c[255&(r^e[a])]^r>>>8;else for(a=0;o>a;++a)128>(i=e.charCodeAt(a))?r=c[255&(r^i)]^r>>>8:2048>i?r=c[255&((r=c[255&(r^(192|i>>6))]^r>>>8)^(128|63&i))]^r>>>8:55296>i||i>=57344?r=c[255&((r=c[255&((r=c[255&(r^(224|i>>12))]^r>>>8)^(128|i>>6&63))]^r>>>8)^(128|63&i))]^r>>>8:r=c[255&((r=c[255&((r=c[255&((r=c[255&(r^(240|(i=65536+((1023&i)<<10|1023&e.charCodeAt(++a)))>>18))]^r>>>8)^(128|i>>12&63))]^r>>>8)^(128|i>>6&63))]^r>>>8)^(128|63&i))]^r>>>8;r^=t.initValue;var d="";return t.bytes>2&&(d+=_[r>>28&15]+_[r>>24&15]+_[r>>20&15]+_[r>>16&15]),d+(_[r>>12&15]+_[r>>8&15]+_[r>>4&15]+_[15&r])},l={};for(t=0;t<c.length;++t){l[(u=c[t]).name]=u.method}if(r)module.exports=l;else{for(t=0;t<c.length;++t){var u;e[(u=c[t]).name]=u.method}o&&define((function(){return l}))}}(),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}((function(e,t){var s="plugin_hideShowPassword",i=["show","innerToggle"],a=function(){var e=document.body,t=document.createElement("input"),s=!0;e||(e=document.createElement("body")),t=e.appendChild(t);try{t.setAttribute("type","text")}catch(e){s=!1}return e.removeChild(t),s}();function r(t,s){this.element=e(t),this.wrapperElement=e(),this.toggleElement=e(),this.init(s)}r.prototype={init:function(t){this.update(t,e.fn.hideShowPassword.defaults)&&(this.element.addClass(this.options.className),this.options.innerToggle&&(this.wrapElement(this.options.wrapper),this.initToggle(this.options.toggle),"string"==typeof this.options.innerToggle&&(this.toggleElement.hide(),this.element.one(this.options.innerToggle,e.proxy((function(){this.toggleElement.show()}),this)))),this.element.trigger(this.options.initEvent,[this]))},update:function(e,t){return this.options=this.prepareOptions(e,t),this.updateElement()&&this.element.trigger(this.options.changeEvent,[this]).trigger(this.state().changeEvent,[this]),this.options.enable},toggle:function(e){return e=e||"toggle",this.update({show:e})},prepareOptions:function(t,s){var i,a=t||{},r=[];if(s=s||this.options,t=e.extend(!0,{},s,t),a.hasOwnProperty("wrapper")&&a.wrapper.hasOwnProperty("inheritStyles")&&(t.wrapper.inheritStyles=a.wrapper.inheritStyles),t.enable&&("toggle"===t.show?t.show=this.isType("hidden",t.states):"infer"===t.show&&(t.show=this.isType("shown",t.states)),"infer"===t.toggle.position&&(t.toggle.position="rtl"===this.element.css("text-direction")?"left":"right"),!e.isArray(t.toggle.attachToKeyCodes))){if(!0===t.toggle.attachToKeyCodes)switch((i=e(t.toggle.element)).prop("tagName").toLowerCase()){case"button":case"input":break;case"a":if(i.filter("[href]").length){r.push(32);break}default:r.push(32,13)}t.toggle.attachToKeyCodes=r}return t},updateElement:function(){return!(!this.options.enable||this.isType())&&(this.element.prop(e.extend({},this.options.props,this.state().props)).addClass(this.state().className).removeClass(this.otherState().className),this.options.triggerOnToggle&&this.element.trigger(this.options.triggerOnToggle,[this]),this.updateToggle(),!0)},isType:function(e,s){return(s=s||this.options.states)[e=e||this.state(t,t,s).props.type]&&(e=s[e].props.type),this.element.prop("type")===e},state:function(e,s,i){return i=i||this.options.states,e===t&&(e=this.options.show),"boolean"==typeof e&&(e=e?"shown":"hidden"),s&&(e="shown"===e?"hidden":"shown"),i[e]},otherState:function(e){return this.state(e,!0)},wrapElement:function(t){var s,i=t.enforceWidth;return this.wrapperElement.length||(s=this.element.outerWidth(),e.each(t.inheritStyles,e.proxy((function(e,s){t.styles[s]=this.element.css(s)}),this)),this.element.css(t.innerElementStyles).wrap(e(t.element).addClass(t.className).css(t.styles)),this.wrapperElement=this.element.parent(),!0===i&&(i=this.wrapperElement.outerWidth()!==s&&s),!1!==i&&this.wrapperElement.css("width",i)),this.wrapperElement},initToggle:function(t){return this.toggleElement.length||(this.toggleElement=e(t.element).attr(t.attr).addClass(t.className).css(t.styles).appendTo(this.wrapperElement),this.updateToggle(),this.positionToggle(t.position,t.verticalAlign,t.offset),t.touchSupport?(this.toggleElement.css(t.touchStyles),this.element.on(t.attachToTouchEvent,e.proxy(this.toggleTouchEvent,this))):this.toggleElement.on(t.attachToEvent,e.proxy(this.toggleEvent,this)),t.attachToKeyCodes.length&&this.toggleElement.on(t.attachToKeyEvent,e.proxy(this.toggleKeyEvent,this))),this.toggleElement},positionToggle:function(e,t,s){var i={};switch(i[e]=s,t){case"top":case"bottom":i[t]=s;break;case"middle":i.top="50%",i.marginTop=this.toggleElement.outerHeight()/-2}return this.toggleElement.css(i)},updateToggle:function(e,t){var s,i;return this.toggleElement.length&&(s="padding-"+this.options.toggle.position,e=e||this.state().toggle,t=t||this.otherState().toggle,this.toggleElement.attr(e.attr).addClass(e.className).removeClass(t.className).html(e.content),i=this.toggleElement.outerWidth()+2*this.options.toggle.offset,this.element.css(s)!==i&&this.element.css(s,i)),this.toggleElement},toggleEvent:function(e){e.preventDefault(),this.toggle()},toggleKeyEvent:function(t){e.each(this.options.toggle.attachToKeyCodes,e.proxy((function(e,s){if(t.which===s)return this.toggleEvent(t),!1}),this))},toggleTouchEvent:function(e){var t,s,i,a=this.toggleElement.offset().left;a&&(t=e.pageX||e.originalEvent.pageX,"left"===this.options.toggle.position?(s=t,i=a+=this.toggleElement.outerWidth()):(s=a,i=t),i>=s&&this.toggleEvent(e))}},e.fn.hideShowPassword=function(){var t={};return e.each(arguments,(function(s,a){var r={};if("object"==typeof a)r=a;else{if(!i[s])return!1;r[i[s]]=a}e.extend(!0,t,r)})),this.each((function(){var i=e(this),a=i.data(s);a?a.update(t):i.data(s,new r(this,t))}))},e.each({show:!0,hide:!1,toggle:"toggle"},(function(t,s){e.fn[t+"Password"]=function(e,t){return this.hideShowPassword(s,e,t)}})),e.fn.hideShowPassword.defaults={show:"infer",innerToggle:!1,enable:a,triggerOnToggle:!1,className:"hideShowPassword-field",initEvent:"hideShowPasswordInit",changeEvent:"passwordVisibilityChange",props:{autocapitalize:"off",autocomplete:"off",autocorrect:"off",spellcheck:"false"},toggle:{element:'<button type="button">',className:"hideShowPassword-toggle",touchSupport:"undefined"!=typeof Modernizr&&Modernizr.touchevents,attachToEvent:"click.hideShowPassword",attachToTouchEvent:"touchstart.hideShowPassword mousedown.hideShowPassword",attachToKeyEvent:"keyup",attachToKeyCodes:!0,styles:{position:"absolute"},touchStyles:{pointerEvents:"none"},position:"infer",verticalAlign:"middle",offset:0,attr:{tabindex:"-1",role:"button","aria-label":"Show password",title:"Show password",tabIndex:0}},wrapper:{element:"<div>",className:"hideShowPassword-wrapper",enforceWidth:!0,styles:{position:"relative"},inheritStyles:["display","verticalAlign","marginTop","marginRight","marginBottom","marginLeft"],innerElementStyles:{marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}},states:{shown:{className:"hideShowPassword-shown",changeEvent:"passwordShown",props:{type:"text"},toggle:{className:"hideShowPassword-toggle-hide",content:"Hide",attr:{tabindex:"-1","aria-pressed":"true",title:"Hide password"}}},hidden:{className:"hideShowPassword-hidden",changeEvent:"passwordHidden",props:{type:"password"},toggle:{className:"hideShowPassword-toggle-show",content:"Show",attr:{tabindex:"-1","aria-pressed":"false",title:"Show password"}}}}}})),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window).base64js=e()}}((function(){return function e(t,s,i){function a(o,n){if(!s[o]){if(!t[o]){var _="function"==typeof require&&require;if(!n&&_)return _(o,!0);if(r)return r(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var d=s[o]={exports:{}};t[o][0].call(d.exports,(function(e){return a(t[o][1][e]||e)}),d,d.exports,e,t,s,i)}return s[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({"/":[function(e,t,s){"use strict";function i(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var s=e.indexOf("=");return-1===s&&(s=t),[s,s===t?0:4-s%4]}function a(e){return o[63&e>>18]+o[63&e>>12]+o[63&e>>6]+o[63&e]}function r(e,t,s){for(var i,r=[],o=t;o<s;o+=3)i=(16711680&e[o]<<16)+(65280&e[o+1]<<8)+(255&e[o+2]),r.push(a(i));return r.join("")}s.byteLength=function(e){var t=i(e),s=t[0],a=t[1];return 3*(s+a)/4-a},s.toByteArray=function(e){var t,s,a=i(e),r=a[0],o=a[1],c=new _(function(e,t,s){return 3*(t+s)/4-s}(0,r,o)),d=0,l=0<o?r-4:r;
11for(s=0;s<l;s+=4)t=n[e.charCodeAt(s)]<<18|n[e.charCodeAt(s+1)]<<12|n[e.charCodeAt(s+2)]<<6|n[e.charCodeAt(s+3)],c[d++]=255&t>>16,c[d++]=255&t>>8,c[d++]=255&t;return 2===o&&(t=n[e.charCodeAt(s)]<<2|n[e.charCodeAt(s+1)]>>4,c[d++]=255&t),1===o&&(t=n[e.charCodeAt(s)]<<10|n[e.charCodeAt(s+1)]<<4|n[e.charCodeAt(s+2)]>>2,c[d++]=255&t>>8,c[d++]=255&t),c},s.fromByteArray=function(e){for(var t,s=e.length,i=s%3,a=[],n=16383,_=0,c=s-i;_<c;_+=n)a.push(r(e,_,_+n>c?c:_+n));return 1===i?(t=e[s-1],a.push(o[t>>2]+o[63&t<<4]+"==")):2===i&&(t=(e[s-2]<<8)+e[s-1],a.push(o[t>>10]+o[63&t>>4]+o[63&t<<2]+"=")),a.join("")};for(var o=[],n=[],_="undefined"==typeof Uint8Array?Array:Uint8Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,l=c.length;d<l;++d)o[d]=c[d],n[c.charCodeAt(d)]=d;n[45]=62,n[95]=63},{}]},{},[])("/")}));var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t,s,i,a,r,o,n,_="",c=0;for(e=Base64._utf8_encode(e);c<e.length;)a=(t=e.charCodeAt(c++))>>2,r=(3&t)<<4|(s=e.charCodeAt(c++))>>4,o=(15&s)<<2|(i=e.charCodeAt(c++))>>6,n=63&i,isNaN(s)?o=n=64:isNaN(i)&&(n=64),_=_+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(o)+this._keyStr.charAt(n);return _},decode:function(e){var t,s,i,a,r,o,n="",_=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");_<e.length;)t=this._keyStr.indexOf(e.charAt(_++))<<2|(a=this._keyStr.indexOf(e.charAt(_++)))>>4,s=(15&a)<<4|(r=this._keyStr.indexOf(e.charAt(_++)))>>2,i=(3&r)<<6|(o=this._keyStr.indexOf(e.charAt(_++))),n+=String.fromCharCode(t),64!=r&&(n+=String.fromCharCode(s)),64!=o&&(n+=String.fromCharCode(i));return n=Base64._utf8_decode(n)},_utf8_encode:function(e){var t="";e=e.replace(/\r\n/g,"\n");for(var s=0;s<e.length;s++){var i=e.charCodeAt(s);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},_utf8_decode:function(e){var t,s,i,a="",r=0;for(t=s=0;r<e.length;)(t=e.charCodeAt(r))<128?(a+=String.fromCharCode(t),r++):t>191&&t<224?(s=e.charCodeAt(r+1),a+=String.fromCharCode((31&t)<<6|63&s),r+=2):(s=e.charCodeAt(r+1),i=e.charCodeAt(r+2),a+=String.fromCharCode((15&t)<<12|(63&s)<<6|63&i),r+=3);return a}}; 12; 13window.console||(window.console={log:function(){}}),qwiz_={};var qwizf=function(){var qname="qwiz_",debug=[];debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1);var $=jQuery;this.no_intro_b=[],this.processing_complete_b=!1,this.qrecord_b=!1,this.dataset_b=!1,this.preview=!1,this.any_pay_quiz_f=!1,this.hotspot_alpha_value=121,this.hotspot_alpha_value_tmp=122,this.hotspot_border_alpha_value=254;var q=this,qqc,regular_page_f=!0,content,default_use_dict,default_use_terms,hint_timeout_sec,default_hangman_max_hints,correct,incorrect,errmsgs=[],n_qwizzes=0,qwizzled_b,qwizcards_page_f=!1,qwizdata=[],header_html,drag_and_drop_initialized_b=!1,try_again_obj="",$label_clicked=[],$prev_label_clicked=[],ignore_label_click_b=!1,next_button_active_b=!1,textentry_b=!1,loaded_metaphone_js_b=!1,default_textentry_terms_metaphones,current_question_textentry_terms_metaphones={},textentry_answers={},textentry_answer_metaphones={},textentry_matches={},lc_textentry_matches={},textentry_i_qwiz,suppress_hangman_hint_b=!1,Tcheck_answer_message,show_hint_timeout={},panel_exit_mobile_open_b=!1,panel_exit_mobile_just_closed_b,non_mobile_scrollLeft,non_mobile_scrollTop,qw,set_qwizard_data_b=!1,preview_min_height,preview_mode="questions_active";this.wordpress_page_f=!1;var reinit_highlighting_f=!1,restart_timers_i_qwiz=-1;function process_html(){$('p:contains("[!]"), :header:contains("[!]")').each((function(){0==$(this).html().search(/\s*(<.+?>)*\s*\[!+\][^]*?\[\/!+\]\s*(<.+?>)*\s*$/m)&&$(this).remove()})),$('p:contains("qwiz"), :header:contains("qwiz")').each((function(){var e=$
13(this).html();0==e.search(/\s*\[\/{0,1}qwiz[^\]]*\]\s*/m)&&$(this).replaceWith(e)})),$("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this)})),q.qwizard_b||(q.wordpress_page_f=1==qqc.get_qwiz_param("wppf",""));var e="",t=$("div.qwiz_wrapper"),i=$("div.qwiz_wrapper_fallback");if(t.length)e="div.qwiz_wrapper",i.css({display:"none"});else{if(0==i.length){$("head").append('<style type="text/css">\n.qwiz_wrapper_fallback_visible {\nvisibility: visible;\n}\n</style>\n')}-1==(e=content).indexOf("wp-block-post-excerpt")&&(e+=", div.wp-block-post-excerpt")}n_qwizzes=0;var a=0;$(e).each((function(){const e=$(this);var i=e.html();if(i){if(-1!=i.indexOf("[qwiz")){var s=q.process_html2(i,a);if(i=s.htm,q.qwizdemos)for(var _=q.qwizdemos.length,o=0;o<_;o++){var n=q.qwizdemos[o],r=n.length;n=n.substring(10,r-11),i=i.replace("<qwizdemo></qwizdemo>",n)}if(s.replace_body){debug[0]&&console.log("[process_html] document_qwiz_user_logged_in_b:",document_qwiz_user_logged_in_b);var d='<div class="preview_header"><h2 style="margin-bottom: 10px;">Preview quiz</h2><a href="javascript: void (0)" style="float: right; margin-right: 50px;" onclick="'+qname+".reset_preview ("+a+')">Reload preview</a><label><input type="radio" name="preview_radio" value="questions_active" onclick="'+qname+".change_preview_mode (this, "+a+')" checked /> Questions active</label> <label><input type="radio" name="preview_radio" value="show_answers" onclick="'+qname+".change_preview_mode (this, "+a+')" /> Show answers</label> <label><input type="radio" name="preview_radio" value="show_answers_and_feedback" onclick="'+qname+".change_preview_mode (this, "+a+')" /> Show answers and feedback</label> </div>';$("body").html(d+i),$("div#qwiz"+a).css({margin:"auto"})}else e.html(i);if(a!=s.i_qwiz){a=s.i_qwiz,e.find("div.qwiz").on("mouseenter",(function(e){if("div"==e.target.tagName.toLowerCase()&&"qwiz"==e.target.className)document_active_qwiz_qdeck=e.target;else{var t=$(e.target).parents("div.qwiz");t.length&&(document_active_qwiz_qdeck=t[0])}debug[7]&&(console.log("[qwiz mouseenter] e.target:",e.target),console.log("[qwiz mouseenter] document_active_qwiz_qdeck:",document_active_qwiz_qdeck))}));var c=a-1;if(qwizdata[c])for(var l=qwizdata[c].n_questions,w=0;w<l;w++)if(qwizdata[c].bg_img[w]){var h=qwizdata[c].bg_img[w],u=new Image;u.src=h.src,u.i_qwiz=c,u.i_question=w,u.onload=function(){var e,t=this.width,i=this.height,a=$("#qwiz"+u.i_qwiz+"-q"+u.i_question);debug[0]&&console.log("[process_html] w:",t,", h:",i,", $qwizq:",a),e=h.height?h.height:h.width?Math.floor(h.width/t*i):i,e+="px",h.top&&(e="calc("+h.top+"px + "+e+")"),a.css({"min-height":e})}}}}t.length&&e.contents().unwrap()}else;})),n_qwizzes=a,q.n_qwizzes=a,document_qwiz_qwiz_html_completed_f=!0,$("div.qwiz_wrapper").removeClass("qwiz_shortcodes_hidden"),$("div.hangman_label").each((function(){var e=$
13(this),t=e.outerWidth();e.outerWidth(1.2*t)}));for(a=0;a<n_qwizzes;a++)if(qwizdata[a].qrecord_id){var s={qwiz_qdeck:"qwiz",n_questions_cards:qwizdata[a].n_questions};qqc.jjax(qname,a,qwizdata[a].qrecord_id,"check_registered",s)}if(n_qwizzes&&qqc.init_enter_intercept(),q.qrecord_b&&qqc.set_user_menus_and_icons(!1,!1,"doing_quizzes"),textentry_b)if("body"==content&&"undefined"!=typeof qcard_){var _=0,o=function(){var e=!1;debug[6]&&console.log("[run_init_textentry_autocomplete]",_),(qcard_.processing_complete_b||_>30)&&(debug[6]&&console.log("[run_init_textentry_autocomplete] OK"),q.init_textentry_autocomplete($("body")),e=!0),e||(setTimeout(o,100),_++)};o()}else q.init_textentry_autocomplete($("body"));for(a=0;a<n_qwizzes;a++)set_initial_width(a);document_qwiz_qwiz_html_completed_f=!0,q.processing_complete_b=!0}function set_initial_width(e){const t=$("#xqwiz"+e);if(t.length){t.css({height:"","min-height":""});const i=t.outerWidth();debug[0]&&console.log("[set_initial_width] i_qwiz:",e,", initial_width:",i),i&&(qwizdata[e].initial_width=i)}}function dialog_no_credit_html(){htm=[],htm.push('<div id="qwiz_dialog_no_credit" title="'+T("Quiz not assigned in your class")+'">'),htm.push('<div class="has_not_been_assigned">'),htm.push('<p style="margin-bottom: 1em;">'),htm.push(T("Note: this quiz has not been assigned as work you need to do.")),htm.push(T("Your work will be recorded, but it may not count for your class.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("You can send a request message to your teacher asking them to include this quiz in your class.")),htm.push("<br />"),htm.push("<br />"),htm.push('<button id="qwiz_request_assign_to_class" class="qwiz_button" onclick="qwiz_qcards_common.request_assign_to_class (1)">'),htm.push(T("Send request")),htm.push("</button>"),htm.push("</p>"),htm.push("<br />"),htm.push('<div id="qwiz_request_assign_to_class_feedback">'),htm.push("</div>"),htm.push("</div>"),htm.push('<div class="not_in_a_class" style="display: none;">'),htm.push("<p>"),htm.push(T("You are not enrolled in any current class.")),htm.push(T("Your work will be recorded, but your teacher will not see it.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("To add yourself to a class:")),htm.push("</p>"),htm.push("<p>");const e=qqc.get_qwiz_param("server_name")+"/register";return htm.push(T("Go to")+' <a style="text-decoration: underline; color: blue;" href="https://'+e+'">'+e+"</a>"),htm.push("</p>"),htm.push("<p>"),htm.push(T("Enter the registration code given to you by your teacher and enter your login name and password.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("Or you can ask your teacher to add you to their class.")),htm.push("</p>"),htm.push("</div>"),htm.push("<p>"),htm.push("<label>"),htm.push('<input type="checkbox" onclick="qwiz_qcards_common.do_not_show_assign_to_class (this)" />'),htm.push(T("Don’t show me this again for quizzes and flashcard decks on this page")),htm.push("</label>"),htm.push("</p>"),htm.push("</div>"),htm.join("\n")}function init_preview_show_answers(e){$("div#qwiz"+e+' input[type="radio"][data-q="1"]').each((function(){var e=this.id.substr(6);q.process_choice(void 0,e)})),$("div#qwiz"+e+" button.show_the_answer").each((function(){$(this).trigger("click")})),$(`div#qwiz${e} div.show_answer_got_it_or_not`).hide(),$("div#qwiz"+e).find("input.qwiz_textentry, input.qwiz_single_char_entry").each((function(){var t=this.id.split("-")[2].substr(1),i=qwizdata[e].textentry[t].first_correct_answer;$(this).val(i),$(this).parents("div.qwizq").find("button.textentry_check_answer, button.qwiz_textentry_hint").hide(),"show_answers_and_feedback"==preview_mode&&$(this).parents("div.qwizq").find("div.qwiz-feedback").first().show()})),$("div#qwiz"+e).find("span.qwiz_hangman").each((function(){var t=$(this);preview_replace_hangman_entries(t,e,"final"),t.find("span.hangman_type_letters").hide(),"show_answers_and_feedback"==preview_mode&&t.parents("div.qwizq").find(".qwiz-feedback").show()})),$("div#qwiz"+e).find("div.qwizzled_label").each((function(){var e,t=$(this),i=t.attr("class").match(/qtarget_assoc(\d+)/);i?(e=i[1],place_label($(".qwizzled_target-"+e),t)):(e=t.data("label_target_id"))&&place_label($(".qwizzled_target-"+e),t)})),$(".qwiz_hotspot_label").show(),"show_answers_and_feedback"==preview_mode?$(".hotspot_label_feedback_correct").show():$(".hotspot_label_feedback_correct").hide()}function init_preview_questions_active(e){for(var t in $("div#qwiz"+e+' input[type="radio"]').attr("disabled",!1).prop("checked",!1),$("div#qwiz"+e).find("input.qwiz_textentry, input.qwiz_single_char_entry").attr("disabled",!1).val(""),$("div#qwiz"+e).find("button.textentry_check_answer, button.qwiz_textentry_hint").css({display:""}),$("div#qwiz"+e).find("span.qwiz_hangman").each((function(){preview_replace_hangman_entries($(this),e,"initial")})),qwizdata[e].$qwizzled)$("div#"+t).replaceWith(qwizdata[e].$qwizzled[t]),$("div#"+t).addClass("qwizq_preview").show(),qwizdata[e].$qwizzled[t]=$("div#"+t).clone(!0);$(".qwiz_hotspot_label, .hotspot_label_feedback_correct").hide()}function preview_replace_hangman_entries(e,t,i){var a=e.parents("div.qwizq")[0].id.split("-")[1].substr(1),s=e.attr("class").match(/qwiz_hangman_c(\d+)/)[1],_=qwizdata[t].hangman[a].hangman_final_entry[s];if("initial"==i){var o=_.replace(/>[a-z0-9]</gi,"> <");e.find("span.hangman_current_entry").html(o)}else e.find("span.hangman_current_entry").html(_)}function place_labels(e,t,i){for(var a in debug[0]&&console.log("[place_labels] i_qwiz:",e,", i_question:",t,", qwizq_id:, ",i),qwizdata[e].correct_on_try1[t])if(1==qwizdata[e].correct_on_try1[t][a]){var s=$("div#"+i+" div#"+a);0==s.length&&(s=$("div#"+i+" span#"+a).first());var _,o=s.attr("class").match(/qwizzled_target-([0-9]+)/);o&&(_=o[1]),debug[8]&&console.log("[place_labels] $target:",s,", assoc_id:",_);var n=$("td.qwizzled_labels div.qtarget_assoc"+_);n.length||(n=$("div#"+i).find('td.qwizzled_labels div.qwizzled_label[data-label_target_id="'+_+'"]')),place_label(s,n),qwizdata[e].n_labels_correct++,qwizdata[e].n_label_attempts++}else qwizdata[e].correct_on_try1[t][a]=0;q.display_diagram_progress(e)}function place_label(e,t){var i=t.clone(!1);q.qwizard_b&&($editable=i.find(".qwiz_editable"),$editable.removeAttr("id").removeAttr("contenteditable").removeClass("qwiz_editable").addClass("qwizzled_label_placed"),debug[12]&&console.log("[place_label] $editable:",$editable)),i.css({position:"absolute",left:"4px",top:"50%",height:"auto",width:"100%",transform:"translateY(-50%)"}),i.removeClass("qwizzled_label_unplaced"),i.find(".qwizzled_highlight_label").css("cursor","default").removeClass("label_click_highlight"),i.appendTo(e),t.css({left:"0px",top:"0px"});var a=!1;if(n=t.attr("class").match(/qwizzled_n_targets([0-9]*)/)){a=!0;var s=n[0],_=parseInt(n[1],10);if(2==_)t.removeClass(s);else{var o="qwizzled_n_targets"+--_;t.removeClass(s).addClass(o)}}if(!q.qwizard_b&&!a){if(debug[8]&&console.log("[place_label] (draggable disable) $label[0]:",t[0]),t.css({color:"lightgray",left:"0px",top:"0px"}),t.find("*").css({color:"lightgray"}),t.find(".qwizzled_highlight_label").css("cursor","default"),t.removeClass("qwizzled_label_unplaced"),!q.qwizard_b)try{t.draggable("disable")}catch(e){}t.off("click")}if(!q.qwizard_b)if("div"==e[0].tagName.toLowerCase())e.droppable("instance")&&e.droppable("disable");else{var n=e.attr("class").match(/qtarget_sib-[0-9]+/);if(n){var r=e.parents("qwizq").find("span."+n[0]);r.droppable("instance")&&r.droppable("disable")}else{e.siblings("span").andSelf().droppable("disable")}}}function create_qwiz_divs(e,t,i,a){var s=t.match(/\[qwiz([^\]]*)\]/m),_=s[1];debug[0]&&console.log("[create_qwiz_divs] attributes: ",_);var o=[];if(-1!=(_=qqc.replace_smart_quotes(_)).search(/[\s;"]width/m)){var n=_.replace(/;\s*;/g,";");o.push('<div id="xqwiz'+e+'" class="xqwiz" '+n+"></div>\n")}if((s=_.match(/min-height:\s*([^;\s]+)/))&&(preview_min_height=s[1]),qwizdata[e].align){var r=qwizdata[e].align,d="";if("center"==r)d="margin: auto;";else if("right"==r)d="margin-left: auto;";else if("tiled"==r&&(d="float: left;",qwizdata[e].spacing)){var c=qwizdata[e].spacing+"px !important";d+=" margin-left: "+c+"; margin-bottom: "+c+";"}(s=_.match(/style\s*=\s*"[^"]*/m))?_=(_=_.replace(/(style\s*=\s*"[^"]*)/m,"$1; "+d)).replace(/;\s*;/g,";"):_+=' style="'+d+'"',_=_.replace(/align\s*=\s*"[^"]*"/,""),debug[0]&&console.log("[create_qwiz_divs] attributes: ",_)}o.push('<div id="qwiz'+e+'" class="qwiz visibilityhidden" '+_+">");var l="";qwizdata[e].question_time_limit&&(l=qqc.hhmmss_from_sec(qwizdata[e].question_time_limit)),o.push('<div id="qwiz'+e+'-question_timer" class="question-timer">'+l+"</div>"),o.push('<div id="overlay-times-up-qwiz'+e+'" class="overlay-times-up">'),o.push('<div class="overlay-times-up-msg">'),o.push("Sorry, time’s up"),o.push("</div>"),o.push("</div>"),o.push('<div id="overlay-exit-mobile-qwiz'+e+'" class="overlay-exit-mobile-qwiz" onclick="'+qname+'.close_panel_exit_mobile(this)">'),o.push('<div id="panel-exit-mobile-qwiz'+e+'" class="panel-exit-mobile-qwiz">'),o.push('<button onclick="'+qname+".exit_mobile ("+e+')">'),o.push(T("Back to page view")),o.push("</button>"),o.push("<br />"),o.push("<span>"),o.push("("),o.push(T("To return to this full-screen view, tap")),o.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAk0lEQVR4nI3QMQ6EIBAF0BG2YLiGtjRcgt7EcBfDhShtbLwBHIgCJrPFbrGJqPvrl/k/MzAzPOUFAMYYRCSiaZpijGckAAARSynM3BVf1FpTSkkpQwiXaBzHnLNzbtu2Lhr+GS4exSUyxqzrCgDLssDnBefM87zv+3EcRHS3yVpba0XElFK/znsvhNBal1Lu
13Lv3mDbu1OYLB67+mAAAAAElFTkSuQmCC" />'),o.push(")"),o.push("</span>"),o.push('<div class="panel-icon-exit-mobile-qwiz"></div>'),o.push("</div>"),o.push("</div>"),o.push('<div id="icon-exit-mobile-qwiz'+e+'" class="icon-exit-mobile-qwiz" onclick="'+qname+".open_panel_exit_mobile ("+e+')"></div>'),o.push(`<div class="qwiz-progress_meter-qwiz${e} qwiz-progress_meter">`),o.push("</div>");d="";""!=header_html&&"NA"!=header_html&&-1==header_html.indexOf("Enter header text")||(d=' style="display: none;"'),o.push('<div class="header-qwiz'+e+' qwiz-header qwiz_editable"'+d+">"),o.push(header_html),o.push("</div>"),o=o.join("\n");const w=qqc.get_qwiz_param("url","./");var h=[];h.push('<div class="qwiz-progress-container qwiz'+e+'">');var u=T("Full-screen view");h.push('<div class="go-mobile-qwiz go-mobile-qwiz'+e+'" onclick="'+qname+".go_mobile ("+e+')" title="'+u+'">'),h.push("</div>"),h.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAKwmlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU9kWhs+96Y2WEAEpofcuXUroAZReRSUkgYQSY0JQsSviCCqKiAiWoQxVwUEpMhbEgm1QbNgnyKCiPgcLNlTeBYYw89567633r3XW/e6+++y9z1nnrLUvABQ8WyTKgJUAyBRmiSMCvBlx8QkM3O8AAligChSAHpsjETHDwkIAounn3/XhDuKN6KblRKx///5fpczlSTgAQGEIJ3MlnEyEjyHjNUckzgIAVY3Y9ZdliSb4IsI0MVIgwg8nOHWKRyY4eZLR6EmfqAgfhNUAwJPZbHEqAGQDxM7I5qQicci+CNsIuQIhwsg78ODw2VyEkbzAIjNzyQTLEDZJ/kuc1L/FTJbHZLNT5Ty1lknhfQUSUQZ7xf+5Hf9bmRnS6RxGyCDzxYERyJOO7Nnd9CXBchYmzw+dZgF30n+S+dLA6GnmSHwSppnL9g2Wz82YHzLNKQJ/ljxOFitqmnkSv8hpFi+JkOdKEfswp5ktnskrTY+W2/k8ljx+Dj8qdpqzBTHzp1mSHhk84+Mjt4ulEfL6ecIA75m8/vK1Z0r+sl4BSz43ix8VKF87e6Z+npA5E1MSJ6+Ny/P1m/GJlvuLsrzluUQZYXJ/XkaA3C7JjpTPzUIO5MzcMPkeprGDwqYZhIAAwADRIANkATFgIxwIkJOaxVs+cUaBzxLRCrEglZ/FYCK3jMdgCTlWFgw7GzsbACbu7NSReHd38i5CdPyMTYJ4uG5DjKIZ20IaAMf4AChwZmxGRch1JAFwNoEjFWdP2SauE8AAIlAENKAOtIE+MAGWwA44AjfgBfxAEAgFUSAeLAIcwAeZSOXLwCqwHuSBArAD7AZl4CCoAnXgMGgB7eAEOAMugCvgOrgNHgAZGAIvwQj4AMYgCMJBFIgKqUM6kCFkDtlBzpAH5AeFQBFQPJQEpUJCSAqtgjZCBVARVAZVQPXQz9Bx6Ax0CeqD7kED0DD0FvoCo2AyTIO1YCPYGnaGmXAwHAUvhFPhpXAOnAtvh0vhSvgQ3Aafga/At2EZ/BIeRQEUCUVH6aIsUc4oH1QoKgGVghKj1qDyUSWoSlQTqhPVg7qJkqFeoT6jsWgqmoG2RLuhA9HRaA56KXoNeiu6DF2HbkOfQ99ED6BH0N8xFIwmxhzjimFh4jCpmGWYPEwJpgbTijmPuY0ZwnzAYrF0rDHWCRuIjcemYVdit2L3Y5uxXdg+7CB2FIfDqePMce64UBwbl4XLw+3FHcKdxt3ADeE+4Ul4Hbwd3h+fgBfiN+BL8A34U/gb+Gf4MYISwZDgSgglcAkrCIWEakIn4RphiDBGVCYaE92JUcQ04npiKbGJeJ74kPiORCLpkVxI4SQBaR2plHSEdJE0QPpMViGbkX3IiWQpeTu5ltxFvkd+R6FQjChelARKFmU7pZ5ylvKY8kmBqmClwFLgKqxVKFdoU7ih8FqRoGioyFRcpJijWKJ4VPGa4islgpKRko8SW2mNUrnScaV+pVFlqrKtcqhypvJW5QblS8rPVXAqRip+KlyVXJUqlbMqg1QUVZ/qQ+VQN1KrqeepQzQszZjGoqXRCmiHab20EVUV1TmqMarLVctVT6rK6Ci6EZ1Fz6AX0lvod+hfZmnNYs7izdoyq2nWjVkf1Wareanx1PLVmtVuq31RZ6j7qaer71RvV3+kgdYw0wjXWKZxQOO8xqvZtNluszmz82e3zL6vCWuaaUZortSs0ryqOaqlrRWgJdLaq3VW65U2XdtLO027WPuU9rAOVcdDR6BTrHNa5wVDlcFkZDBKGecYI7qauoG6Ut0K3V7dMT1jvWi9DXrNeo/0ifrO+in6xfrd+iMGOgbzDFYZNBrcNyQYOhvyDfcY9hh+NDI2ijXabNRu9NxYzZhlnGPcaPzQhGLiabLUpNLklinW1Nk03XS/6XUz2MzBjG9WbnbNHDZ3NBeY7zfvs8BYuFgILSot+i3JlkzLbMtGywErulWI1QardqvX1gbWCdY7rXusv9s42GTYVNs8sFWxDbLdYNtp+9bOzI5jV253y55i72+/1r7D/s0c8zm8OQfm3HWgOsxz2OzQ7fDN0clR7NjkOOxk4JTktM+p35nmHOa81fmiC8bF22WtywmXz66OrlmuLa5/uFm6pbs1uD2fazyXN7d67qC7njvbvcJd5sHwSPL40UPmqevJ9qz0fOKl78X1qvF6xjRlpjEPMV9723iLvVu9P/q4+qz26fJF+Qb45vv2+qn4RfuV+T321/NP9W/0HwlwCFgZ0BWICQwO3BnYz9JicVj1rJEgp6DVQeeCycGRwWXBT0LMQsQhnfPgeUHzds17ON9wvnB+eygIZYXuCn0UZhy2NOyXcGx4WHh5+NMI24hVET2R1MjFkQ2RH6K8owqjHkSbREuju2MUYxJj6mM+xvrGFsXK4qzjVsddideIF8R3JOASYhJqEkYX+C3YvWAo0SExL/HOQuOFyxdeWqSxKGPRycWKi9mLjyZhkmKTGpK+skPZlezRZFbyvuQRjg9nD+cl14tbzB3mufOKeM9S3FOKUp6nuqfuSh3me/JL+K8EPoIywZu0wLSDaR/TQ9Nr08czYjOaM/GZSZnHhSrCdOG5JdpLli/pE5mL8kSypa5Ldy8dEQeLaySQZKGkI4uGNEdXpSbSTdKBbI/s8uxPy2KWHV2uvFy4/OoKsxVbVjzL8c/5aSV6JWdl9yrdVetXDaxmrq5YA61JXtO9Vn9t7tqhdQHr6tYT16ev/3WDzYaiDe83xm7szNXKXZc7uClgU2OeQp44r3+z2+aDP6B/EPzQu8V+y94t3/O5+ZcLbApKCr5u5Wy9vM12W+m28e0p23sLHQsP7MDuEO64s9NzZ12RclFO0eCuebvaihnF+cXvdy/efalkTsnBPcQ90j2y0pDSjr0Ge3fs/VrGL7td7l3evE9z35Z9H/dz99844HWg6aDWwYKDX34U/Hi3IqCirdKosqQKW5Vd9bQ6prrnJ+ef6ms0agpqvtUKa2V1EXXn6p3q6xs0Gwob4UZp4/ChxEPXD/se7miybKpopjcXHAFHpEde/Jz0852W4Jbuo85Hm44ZHtvXSm3Nb4PaVrSNtPPbZR3xHX3Hg453d7p1tv5i9UvtCd0T5SdVTxaeIp7KPTV+Ouf0aJeo69WZ1DOD3Yu7H5yNO3vrXPi53vPB5y9e8L9wtofZc/qi+8UTl1wvHb/sfLn9iuOVtqsOV1t/dfi1tdext+2a07WO6y7XO/vm9p264XnjzE3fmxdusW5duT3/dt+d6Dt3+xP7ZXe5d5/fy7j35n72/bEH6x5iHuY/UnpU8ljzceVvpr81yxxlJwd8B64+iXzyYJAz+PJ3ye9fh3KfUp6WPNN5Vv/c7vmJYf/h6y8WvBh6KXo59irvH8r/2Pfa5PWxP7z+uDoSNzL0Rvxm/O3Wd+rvat/Ped89Gjb6+EPmh7GP+Z/UP9V9dv7c8yX2y7OxZV9xX0u/mX7r/B78/eF45vi4iC1mT7YCKGTAKSkAvK0FgBIPAPU6AMQFUz31pKCp/4BJAv+Jp/ruSTkCgIQC0V0ATLRoVX+2tIrIe5gXAFFeALa3l48/JUmxt5uKRWpHWpOS8fF3SP+IMwXgW//4+Fj7+Pi3GqTY+wB0fZjq5SekjfxXLMADqHzTrZYB8K/6J1bAD27htQDfAAAACXBIWXMAABYlAAAWJQFJUiTwAAACBGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NDY4PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjQ2NjwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8
13L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrdRrnkAAADWklEQVRIDZ1VW08TQRT+uvRqCBoI5ckCD3JRjEALCfFNMJHfIH9B0V+BkIj6omgiEilPBiFyT+TRAAX1wQj0JpBIFYQaa6Db7WWcc8rWBKl2nWR2Z3bOfOf2nbMmfzAk1tfWYLfbkclkABN4KIqCpJZEs7sZ5eVOpFIpmExHh1mRwp53+/uFlMw7P3xcFRkhxGEiIVQtaXiaHQ4HW+LxtCAS2UZxcTHS6TS2IxG8np/HhfP1SEhPFJNSmMXHpJRMhowHYrEfUkEEaiKBcDgMr3cEl9vaEFcTx64Y2yp6zK1WG5wVFUglk4wwNPQMgVAYp+y2bG6M4eakFY6+3MbVOHZ3dqCqKmpqazE5MQGPTHAw/ImVUNj+ZyhWq5XvlZWVoae3F9FoFAG/Hw0NF/EzFkODzIHuicy1cR29fX3MIN/yirwvxIvRUd47nRVCesJrm80mAqGQSMvzQ9UYm/D23Xux6FtmcKIhUXJ0bIyBJf/FpcZGXkvTxe7evkhLgYO4WjBdQVYRaDyh5awjbS/Hxhn4rMvF74ePBvg8kUyxbKE1gd/AGltFIaBvNMZfTTD4wOMnIiWt0FLpHDjJHar/9sRElhzPHLWMoqIiULsIh0JwVVbCYrEgKSlM36ltyLzI4oOsG43ljmPo+xMV0KF0gGXsVgtkWHhPCgncIWvj294+Dg8OUFXpoijkVZK3/qmx0ZShYHBaUy1Q4UWj39F98waqqyqxHgjCYbPyWbalZY2jKLCRhSaLYk55iHzdEde7ujg35CjN1XU/pYzZRXKESSMpKYdCFRA1aSwsLjHouZoa0djUlFOkKyEiEOb07Kz4HPlSuAK6ROwiWk9OzzBwSUmJqD0qRt0TovzTwUE+f7OwaFyB7v7k1DSDyPYu6urreX2lvV303OnlNSn0rawYU6B7odfJ1JEnBFZXV5cDdrvdvF5c8om8LJKXThzEJhkFyh06O69hZm6O5YLBIFwuF6qqq+W/JZa9K+vEsAK6SfVANKR/VUfHVXTfus001TQNmxsboLeuwXy0MvQiD8xmM4N6h5/jwf17aGltRTwex+kzZ1BaWoqtra0sJsXV6KQcEFuGvSO5uEu0P9bEoryt4m8ukQfUkwKBALY2N7kv8R9Pxlwf0gK4PR78Ak4cQYObEn/YAAAAAElFTkSuQmCC" class="go-mobile-qwiz go-mobile-qwiz'+e+'" />'),u=T("Exit full-screen view"),h.push('<div class="exit-mobile-qwiz exit-mobile-qwiz'+e+'" onclick="'+qname+".exit_mobile ("+e+')" title="'+u+'">'),h.push("</div>"),h.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAoVJREFUSA2lVj2PEkEY3plZV5I9Q3KBqzFHQkFJaCx0sTCxo6EnsfMPWPjBctqoueqMNf/CwtODxo7ySCxMaAjhgiRGiXjsh8+zzl5WKoZ7k+GdnZ33ed6PeWdRtVrtxnQ6jWxbvrUs8SCO449cq1Qqst1uWxBVr9fFaDSKW62WouaikTiO0xVCxBy2bXdpXC6Xb5ZKpZzv+xKkIp/PH3JuBMzN9FyD/4Fea5IjvmMk1FLKExAfc24sMH6tCQgeYgSa5BXB4MAz/ewbg6cG8M4niAZPotDPZ1ozdZ10v5GuVqsODTIkJGIkkQZn6q5qYwSOzbJYLEYsaBAEvlLqpQYQWq+h07leMlPS87wI4IIFhX4B8zMNGkAnRTaD/H+37Pf7PO+Xw+FwzYLidQPjUm9jBCSiRP+U4S+bJ44twaOoc570w+YcNUIjmkuSXzbRcrl8DPOfGOzUbEPR8z0QfFitVp8xNxNGsG2Hpo1nxmC4e1sSOo0DZO90BHO53H2cuIfw7RfGZjqJeWt/331/cfHjG+bmwoJvHoLss1LyHS9Ipl+ZwyeX3x0AeLD9re15EEIM9KrqhGH4BIQSV7vMhqf3bqVSOxu702bkldNH6o5Yp16v57CJd42ggQjuAZCec5CIchvpsyeTyWmhUFCLxcK6LgHTklyW0OwfAeK74JDz+fzUdd2UGK8MBACdTFGvrnSs8apPvyddQl4nAg8FfR5F0SOmhZ4DL4kCOsRzA9fPHkmMBXjHOIonNEwbD2tdHRWjSL4hIHhjDM4OPTjIH8JDwTn/GPB7QiCQpF9GfqB8ru2SInV+/vX7YDCwx+OxaDabAU8LCzqbzT7BaxcRfEEvPGV0fwEIA/zW345reQAAAABJRU5ErkJggg==" class="exit-mobile-qwiz exit-mobile-qwiz'+e+'" />');var z=qwizdata[e].n_questions;!(z>1||qwizdata[e].use_dataset||qwizdata[e].use_dataset_questions_htm||qwizdata[e].combo)||q.preview&&!q.preview_i_qwiz_plus1||(d="",qwizdata[e].hide_forward_back_b&&(d=' style="visibility: hidden;"'),u=qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f?T("Go to “Choose questions”"):T("Go to first question"),h.push('<span class="bbfe-wrapper bbfe-wrapper'+e+'">'),h.push('<span class="bbfe bbfe-qwiz'+e+" bck-question-qwiz"+e+'"'+d+' onclick="'+qname+".bck_question ("+e+', true )" title="'+u+'">'),h.push('<img class="icon-beg-end-qwiz" src="'+w+'/images/icon_beg.svg">'),h.push("</span>"),h.push('<span class="bbfe bbfe-qwiz'+e+" bck-question-qwiz"+e+'"'+d+' onclick="'+qname+".bck_question ("+e+', false)" title="'+T("Go to previous question")+'">'),h.push('<img class="icon-bck-fwd-qwiz" src="'+w+'/images/icon_bck.svg">'),h.push("</span>"),h.push('<span class="question-number-qwiz question-number-qwiz'+e+'"'+d+">"),h.push("</span>"),h.push('<span class="bbfe bbfe-qwiz'+e+" fwd-question-qwiz"+e+'"'+d+' onclick="'+qname+".fwd_question ("+e+', false)" title="'+T("Go to next question")+'">'),h.push('<img class="icon-bck-fwd-qwiz" src="'+w+'/images/icon_fwd.svg">'),h.push("</span>"),h.push('<span class="bbfe bbfe-qwiz'+e+" fwd-question-qwiz"+e+'"'+d+' onclick="'+qname+".fwd_question ("+e+', true )" title="'+T("Go to most-recent question")+'">'),h.push('<img class="icon-beg-end-qwiz" src="'+w+'/images/icon_end.svg">'),h.push("</span>"),h.push("</span>"));d="";l="";if(qwizdata[e].qwiz_timer&&!q.preview&&(d=' style="display: inline-block;"',l="0:00"),h.push('<span id="qwiz'+e+'-qwiz_timer" class="qwiz-timer"'+d+">"+l+"</span>"),qwizdata[e].qrecord_id){h.push('<span class="response_recorded_wrapper response_recorded_wrapper-qwiz'+e+'">'),h.push('<span class="response_recorded response_recorded-qwiz'+e+'">'),h.push(`<img src="${w}/images/recording.svg" class="response_recording" >`),h.push("</span>"),h.push("</span>"),h.push('<div class="qwiz_icon_and_menu_container lock_unlock qwiz'+e+'">'),h.push('<div id="locked-qwiz'+e+'" class="qwiz-locked qwiz_menu_icon">'),h.push(`<img src="${w}/images/icon_locked.png" />`),h.push("</div>"),h.push('<div id="unlocked-qwiz'+e+'" class="qwiz-unlocked qwiz_menu_icon">'),h.push(`<img src="${w}/images/icon_unlocked.png" />`),h.push("</div>"),h.push('<div class="qwiz_icon_trigger_and_menu qwiz-hover">'),h.push('<div class="qwiz_icon_trigger">'),h.push("</div>"),h.push('<div id="pay_unlock_menu-qwiz'+e+'" class="qwiz-pay_unlock_menu qwiz_menu">'),h.push("</div>"),h.push("</div>"),h.push("</div>");var m="";(q.no_intro_b[e]||1==z)&&(m=" qwiz-usermenu_icon_no_intro"),h.push('<div class="qwiz_icon_and_menu_container qwiz'+e+'">'),h.push('<div class="qwiz-usermenu_icon qwiz_menu_icon'+m+'">'),h.push("▼"),h.push("</div>"),h.push('<div class="qwiz_icon_trigger_and_menu qwiz-hover">'),h.push('<div class="qwiz_icon_trigger" style="left: -12px; top: -4px;">'),h.push("</div>"),h.push('<div id="usermenu-qwiz'+e+'" class="qwiz-usermenu qwiz_menu">'),h.push("</div>"),h.push("</div>"),h.push("</div>")}d="",qwizdata[e].hide_progress_b&&(d=' style="display: none;"'),h.push('<div id="progress-qwiz'+e+'" class="qwiz-progress"'+d+">"),h.push("</div>"),h.push("</div>"),h=h.join("\n");var p="";(qwizdata[e].qrecord_id||qwizdata[e].use_dataset)&&(p='<div id="qwiz_login-qwiz'+e+'" class="qwiz-login">\n</div>');var g=[];return z>1||qwizdata[e].use_dataset||qwizdata[e].combo||qwizdata[e].use_dataset_questions_htm||q.qwizard_b?(a&&-1!=a.indexOf("[unpaid")&&-1!=a.indexOf("[/unpaid]")?a=(a=a.replace("[unpaid]",'<span class="unpaid_msg">')).replace("[/unpaid]","</span>"):a+='<span class="unpaid_msg_payment_type unpaid_msg"></span>',qwizdata[e].use_dataset&&!q.preview&&-1==a.indexOf("[restart")&&(a+="<br />[restart]"),a&&(a=create_restart_button(e,a)),q.qwizard_b&&(a=qqc.shortcodes_to_video_elements(a)),qwizdata[e].summary_b&&g.push(create_summary_report_div(e,a))):(1==z&&a&&(a=create_restart_button(e,a),g.push('<div class="single-question_exit">
13'),g.push(a),g.push("</div>")),qwizdata[e].qwizzled_b||qwizdata[e].hotspot_b||qwizdata[e].qrecord_id||qqc.is_mobile(qwizdata[e].mobile_enabled)||q.qwizard_b||(h="")),g.push('<div class="next_button" id="next_button-qwiz'+e+'">\n'),g.push('<button class="qwiz_button" onclick="'+qname+".next_question ("+e+')">'),g.push('<span id="next_button_text-qwiz'+e+'">'),g.push(T("Start quiz")),g.push("</span>"),g.push("</button>\n"),g.push("</div>\n"),qwizdata[e].summary_b||(z>1||qwizdata[e].combo)&&a&&g.push(create_summary_report_div(e,a)),qwizdata[e].hide_qwizcards_icon_b||qwizdata[e].icon_swhs||g.push(create_icon_qwiz_div(e)),g.push("</div>"),i=o+h+p+i+g.join("")+"</div>\n"}function create_icon_qwiz_div(e){const t=qwizdata[e].icon_swhs;var i=[];i.push('<div class="icon_qwiz" id="icon_qwiz'+e+'">');var a=qqc.get_qwiz_param("icon_qwiz");if("Not displayed"!=a){const e=t?"swinginghotspot":"qwizcards";"Icon only"!=a&&i.push('<a href="mailto:support@'+e+'.net" style="border: none; box-shadow: none;">');const _=T("Questions, comments, suggestions?")+" support@"+e+".net";var s;s=t?"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAABnWAAAZ1gEY0crtAAABiElEQVQ4jZWSv0sCYRyHnzvvinCIhBwEoyFBcJB0CKSmBJejIWhqbAuhv8DFCAdndRehqVDIKdokWlsEI1qiqesMkQNf77yGC/qh1t0zfvg8vO/3fb/gnUiE8/PvgexDLhQIh330v0ilEILNze+Z8qMRCLC7y+oqqoosI8s4DrZNr0e5jK6jafR6mOYs+fSUoyOenrBtAElClllYYGMDReHiguNj3t6oVmfdrVik2yUU+hFms+g6Z2fkcoxGbG3NGUxVabfpdFha+kySSSwLIahUeH/n5OTPhwkGubuj1UJRANJphMCycBxqtT9Nl3CYx8evwba3MQxublBVDzIQi/H6Sj4P0Gjw8MDKijfTZW8Pw2B/n8GAeNyPCSwv4zjU6zSb8yrz19OyAIJBhkP/8mQCIEmMx/5lF3c9fcvuPwvB4uI/B/xmfZ12m+dnNA3TpFQiEPAs399zfc3aGsDODobB4aFn+fIS2+bqioMD+n1Mk0xmuiXNliWJRIJolJcXolFub+n3p1sfn3l/Jjmrf3gAAAAASUVORK5CYII=":"iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAIAAAALACogAAAABnRSTlMA/wD/AP83WBt9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABP0lEQVR4nGP8//8/AymAiSTV5GhgwSZ4rcRrxRooW3futlBnJDlGND/cXzXVccFLVP0oepiwqtZJyH2wrenBtogQBgYGhsv9q15j9cO1qTDVW8JEGRgYGBi0PJ0YGBgYrjzCpuH+qv1rGBgYGHQLoaoZGBgYlOTEGRgYGB68uY+h4fXuQy8ZGBgYnLSRvXjv0UsGBgYGBRFFdA1Prm+6x8DAwBBio4XsyO37GBgYGHTkEHaixYO4mszrWTl1CjmH7iMcKe5nhdAAi4cnL6/A3HbrHgMDw56pJ0QYIOHr5JgmgzASZoOFdggDAwPDy03HRCEhs6YJEne6c0uQHYkUcXt76pL3oTqQQbxqVjay8Sh+cC5pmuuEpkFMWQZNBCNpwMDrWTmT2+5hCCu54EqtomkVLjqYwgoiuGzACWifgQDhK2rq5bcX2gAAAABJRU5ErkJggg==",i.push('<img class="icon_qwiz" style="border: none;" title="'+_+'" src="data:image/png;base64,'+s+'" />'),"Icon only"!=a&&i.push("</a>")}return i.join("")}function create_summary_report_div(e,t){var i=[];return i.push('<div id="summary-qwiz'+e+'" class="qwiz-summary">\n'),i.push('<div id="summary_report-qwiz'+e+'" class="qwiz_summary_report">'),i.push("</div>\n"),i.push('<div id="summary-quiz_times_histogram-qwiz'+e+'">'),i.push("</div>\n"),i.push('<div id="qwiz_exit-qwiz'+e+'" class="qwiz-exit qwiz_editable">'),i.push(t),i.push("</div>\n"),i.push('<button class="summary_exit_mobile_qwiz" onclick="'+qname+".exit_mobile ("+e+')">\n'),i.push("Return to page view"),i.push("</button>\n"),i.push("</div>\n"),i.join("")}function get_login_html(e,t,i,a){t=t?1:0,a=a?1:0;var s="onfocus=\"jQuery ('#qwiz_login-qwiz"+e+" p.login_error').hide ()\"",_="<p>";_+=i?"<strong>"+i+"</strong>":t?"<strong>"+T("Add team member")+"</strong>":"<strong>"+T("Record score/credit")+"</strong>",_+="</p>",_+='<form action="nada" onSubmit="return qwiz_.login ('+e+", "+t+", "+a+')">\n<table border="0" align="center" width="100%"><tr><td><label for="qwiz_username-qwiz'+e+'"><nobr>'+T("Login name")+'</nobr></label></td><td><input type="text" id="qwiz_username-qwiz'+e+'" '+s+' /></td></tr><tr><td><label for="qwiz_password-qwiz'+e+'">'+T("Password")+'</label></td><td><input type="password" id="qwiz_password-qwiz'+e+'" /></td></tr><tr><td style="text-align: right;"><span class="qwiz-remember" title="'+T("Save preference (do not use on shared computer)")+'"><label><span class="qwiz-remember"><input type="checkbox" /> '+T("Remember")+'</span></label></span></td><td><button class="qwiz_button">'+T("Student login")+"</button> ",t||(_+='<button type="button" class="qwiz_button" onclick="qwiz_qcards_common.create_register_taker_screen (\''+qname+"', "+e+", "+a+')">'+T("New student - register")+"</button> "),_+='<button type="button" class="qwiz_login_cancel_no_thanks qwiz_button" onclick="'+qname+".no_login ("+e+","+t+')">',_+=T(t?"Cancel":"No thanks"),_+="</button></td></tr>",t||(_+='<tr><td></td><td class="qwiz-smaller"><a href="'+qqc.get_qwiz_param("secure_server_loc","https://qwizcards.net/admin")+'/password_reset_request" target="_blank">'+T("Forgot password?")+"</a></td></tr>");var o="new_account";return-1!=window.location.href.indexOf("learn-biology.com")&&(o="new_account_smv"),_+='<tr><td colspan="2"><hr style="margin: 5px;"></td></tr><tr><td colspan="2" class="qwiz-center"><b>
13'+T("Teachers: track your students’ progress on quizzes and flashcards")+'. <a href="'+qqc.get_qwiz_param("secure_server_loc","https://qwizcards.net/admin")+"/"+o+'" target="_blank"><nobr>'+T("Create teacher administrative account")+'</nobr></a></b></td></tr></table>\n</form><p class="login_error">'+T("Login incorrect. Please try again")+"</p>\n"}function create_restart_button(e,t,i){var a=t.match(/\[restart[^\]]*\]/);if(a){var s;s=i||1==qwizdata[e].n_questions?T("Do this question again"):qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f?T("Practice more questions"):T("Take this quiz again");var _=get_attr(qqc.replace_smart_quotes(a[0]),"label");_&&(s=_);var o='<button class="qwiz_button qwiz_restart" onclick="'+qname+"."+(i?"redo_question":"restart_quiz")+" ("+e+')">'+s+"</button>";t=t.replace(a,o)}return t}function create_bg_img_style(e,t){var i="",a=qwizdata[e].bg_img[t];if(a){var s=a.top?a.top+"px":"0";i=' style="background: no-repeat '+(a.left?a.left+"px":"0")+" "+s+" / "+(a.width?a.width+"px":"auto")+" "+(a.height?a.height+"px":"auto")+" url("+a.src+')"';debug[0]&&console.log("[create_bg_img_style] style:",i)}return i}function process_question_attributes(e,t,i,a){set_qwizard_data_b&&(void 0===a&&(a=t),qw.questions_cards[a]={}),qwizdata[e].dataset_id[t]=t,qwizdata[e].unit[t]=qwizdata[e].default_unit;var s=i.match(/\[(<code><\/code>)*q\s*([^\]]*)\]/m)[2];if(s){s=qqc.replace_smart_quotes(s),set_qwizard_data_b&&(qw.questions_cards[a].question_attributes=s),q.qwizard_b&&(qwizdata[e].qwizard_multiple_choice_b[t]="true"==get_attr(s,"multiple_choice"));var _=get_attr(s,"topic",!0);if(_||(_=get_attr(s,"unit",!0)),_){debug[4]&&console.log("[process_question_attributes] question_topics: ",_),set_qwizard_data_b&&(qw.questions_cards[a].topic=_),_=_.split(/; */);for(var o=0;o<_.length;o++){_[o]=_[o].replace(/\s/g,"_");var n=_[o];-1==qwizdata[e].topics.indexOf(n)&&qwizdata[e].topics.push(n)}qwizdata[e].question_topics[t]=_}if(qwizdata[e].use_dataset||qwizdata[e].dataset||qwizdata[e].use_dataset_question_ids[t]){const i=get_attr(s,"dataset_id");i&&(qwizdata[e].dataset_id[t]=i)}var r=get_attr(s,"unit");r&&(qwizdata[e].unit[t]=r,set_qwizard_data_b&&(qw.questions_cards[a].unit=r),-1==qwizdata[e].units.indexOf(r)&&qwizdata[e].units.push(r));var d=get_attr(s,"level");d&&(qwizdata[e].level[t]=d,set_qwizard_data_b&&(qw.questions_cards[a].level=d),-1==qwizdata[e].levels.indexOf(d)&&qwizdata[e].levels.push(d));var c=get_attr(s,"use_dataset_question");c&&(qwizdata[e].use_dataset_question_ids[t]=c,qwizdata[e].dataset_id[t]=c,set_qwizard_data_b&&(qw.questions_cards[a].from_dataset_b=!0));var l=get_attr(s,"bg_img_src");if(l){var w={};w.src=l,w.left=get_attr(s,"bg_img_left"),w.top=get_attr(s,"bg_img_top"),w.width=get_attr(s,"bg_img_width"),w.height=get_attr(s,"bg_img_height"),qwizdata[e].bg_img[t]=w,set_qwizard_data_b&&(qw.questions_cards[a].bg_img=w)}const i=get_attr(s,"hotspot_user_interaction");i&&(qwizdata[e].hotspot_user_interaction[t]=i,set_qwizard_data_b&&(qw.questions_cards[a].hotspot_user_interaction=i));const h=get_attr(s,"hotspot_labels_stick");h&&(qwizdata[e].hotspot_labels_stick[t]=h,set_qwizard_data_b&&(qw.questions_cards[a].hotspot_labels_stick=h));const u=get_attr(s,"show_hotspots");u&&(qwizdata[e].show_hotspots[t]=u,set_qwizard_data_b&&(qw.questions_cards[a].show_hotspots=u));const z=get_attr(s,"find_the_dot_width");z&&(qwizdata[e].find_the_dot[t]={},qwizdata[e].find_the_dot[t].width=z,qwizdata[e].find_the_dot[t].height=get_attr(s,"find_the_dot_height"),qwizdata[e].find_the_dot[t].dot_color=get_attr(s,"find_the_dot_dot_color"),qwizdata[e].find_the_dot[t].background_color=get_attr(s,"find_the_dot_background_color"),qwizdata[e].find_the_dot[t].controls="false"!=get_attr(s,"find_the_dot_controls"),qwizdata[e].find_the_dot[t].new_dot_button_style=get_attr(s,"find_the_dot_new_dot_button_style"));const m=get_attr(s,"prompt_intro"),p=get_attr(s,"prompt_intro_add"),g=get_attr(s,"prompt_for_question"),b=get_attr(s,"prompt_for_response"),f=get_attr(s,"response_min_chars"),v=get_attr(s,"prompt_for_feedback");(m||p||g||b||f||v)&&(qwizdata[e].prompt_intro||(qwizdata[e].prompt_intro={},qwizdata[e].prompt_intro_add={},qwizdata[e].prompt_for_question={},qwizdata[e].prompt_for_response={},qwizdata[e].response_min_chars={},qwizdata[e].prompt_for_feedback={})),m&&(qwizdata[e].prompt_intro[t]=m),p&&(qwizdata[e].prompt_intro_add[t]=p),g&&(qwizdata[e].prompt_for_question[t]=g),b&&(qwizdata[e].prompt_for_response[t]=b),f&&(qwizdata[e].response_min_chars[t]=f),v&&(qwizdata[e].prompt_for_feedback[t]=v);const y=get_attr(s,"random_mc");y&&(void 0===qwizdata[e].random_mc&&(qwizdata[e].random_mc={}),qwizdata[e].random_mc[t]="true"==y)}return _}function check_questions_have_topics(e){for(var t=!1,i=0;i<qwizdata[e].n_questions;i++)qwizdata[e].information_question_b[i]||qwizdata[e].question_topics[i]||(qwizdata[e].question_topics[i]=["Other"],t=!0);t&&-1==qwizdata[e].topics.indexOf("Other")&&qwizdata[e].topics.push("Other"),debug[4]&&console.log("[check_questions_have_topics] qwizdata[i_qwiz].question_topics:",qwizdata[e].question_topics),qwizdata[e].topic_statistics={};for(var a=qwizdata[e].topics.length,s=0;s<a;s++){var _=qwizdata[e].topics[s];qwizdata[e].topic_statistics[_]={},qwizdata[e].topic_statistics[_].n_correct=0,qwizdata[e].topic_statistics[_].n_incorrect=0}}function start_timers(e,t){if(debug[0]&&console.log("[start_timers] i_qwiz:",e,", question_time_limit_sec:",t),!q.preview){if(qwizdata[e].question_time_limit&&!qwizdata[e].question_timer_interval_id&&t){const i=$("#qwiz"+e+"-question_timer");qwizdata[e].$question_timer=i;const a=qqc.hhmmss_from_sec(t);i.html(a).show(),q.qwizard_b||(qwizdata[e].question_timer_interval_id=setInterval(update_timer,1e3,e,!0),qwizdata[e].times_up_msec=(new Date).getTime()+1e3*t+500)}if(qwizdata[e].qwiz_timer&&!qwizdata[e].qwiz_timer_interval_id){const t=$("#qwiz"+e+"-qwiz_timer");qwizdata[e].$qwiz_timer=t,q.qwizard_b||(qwizdata[e].qwiz_timer_interval_id=setInterval(update_timer,1e3,e),qwizdata[e].n_qs_done&&0!=qwizdata[e].n_qs_done.size||(qwizdata[e].timer_cumulative_sec=0))}}}function stop_timer(e,t=!1,i){if(i)qwizdata[e].question_timer_interval_id&&(clearInterval(qwizdata[e].question_timer_interval_id),qwizdata[e].question_timer_interval_id="");else if(qwizdata[e].qwiz_timer_interval_id){if(clearInterval(qwizdata[e].qwiz_timer_interval_id),qwizdata[e].qwiz_timer_interval_id="",!t&&qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b&&qwizdata[e].n_qs_done&&qwizdata[e].n_qs_done.size==qwizdata[e].n_qs){const t=qwizdata[e].timer_cumulative_sec;qwizdata[e].when_done_unix=0;var a={elapsed_time:t,callback:"record_quiz_time_callback"};qqc.jjax(qname,e,qwizdata[e].qrecord_id,"record_quiz_time",a)}-1!=qwizdata[e].qrecord_id.indexOf("finish_times_demo")&&(qwizdata[e].elapsed_time=qwizdata[e].timer_cumulative_sec)}}function update_timer(e,t){var i;if(t){(i=parseInt((qwizdata[e].times_up_msec-(new Date).getTime())/1e3))<=0&&(times_up(e),i=0);const t=qqc.hhmmss_from_sec(i);qwizdata[e].$question_timer.html(t)}
13else{qwizdata[e].timer_cumulative_sec++;const t=qqc.hhmmss_from_sec(qwizdata[e].timer_cumulative_sec);qwizdata[e].$qwiz_timer.html(t)}}function times_up(e){stop_timer(e,!0,!0),qwizdata[e].$question_timer.html("0:00"),$("div#overlay-times-up-qwiz"+e).show(),qwizdata[e].n_incorrect++,update_progress_show_next(e)}function check_timers(){for(var e=0;e<n_qwizzes;e++)if(qwizdata[e].question_timer_interval_id||qwizdata[e].qwiz_timer_interval_id){stop_timer(e,!0,!0),stop_timer(e,!0),restart_timers_i_qwiz=e;break}}function hide_current_question(e,t){var i=`qwiz${e}-q${t}`;$(`div#${i}, div.${i}`).hide(),$(`div#mobile_${i}, div.mobile_${i}`).hide()}function scale_quiz_to_container_when_visible(e,t){debug[0]&&(console.log("[scale_quiz_to_container_when_visible] entries:",e),console.log("[scale_quiz_to_container_when_visible] observer:",t));const i=$(e[0].target);i.is(":visible")&&(scale_quiz_to_container(i),t.unobserve(e[0].target))}function scale_quiz_to_container(e){var t=e.outerWidth(),i=e.parent();if(i.length){var a=i.width();if(a>0&&t>a){const s=a/t,_=Math.round(50*(1-s)),o="rtl"==getComputedStyle(i[0]).direction?1:-1;e.css({transform:"translate("+o*_+"%, -"+_+"%) scale("+s.toFixed(3)+")"}),qqc.offset_height_rescale(e,s);const n=e[0].id.match(/qwiz(\d+)/);if(n){const t=n[1];debug[0]&&(console.log("[scale_quiz_to_container] $qwiz:",e),console.log("[scale_quiz_to_container] i_qwiz:",t)),qwizdata[t].width_reset=!0}e[0].qscale_fac=s}}}function get_my_previous_answer(e,t){qwizdata[e].dataset_id[t]}function record_response(e,t,i,a){if(!q.preview&&!q.qwizard_b&&!a){const t=DateFormat.format.date((new Date).getTime(),"h:mm:ss");$("span.response_recorded_wrapper-qwiz"+e).css({display:"inline-block"}).attr("title",T("Recording your response at")+" "+t+" - "+T("not complete"));$(`span.response_recorded-qwiz${e} img.response_recording`).addClass("response_recording_spin").removeAttr("title")}if(document_qwiz_maker_privileges||document_qwiz_mobile||$.cookie(document_qwiz_username+"do_not_show_assign_to_class")||"start"!=i.type||!qwizdata[e].qrecord_id_not_ok||("not in a class"==qwizdata[e].qrecord_id_not_ok?($(".has_not_been_assigned").hide(),$(".not_in_a_class").show(),$("div#qwizcards_dialog_no_credit").parent().find(".ui-dialog-title").html(T("You are not in a class"))):(qwiz_.assign_to_class_i_qwiz=e,qwiz_.assign_to_class_qrecord_id=t,$(".has_not_been_assigned").show(),$(".not_in_a_class").hide(),$("div#qwizcards_dialog_no_credit").parent().find(".ui-dialog-title").html(T("Quiz not assigned in your class"))),qwiz_.$dialog_no_credit.dialog("open").dialog("moveToTop")),i.correct_b&&!i.secure_f){update_progress_meter(e,t,decodeURIComponent(atob(i.q_and_a_text)),i.q_and_a_crc32,i.type)}var s=t;if(qwizdata[e].combo)if(qwizdata[e].question_qrecord_ids){var _=Math.max(qwizdata[e].i_question,0);s=qwizdata[e].question_qrecord_ids[_]}else s=qwizdata[e].combo_qrecord_id;qqc.qjax(qname,e,s,"record_response_v4",i)}function update_progress_meter(e,t,i,a,s){let _=i+"||"+a+"||"+s;if(qqc.question_card_ids_by_qrecord_id[t]){if(-1==qqc.question_card_ids_by_qrecord_id[t].indexOf(_)){qqc.question_card_ids_by_qrecord_id[t].push(_);const i=qqc.question_card_ids_by_qrecord_id[t].length;$(`div.qwiz-progress_meter-qwiz${e}`).css({"--m":i})}}else qqc.question_card_ids_by_qrecord_id[t]=[_],$(`div.qwiz-progress_meter-qwiz${e}`).css({"--m":1})}function reset_label_positions(e){debug[8]&&console.log("[reset_label_positions] $qwizq:",e),e.find("td.qwizzled_labels div.qwizzled_label").each((function(){var e=$
13(this).parents("li").offset();debug[8]&&console.log("[reset_label_positions] label_offset:",e),$(this).data("label_x",e.left).data("label_y",e.top)}))}function process_multiple_choice(e,t,i,a){var s,_,o="",n=qqc.opening_tag_shortcode_pos("([c]|[c*])",i);if(n==i.length)errmsgs.push(T('Did not find choices ("[c]")')+". qwiz: "+(e+1)+", "+T("question")+" "+(t+1)),s="",_="";else{var r,d=i.substr(0,n),c=i.match(/\[c\*{0,1}\]/gm),l=0;if(c&&(l=c.length),debug[0]&&(console.log("[process_multiple_choice] n_choices: ",l),console.log("[process_multiple_choice] span_pos: ",n),console.log("[process_multiple_choice] question_htm: ",d)),qwizdata[e].qrecord_id)qqc.isInteger(qwizdata[e].dataset_id[t])?(r=qqc.remove_tags_eols(d),qwizdata[e].q_and_a_text[t]=qqc.q_and_a_hash(r),qwizdata[e].q_and_a_crc32[t]=qwiz_crc32(i)):(qwizdata[e].q_and_a_text[t]=qwizdata[e].dataset_id[t],qwizdata[e].q_and_a_crc32[t]="dataset");if(set_qwizard_data_b&&(qw.questions_cards[t].type="multiple_choice",d=qqc.shortcodes_to_video_elements(d),qw.questions_cards[t].question_text=a+d),1==l){const i=new RegExp("\\[response[^\\]]*\\]"),s=d.match(i);var w=!1,h=!1;if(s||qwizdata[e].generative_feedback){s&&s.length>1&&errmsgs.push(T("More than one [response]")+". qwiz: "+(e+1)+", "+T("question")+" "+(1+t)),s||(d+="[response]",h=!0),w=!0,qwizdata[e].generative_response||(qwizdata[e].generative_response={}),qwizdata[e].generative_response[t]=!0;const _=`\n <div class="qwiz-grow-wrap">\n <textarea id="check_my_answer-qwiz${e}-q${t}" class="qwiz-grow-wrap" onfocus="${qname}.hide_check_my_answer_feedback (${e}, ${t})" oninput="this.parentNode.dataset.replicatedValue=this.value" placeholder="Enter your response"></textarea>\n </div>`;d=q.qwizard_b?create_hangman_textentry_editable_divs(e,t,a,[_],"response",i,d):`<div class="qwiz${e}-q${t} qwizq">\n ${a}${d.replace(i,_)}\n </div>`;d+=`<div style="text-align: right">\n <input class="qwiz${e}-q${t}-generative_hint generative_hint" maxlength="50" placeholder="Ask for a hint (50 letters max)" />\n <button class="qwiz_button_small" onclick="${`${qname}.generate_custom_feedback (${e}, ${t}, this, true)`}">\n ${T("Get hint")}\n </button>\n </div>`}}_=i.substr(n),o="</p>"}set_qwizard_data_b&&(qw.questions_cards[t].n_choices=l,qw.questions_cards[t].choices=[],qw.questions_cards[t].feedbacks=[]);for(var u=0,z=["[c]","[c*]"],m=["[c]","[c*]","[x]"],p=!1,g=-1,b=[],f=[],v=[],y=-1,x=0;x<l;x++){var k=qqc.parse_html_block(_,z,m);if(_=_.substr(k.length),q.wordpress_page_f&&-1!=(k=cvt_feedback(k)).indexOf("[c*]")&&(c[x]="[c*]"),k=(O=process_feedback_item(k,e,t,x,w)).choice_html,O.feedback_div)if(x!=l-1||p||1==l){p=!0,O.fx_b&&(-1==g?g=b.length:errmsgs.push(T("Got more than one [fx]")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t))),b.push(O.feedback_div),f.push(O.feedback_item_html),(O=process_feedback_item(k,e,t,A)).feedback_div&&errmsgs.push(T("More than one feedback shortcode [f] or [fx] given with a choice")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+x))}else{b[0]=O.feedback_div,f[0]=O.feedback_item_html;var $=1;O.fx_b&&(g=0,$=0);for(var A=1;A<l;A++){if(k=(O=process_feedback_item(k,e,t,A)).choice_html,!O.feedback_div)break;b[A]=O.feedback_div,f[A]=O.feedback_item_html,O.fx_b?-1==g?g=A:errmsgs.push(T("Got more than one [fx]")+". qwiz: "+(e+1)+", "+T("question")+" "+(1+t)):$++}1==$||-1!=g?(b[l-1]=b[0],b[0]="",f[l-1]=f[0],f[0]="",0==g&&(g=l-1)):$!=l?errmsgs.push(T("Number of feedback items does not match number of choices")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)):b[0]=b[0].replace(/(qwiz[0-9]+-q[0-9]+-a)[0-9]+/,"$10")}else b.push(""),f.push("");debug[2]&&console.log("[process_multiple_choice] feedback_divs:",b);var C=k.match(/\[c\*{0,1}\]/m)[0],I=k.replace(/\[c\*{0,1}\]/m,"");if(v.push(I),k=/^\s*<([ph]|br)/.test(I)?I.replace(/^\s*<([ph]|br)[^>]*>/,"$&"+C):C+I,q.qwizard_b)k=k.replace(/  /g,"");else(R=k.match(/(<\/p>|<br>)\s*$/))||(R=k.match(/  \s*$/))||(k+="  ");if(l>1||q.qwizard_b&&qwizdata[e].qwizard_multiple_choice_b[t]){var O;(O=create_radio_button_html(e,t,x,c[x])).correct&&(u++,y=x);var j=(G="qwiz"+e+"-q"+t)+"-a"+x,S="";if(q.qwizard_b&&(S=' style="cursor: text;"'),k=k.replace(/\[c\*{0,1}\]/m,O.htm+'<span class="qwiz-choice qwiz_editable" data-i_choice="'+x+'"'+S+">"),/^\s*<[ph]/.test(k)){var E=(k=k.trimEnd()).length;if("</p"!=k.substr(E-4,3)&&"</h"!=k.substr(E-5,3)){var M=k.indexOf(">");-1!=M&&(o+=k.substr(0,M+1),k=k.substr(M+1)),k+="</span>"}else k=k.replace(/<\/(p|h[1-6])>$/,"</span>$&")}else k+="</span>";if(set_qwizard_data_b){var R=k.match(/<span class="qwiz-choice[^>]+>/),Y=(R=k.match(/<span class="qwiz-choice[^>]+>([^]*?)<\/span>/),qqc.shortcodes_to_video_elements(R[1]));qw.questions_cards[t].choices[x]=Y}const i='onclick="'+qname+".process_choice (event, '"+j+"')\"";var B="";qwizdata[e].mc_style&&"radio"!=qwizdata[e].mc_style&&(B="-"+qwizdata[e].mc_style),debug[2]&&(console.log("[process_multiple_choice] choices_html:",o),console.log("[process_multiple_choice] choice_html:",k));var N="";if(x==l-1&&!B){const e=o.match(/<p[^>]*>\s*$/);e&&(i_pos=e.index,o=o.substr(0,i_pos)+'<span class="qwiz-choices">'+o.substr(i_pos),N="</span>")}o+=`<span class="choices-${G} choice-${j} qwiz-choices${B}" ${i} data-i_choice="${x}">
13\n\n <span class="qwiz-choice" data-i_choice="${x}'">\n ${k}\n </span>\n </span>\n `+N}else{k=k.replace(/\[c\*{0,1}\]/m,""),y=0,u=1,Q=w?`${qname}.generate_custom_feedback (${e}, ${t}, this)`:1==qwizdata[e].n_questions?`${qname}.process_choice (event, 'qwiz${e}-q${t}-a0', true)`:`${qname}.show_answer_got_it_or_not (${e}, ${t}, this)`;var F=k;if(w?F=T("Check my answer"):-1!=F.indexOf("[show_me_placeholder]")&&(F=T("Show me the answer")),o+=`<button class="qwiz_button show_the_answer qwiz-choice" data-i_choice="0" style="margin-left: 20px !important;" onclick="${Q}">\n <div class="check_show_answer qwiz_editable" style="padding: 0;">\n ${F}\n </div>\n </button>\n`,w){Q=`${qname}.stuck_show_answer (event, ${e}, ${t})`,o+=`<button class="qwiz_button show_the_answer qwiz-choice ${q.qwizard_b?"":"qwiz_editable"}" data-i_choice="1" onclick="${Q}">`,o+="I’m stuck – show me the answer",o+="</button>\n";o+=`<div class="qwiz${e}-q${t}-spinner qwiz-center" style="display: none;">\n <img src="${qqc.get_qwiz_param("url","./")}images/spinner40x40.gif" />'\n </div>`}set_qwizard_data_b&&(qw.questions_cards[t].type="show_me",w&&(qw.questions_cards[t].generative_response=!0),k=qqc.shortcodes_to_video_elements(k),qw.questions_cards[t].choices[x]=k),b[0]||errmsgs.push(T("Feedback [f] is required for a one-choice question")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t))}}if(set_qwizard_data_b&&"show_me"!=qw.questions_cards[t].type){debug[12]&&console.log("[process_multiple_choice] choices_html:",o);var L=o.substr(31).indexOf("<span");-1!=L&&-1==o.substr(31+L).search(/<p|<h[1-6]|<br/)&&(qw.questions_cards[t].choices_inline=!0)}s=`<div id="qwiz${e}-q${t}" class="qwiz${e}-q${t} qwizq" ${create_bg_img_style(e,t)}>\n\n ${w?d:`<div class="qwiz-question qwiz_editable">\n ${d}\n </div>`}\n ${o}`,debug[1]&&console.log("[process_multiple_choice] desktop_htm: ",s),0==u?q.qwizard_b||qwizdata[e].use_dataset||qwizdata[e].use_dataset_question_ids[t]||errmsgs.push(T("No choice was marked correct")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)):u>1?errmsgs.push(T("More than one choice was marked correct")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)):set_qwizard_data_b&&(qw.questions_cards[t].correct_choice=y);for(x=0;x<l;x++)if(!b[x])if(-1!=g&&x!=y)b[x]=b[g].replace(/(qwiz[0-9]+-q[0-9]+-a)[0-9]+/,"$1"+x);else{var W=q.canned_feedback(x==y);b[x]=create_feedback_div_html(e,t,x,W),f[x]=W}if(s+=b=b.join("\n"),set_qwizard_data_b)for(x=0;x<l;x++)qw.questions_cards[t].feedbacks[x]=qqc.shortcodes_to_video_elements(f[x]);if(1==l&&(qwizdata[e].n_questions>1||qwizdata[e].combo||qwizdata[e].use_dataset)){s+=create_got_it_or_not("",e,t,w?"generative":"")}debug[2]&&console.log("[process_multiple_choice] desktop_htm: ",s),s+="</div>\n";var G=`mobile_qwiz${e}-q${t}`;d=d.replace(/qwiz(\d+)/g,"mobile_qwiz$1");var D=[];D.push(`<div id="${G}" class="${G} qwizq-mobile">\n`),D.push(d),D.push('<ul class="mobile_choices">');for(x=0;x<l;x++){j=G+"-a"+x;var Q,P,U=x==y?'data-q="1"':"";w?Q=`${qname}.generate_custom_feedback (${e}, ${t}, this)`:l>1||1==qwizdata[e].n_questions?Q=qname+".process_choice (event, '"+j+"')":(Q=qname+".show_answer_got_it_or_not ("+e+", "+t+", this)",-1!=v[0].indexOf("[show_me_placeholder]")&&(v[0]="Show me the answer")),P=h?"Check my answer":v[x],D.push('<li id="choice-'+j+'" class="mobile_choice" onclick="'+Q+'" '+U+">"),D.push('<div class="mobile_choice">'),D.push(P),D.push("</div>"),D.push("</li>")}if(w&&(Q=`${qname}.stuck_show_answer (event, ${e}, ${t})`,D.push('<li id="choice-'+j+'" class="mobile_choice" onclick="'+Q+'" '+U+">"),D.push('<div class="mobile_choice">'),D.push("I’m stuck – show me the answer"),D.push("</div>"),D.push("</li>")),D.push("</ul>"),D.push('<div style="clear: both;"></div>'),w){const i=qqc.get_qwiz_param("url","./");D.push(`<div class="qwiz${e}-q${t}
13-spinner qwiz-center" style="display: none;">\n <img src="${i}images/spinner40x40.gif" />'\n </div>`)}if(D.push(b.replace(/id="qwiz/gm,'id="mobile_qwiz')),1==l&&(qwizdata[e].n_questions>1||qwizdata[e].combo||qwizdata[e].use_dataset)){const i=w?"generative":"";D.push(create_got_it_or_not("mobile_",e,t,i))}return D.push("</div>"),s+"\n"+(D=D.join("\n"))}function process_textentry(e,t,i,a){qwizdata[e].textentry||(qwizdata[e].textentry={},textentry_b=!0);var s=i,_=qqc.opening_tag_shortcode_pos("([c*]|[c])",i);if(_<i.length?s=i.substr(0,_):errmsgs.push(T("No answer-word given")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)),qwizdata[e].qrecord_id)if(qqc.isInteger(qwizdata[e].dataset_id[t])){var o=qqc.remove_tags_eols(s);o=o.replace(/\[textentry[^\]]*\]/,"_________"),qwizdata[e].q_and_a_text[t]=qqc.q_and_a_hash(qqc.remove_tags_eols(o)),qwizdata[e].q_and_a_crc32[t]=qwiz_crc32(i)}else qwizdata[e].q_and_a_text[t]=qwizdata[e].dataset_id[t],qwizdata[e].q_and_a_crc32[t]="dataset";set_qwizard_data_b&&(qw.questions_cards[t].type="textentry",s=qqc.shortcodes_to_video_elements(s),qw.questions_cards[t].question_text=a+s,qw.questions_cards[t].choices=[],qw.questions_cards[t].correct_choice_fs=[],qw.questions_cards[t].feedbacks=[]);var n=!1,r=!0,d=3,c="true"==default_use_dict,l="true"==default_use_terms,w=!1,h=i.match(/\[textentry([^\]]*)\]/m),u="";if(h&&(u=h[1])){n="true"==get_attr(u=qqc.replace_smart_quotes(u),"plural"),r="false"!=get_attr(u,"suggest");var z=get_attr(u,"minlength");""!=z&&(d=z);var m=get_attr(u,"use_terms");m&&(l="false"!=m);var p=get_attr(u,"use_dict");p&&(c="false"!=p),w="true"==get_attr(u,"single_char")}set_qwizard_data_b&&(qw.questions_cards[t].type=w?"one_letter_answer":"textentry",qw.questions_cards[t].textentry_attributes=u,qw.questions_cards[t].textentry_plural_b=n);var g,b,f=i.substr(_);i=i.substr(0,_),w?(g="qwiz_single_char_entry",b='style="width: 2rem; padding: 2px;" '):r?(g="qwiz_textentry",b='style="width: 18em; padding: 2px;" '):(g="qwiz_textentry_no_suggest",b='style="width: 18em; padding: 2px;" ');var v,y='<input type="text" id="textentry-qwiz'+e+"-q"+t+'" autocomplete="off" class="'+g+'" '+b+'onfocus="'+qname+'.set_textentry_i_qwiz (event, this)" />',x=new RegExp("\\[textentry[^\\]]*\\]");v=q.qwizard_b?create_hangman_textentry_editable_divs(e,t,a,[y],"textentry",x,i):'<div id="qwiz'+e+"-q"+t+'" class="qwizq">\n'+a+i.replace(x,y),v+='<br /><div id="textentry_check_answer_div-qwiz'+e+"-q"+t+'" class="textentry_check_answer_div">\n<button class="qwiz_button qwiz_button_disabled textentry_check_answer" onclick="'+qname+".textentry_check_answer ("+e+')">'+T("Check answer")+'</button>\n \n<button class="qwiz_button qwiz_textentry_hint" style="display: none; font-size: 11px; padding: 2px 2px; border-radius: 5px;" onclick="'+qname+".textentry_hint ("+e+')" disabled>'+T("Hint")+"</button>\n</div>\n";var k=0,$=["[c]","[c*]"],A=["[c]","[c*]","[x]"],C=[];qwizdata[e].textentry[t]={},qwizdata[e].textentry[t].choices=[],qwizdata[e].textentry[t].textentry_plural_b=n,qwizdata[e].textentry[t].textentry_suggest_b=r,qwizdata[e].textentry[t].textentry_minlength=d,qwizdata[e].textentry[t].use_terms_b=l,qwizdata[e].textentry[t].use_dict_b=c,qwizdata[e].textentry[t].single_char_b=w,qwizdata[e].textentry[t].choices_correct=[],qwizdata[e].textentry[t].answers=[],qwizdata[e].textentry[t].first_correct_answer="",qwizdata[e].check_answer_disabled_b=!0;for(var I=0,O=!1;;){var j=qqc.parse_html_block(f,$,A);if("NA"==j)break;f=f.substr(j.length),q.wordpress_page_f&&(j=cvt_feedback(j)),j=(S=process_feedback_item(j,e,t,I)).choice_html;var S,E="";if(S.feedback_div)!0,C.push(S.feedback_div),E=S.feedback_item_html,(S=process_feedback_item(j,e,t,I)).feedback_div&&errmsgs.push(T("More than one feedback shortcode [f] given with choice")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+I));else C.push("");set_qwizard_data_b&&(qw.questions_cards[t].feedbacks[I]=qqc.shortcodes_to_video_elements(E));var M=-1!=j.search(/\[c\*\]/);M&&k++,j=j.replace(/[^]*\[c\*{0,1}\]/,""),q.qwizard_b&&-1!=j.indexOf("placeholder")||(j=j.replace(/<[^>]+>|\n| /g,"")),-1==j.replace(";","").search(/\S/)&&errmsgs.push(T("No word(s) given for [textentry] choice")+". qwiz: "+(e+1)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+I));for(var R=j.split(/\s*;\s*/),Y=[],B=0;B<R.length;B++)-1!=R[B].search(/\S/)&&Y.push(qqc.trim(R[B]));"*"==Y[0]&&(O=!0,M&&errmsgs.push(T('For [textentry] question, wildcard choice ("*", for any other user entry) cannot be marked correct "[c*]"')+". qwiz: "+(e+1)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+I))),qwizdata[e].textentry[t].choices.push(Y),qwizdata[e].textentry[t].choices_correct.push(M),set_qwizard_data_b&&(qw.questions_cards[t].choices.push(Y.join(";")),qw.questions_cards[t].correct_choice_fs.push(M?1:0)),M&&Y.length&&""==qwizdata[e].textentry[t].first_correct_answer&&(qwizdata[e].textentry[t].first_correct_answer=Y[0]);var N=Y.length;for(B=0;B<N;B++)-1!=qwizdata[e].textentry[t].answers.indexOf(Y[B])&&"Enter word"!=Y&&errmsgs.push(T("Answer given in more than one choice")+": "+Y[B]+". qwiz: "+(e+1)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+I));qwizdata[e].textentry[t].answers=qwizdata[e].textentry[t].answers.concat(Y),I++}set_qwizard_data_b&&(qw.questions_cards[t].n_choices=I),O||(I++,qwizdata[e].textentry[t].choices.push(["*"]),qwizdata[e].textentry[t].choices_correct.push(!1),set_qwizard_data_b&&(qw.questions_cards[t].choices.push("*"),qw.questions_cards[t].correct_choice_fs.push(0),qw.questions_cards[t].n_choices=I));var F=I;v+='<div style="clear: both;"></div>\n',0==k&&errmsgs.push(T("No choice was marked correct")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t));for(I=0;I<F;I++)if(!C[I]){var L=q.canned_feedback(qwizdata[e].textentry[t].choices_correct[I]);C[I]=create_feedback_div_html(e,t,I,L),set_qwizard_data_b&&(qw.questions_cards[t].feedbacks[I]=L)}return v+=C.join("\n"),v+="</div>\n",(debug[2]||debug[12])&&console.log("[process_textentry] new_htm: ",v),v}function process_hangman(e,t,i,a){var s=-1!=i.indexOf("hangman_img_wrapper"),_=i,o=qqc.opening_tag_shortcode_pos("([c*]|[c])",i);if(o<i.length?_=i.substr(0,o):(errmsgs.push(T("Did not get [c] or [c*] (hangman answer) with [hangman]")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)),o=0),qwizdata[e].qrecord_id)if(qqc.isInteger(qwizdata[e].dataset_id[t])){var n=qqc.remove_tags_eols(_);n=n.replace(/\[hangman[^\]]*\]/g,"_________"),qwizdata[e].q_and_a_text[t]=qqc.q_and_a_hash(qqc.remove_tags_eols(n)),qwizdata[e].q_and_a_crc32[t]=qwiz_crc32(i)}else qwizdata[e].q_and_a_text[t]=qwizdata[e].dataset_id[t],qwizdata[e].q_and_a_crc32[t]="dataset";var r=default_hangman_max_hints,d=!0,c="";if((z=i.match(/\[hangman([^\]]*)\]/m))&&(c=z[1])){var l=get_attr(c=qqc.replace_smart_quotes(c),"hints");l&&(-1==l.search(/[^0-9]/)?r=parseInt(l,10):errmsgs.push(T('"hints" for [hangman] should be a number')+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t))),d=!("false"==get_attr(c,"type_letters"))}var w="hangman",h=a;s&&(w="hangman_labeled_diagram",h=""),set_qwizard_data_b&&(qw.questions_cards[t].type=w,qw.questions_cards[t].hangman_attributes=c,_=qqc.shortcodes_to_video_elements(_),qw.questions_cards[t].question_text=h+_,qw.questions_cards[t].choices=[],qw.questions_cards[t].correct_choice_fs=[],qw.questions_cards[t].feedbacks=[]);var u=i;o&&(u=i.substr(0,o));for(var z,m,p=(z=u.match(/\[hangman/g)).length,g=i.substr(o),b=["[c]","[c*]"],f=["[c]","[c*]","[x]",'<div class="qwizzled_question_bottom_border_title"'],v=[],y=new RegExp("\\[hangman[^\\]]*\\]"),x=[],k=0;;){var $,A="",C=0,I=qqc.parse_html_block(g,b,f);if("NA"==I)break;if(g=g.substr(I.length),q.wordpress_page_f&&(I=cvt_feedback(I)),I=($=process_feedback_item(I,e,t,k)).choice_html,$.feedback_div)!0,v.push($.feedback_div),set_qwizard_data_b&&(qw.questions_cards[t].feedbacks[k]=qqc.shortcodes_to_video_elements($.feedback_item_html)),($=process_feedback_item(I,e,t,k)).feedback_div&&errmsgs.push(T("More than one feedback shortcode [f] given with hangman answer")+". qwiz: "+(1+e)+", "+T("question")+" "+(1+t)+", "+T("choice")+" "+(1+k));else v.push("");var O=I.match(/\[c\*{0,1}\]([^\[]*)/m);O&&(A=(A=O[1]).replace(/<[^>]+>|\n| /g,""),C=(A=qqc.trim(A)).length,debug[0]&&console.log("[process_hangman] hangman_answer:",A)),void 0===qwizdata[e].hangman[t]&&(qwizdata[e].hangman[t]={}),qwizdata[e].hangman[t].hangman_answer||(qwizdata[e].hangman[t].hangman_answer=[],qwizdata[e].hangman[t].hangman_final_entry=[],qwizdata[e].hangman[t].hangman_current_entry=[],qwizdata[e].hangman[t].hangman_incorrect_chars=[],qwizdata[e].hangman[t].hangman_incorrect_chars_before_hint=[],qwizdata[e].hangman[t].hangman_n_hints=[]),0==k&&(qwizdata[e].hangman[t].n_hangman=p,qwizdata[e].hangman[t].hangman_max_hints=r,qwizdata[e].hangman[t].hangman_type_letters=d,qwizdata[e].hangman[t].n_hangman_done=0,qwizdata[e].hangman[t].n_hangman_correct=0),qwizdata[e].hangman[t].hangman_answer[k]=A,set_qwizard_data_b&&(qw.questions_cards[t].choices[k]=A,qw.questions_cards[t].correct_choice_fs[k]=1),qwizdata[e].hangman[t].hangman_n_hints[k]=0;var j=qqc.create_hangman_entry(A);if(qwizdata[e].hangman[t].hangman_final_entry[k]=j,!v[k]){var S=q.canned_feedback(!0);v[k]=create_feedback_div_html(e,t,k,S),set_qwizard_data_b&&(qw.questions_cards[t].feedbacks[k]=S)}var E=new Array(C).join(" "),M=q.qwizard_b?' onfocus="qwizard.update_hangman_options_menu_choice (this, '+k+')"':"",R="",Y="";q.qwizard_b&&"placeholder"==A&&(R=" disabled",Y=" qwiz_button_disabled");var B,N='<span class="qwiz_hangman qwiz_hangman_c'+k+'" onkeyup="'+qname+'.hangman_show (this, true)" onmouseenter="'+qname+'.hangman_show (this)" onmouseleave="'+qname+'.hangman_hide (this)"><span class="hangman_current_entry hangman_entry"></span><input type="text" oninput="'+qname+".hangman_keyup (this, event,' "+E+"', "+e+", "+t+", "+k+')" onblur="'+qname+'.hangman_hide (this.parentElement)"'+M+" />";if(r&&qwizdata[e].repeat_incorrect_b)B=r<A.replace(/[^a-z0-9]/i,"").length?1==r?' title="'+T("You can get one hint letter, but your answer will c
13ount as incorrect")+'"':(B=' title="'+T("You can get %s hint letters, but your answer will count as incorrect")+'"').replace("%s",qqc.number_to_word(r)):' title="'+T("You can get hints, but your answer will count as incorrect")+'"',N+='<button id="hangman_hint-qwiz'+e+"-q"+t+"-c"+k+'" class="qwiz_button hangman_hint'+Y+'" onmouseenter="'+qname+'.hangman_show (this.parentElement)" onclick="'+qname+".hangman_hint ("+e+", "+t+", "+k+')"'+B+R+">"+T("Hint")+"</button>\n";d&&!q.qwizard_b&&(!s||s&&0==k)&&(N+='<span class="hangman_type_letters"></span>'),N+='<span class="hangman_status"></span></span>',q.qwizard_b&&!s?x.push(N):u=u.replace(y,N),k++}if(u=u.replace(/\[(<code><\/code>)*q[^\]]*\]/,""),k!=p&&errmsgs.push("Number of [hangman] shortcodes does not match number of hangman words [c]. qwiz: "+(1+e)+", "+T("question")+" "+(1+t)),set_qwizard_data_b&&(qw.questions_cards[t].n_choices=p),q.qwizard_b&&!s)m=create_hangman_textentry_editable_divs(e,t,h,x,"hangman",y,u);else{if(q.qwizard_b){var F=u.search(/<div[^>]+qwizzled_canvas/);if(-1!=F){var L=u.search(/<div[^>]+hangman_labeled_diagram_fields/);if(1!=L){var W=qqc.find_matching_block(u.substr(L));u=(u=u.replace(W,"")).substr(0,F)+W+u.substr(F)}}}m='<div id="qwiz'+e+"-q"+t+'" class="qwizq"'+create_bg_img_style(e,t)+">\n"+h+u}return debug[0]&&console.log("[process_hangman] new_htm:",m),m+='<div style="clear: both;"></div>\n',m+=v.join("\n"),m+='<div class="qwiz_hangman_msg"></div>',m+="</div>"}$(document).ready((function(){if((qqc=qwiz_qcards_common).qdebug(debug),"undefined"!=typeof document_qwiz_wp_user_session_id){const e={path:"/",expires:1};$.cookie("qwiz_session_id",document_qwiz_wp_user_session_id,e)}else document_qwiz_wp_user_session_id="";var e=$.cookie("qwiz_preview");void 0!==e&&(q.preview_i_qwiz_plus1=parseInt(e,10)+1,document_qwiz_username=$.cookie("qwiz_preview_username"),$.removeCookie("qwiz_preview",{path:"/"})),debug[0]&&(console.log("[qwiz.js > document ready] typeof (document_qwizard_user_page):",typeof document_qwizard_user_page),console.log("[qwiz.js > document ready] q.preview_i_qwiz_plus1:",q.preview_i_qwiz_plus1)),c
13orrect=[T("Good!"),T("Correct!"),T("Excellent!"),T("Great!")],incorrect=[T("Sorry, no."),T("No, that's not correct."),T("Sorry, that's not correct.")];var t=document.location.href;qwizcards_page_f=-1!=t.indexOf("qwizcards.com/u/")||-1!=t.indexOf("qwizcards.com/admin/")||-1!=t.indexOf("qwizcards.net/u/")||-1!=t.indexOf("qwizcards.net/admin/")||-1!=t.indexOf("localhost/u/")||-1!=t.indexOf("localhost/admin/")||-1!=t.indexOf("192.168.1.120/u/")||-1!=t.indexOf("192.168.1.120/admin/"),"undefined"==typeof document_qwizard_user_page&&-1==t.indexOf("admin-ajax")&&-1==window.location.href.indexOf("action=edit")&&-1==window.location.href.indexOf("post-new")?q.qwiz_init():regular_page_f=!1})),this.qwiz_init=function(e,t,i){if(content=qqc.get_qwiz_param("content","body"),default_use_dict=qqc.get_qwiz_param("use_dict","true"),default_use_terms=qqc.get_qwiz_param("use_terms","true"),default_hangman_max_hints=parseInt(qqc.get_qwiz_param("hangman_hints",2),10),hint_timeout_sec=qqc.get_qwiz_param("hint_timeout_sec",20),q.qwizcards_version=qqc.get_qwiz_param("qwizcards_version",""),document_qwiz_mobile_enabled=qqc.get_qwiz_param("mobile_enabled","Always"),"Enabled"==document_qwiz_mobile_enabled&&(document_qwiz_mobile_enabled="Always"),Tcheck_answer_message=T('Need help? Try the "hint" button'),!t){if(qqc.set_force_mobile(),process_html(),errmsgs.length&&!e&&(q.qwizard_b||(qqc.get_qwiz_param("regular_page_error_check")?alert(plural(T("Error found"),T("Errors found"),errmsgs.length)+":\n\n"+errmsgs.join("\n")):console.log("Errors found:\n",errmsgs.join("\n")))),document_qwiz_force_mobile_f&&q.go_mobile(0),n_qwizzes){for(var a=0;a<n_qwizzes;a++)if(qwizdata[a].questions){if(!document_qwiz_force_mobile_f){const e=qwizdata[a].mobile_enabled;("Always"==e||"Small screens only"==e&&qqc.is_mobile(e))&&$(".go-mobile-qwiz"+a).show()}if(qwizdata[a].qrecord_id&&(qwizdata[a].record_start_b=!0),qwizdata[a].use_dataset||q.init_question_order(a),q.no_intro_b[a]||1==qwizdata[a].n_questions||q.preview_i_qwiz_plus1)q.next_question(a);else if(!qwizdata[a].display_pay_screen){var s=$("div.intro-qwiz"+a);s.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this)})),s.show(),$("div#next_button-qwiz"+a).show()}}if(q.$dialog_no_credit||($("body").append(dialog_no_credit_html()),q.$dialog_no_credit=$("#qwiz_dialog_no_credit").dialog({height:400,width:550,modal:!0,autoOpen:!1,open:function(){check_timers(),$("div#qwiz_request_assign_to_class_feedback").html(""),$("button#qwiz_request_assign_to_class").removeClass("qwiz_button_disabled").prop("disabled",!1)},buttons:{Close:function(){if(q.$dialog_no_credit.dialog("close"),-1!=restart_timers_i_qwiz){const e=restart_timers_i_qwiz;qwizdata[e].question_time_limit&&start_timers(e,qwizdata[e].question_time_limit),qwizdata[e].qwiz_timer&&start_timers(e),restart_timers_i_qwiz=-1}}}})),q.preview_i_qwiz_plus1){var _=q.preview_i_qwiz_plus1-1;qwizdata[_].use_dataset||q.init_preview(_)}else q.preview&&!q.qwizard_b&&q.init_preview(0)}reinit_highlighting_f&&("undefined"!=typeof Prism?Prism.highlightAll():"undefined"!=typeof hljs&&$("code").each((function(e,t){hljs.highlightBlock(t),this.style.display="inline-block"})))}},this.process_html2=function(e,t,i,a){var s=new RegExp("\\[qwizdemo\\][\\s\\S]*?\\[\\/qwizdemo\\]","gm");q.qwizdemos=e.match(s),q.qwizdemos&&(e=e.replace(s,"<qwizdemo></qwizdemo>"),debug[0]&&console.log("[process_html2] q.qwizdemos.length: ",q.qwizdemos.length));var _=0,o=check_qwiz_tag_pairs(e=(e=e.replace(/<!--[^]*?-->/gm,"")).replace(/\[!+\][^]*?\[\/!+\]/gm,""));if(o)e=o,"undefined"!=typeof qwizard&&(qwizard.errmsgs=errmsgs);else{qwizzled_b=!1;var n=e.match(/\[qwiz[^]*?\[\/qwiz\]/gm);if(n){_=n.length,debug[0]&&(console.log("[process_html2] local_n_qwizzes: ",_),console.log(" qwiz_matches[0]: ",n[0])),q.preview_i_qwiz_plus1&&(q.preview=!0);var r=!0,d=!1;q.quizzes_questions=[];for(var c=0;c<_;c++){if(q.preview_i_qwiz_plus1&&(q.preview_i_qwiz_plus1==t+1?(d=!0,r=!0):r=!1),r){var l=q.process_qwiz_pair(n[c],t,i,a,a);if(a&&(qwizard.questions_cards&&qwizard.questions_cards.length&&(debug[0]&&console.log("[process_html2] qwizard.questions_cards:",qwizard.questions_cards),qwizard.questions_cards[0].dataset_b=qwizard.questions_cards_dataset_b,q.quizzes_questions[t]=JSON.parse(JSON.stringify(qwizard.questions_cards))
13),debug[0]&&(console.log("[process_html2] i_qwiz:",t,", qwizard.questions_cards:",qwizard.questions_cards),qwizard.questions_cards))){console.log("[process_html2] JSON.stringify (qwizard.questions_cards):",JSON.stringify(qwizard.questions_cards)),console.log("[process_html2] qwizard.questions_cards.length:",qwizard.questions_cards.length);for(var w=qwizard.questions_cards.length,h=0;h<w;h++)""==qwizard.questions_cards[h]&&console.log("[process_html2] NULL JSON ii:",h)}e=e.replace(/(<[ph][^>]*>\s*)*?\[qwiz[^]*?\[\/qwiz\]/m,(function(){return l}))}else qwizdata[t]={};t++}if(debug[0]&&q.quizzes_questions.length)for(var u=q.quizzes_questions.length,z=0;z<u;z++)console.log("[process_html2] q.quizzes_questions["+z+"]:",q.quizzes_questions[z]);debug[3]&&console.log("[process_html2] htm:",e)}}return debug[0]&&console.log("[process_html2] replace_body:",d),{htm:e,i_qwiz:t,replace_body:d}},this.reset_preview=function(e){$.cookie("qwiz_preview",e,{path:"/"}),window.location=window.location.href},this.process_reg_code=function(e){if(debug[0]&&console.log("[process_reg_code] reg_code:",e),""!=e){var t={reg_code:e};qqc.jjax(qname,0,0,"reg_code_add_to_class",t)}},this.hide_reg_code_error=function(){$("div.qwiz_reg_code_errmsg").html("").hide()},this.init_preview=function(e){const t=$("#qwiz"+e+" div.qwizq");if(preview_min_height&&t.css({"min-height":preview_min_height}),t.addClass("qwizq_preview").on("mouseenter",q.set_i_qwiz_i_question).show(),$("#qwiz"+e).css({border:"none"}),!q.no_intro_b[e]&&!qwizdata[e].use_dataset){var i=$("div.intro-qwiz"+e);i.addClass("qwiz qwizq_preview").show(),i.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this)}))}q.display_summary_and_exit(e),$("#summary-qwiz"+e).addClass("qwiz qwizq_preview").show(),$("#next_button-qwiz"+e).remove();for(var a=qwizdata[e].n_questions,s=0;s<a;s++)q.display_question(e,s,!1);init_preview_questions_active(e),$("figure").css({position:"relative","z-index":2})},this.change_preview_mode=function(e,t){for(var i in debug[0]&&console.log("[change_preview_mode] radio_el:",e),qwizdata[t].$qwizzled)$("div#"+i).replaceWith(qwizdata[t].$qwizzled[i]),$("div#"+i).addClass("qwizq_preview").show(),qwizdata[t].$qwizzled[i]=$("div#"+i).clone(!0);$("div#qwiz"+t+" button.show_the_answer").show(),$("div#qwiz"+t+" div.show_answer_got_it_or_not").hide(),$("div#qwiz"+t+" div.qwiz-feedback").hide(),"questions_active"==(preview_mode=e.value)?init_preview_questions_active(t):init_preview_show_answers(t)},this.set_i_qwiz_i_question=function(){debug[0]&&console.log("[set_i_qwiz_i_question] this:",this);var e=this.id,t=e.match(/qwiz([^-]+)/)[1],i=e.match(/-q(.+)/)[1];qwizdata[t].i_question=i},this.init_qwizzled=function(e,t,i){var a;debug[0]&&console.log("[init_qwizzled] i_qwiz:",t),sibs={};var s=0;e.find("div.qwizzled_canvas .qwizzled_target").each((function(){var e=$
13(this);e.removeClass("ui-draggable ui-draggable-handle"),e.css({"border-style":"dotted","border-color":"gray"});var t=e.attr("class").match(/qtarget_sib-([0-9]+)/);if(t){var i=t[1];sibs[i]?a=sibs[i]:(a="t"+s,sibs[i]=a,s++)}else a="t"+s,s++;e.attr("id",a),e.on("click",(function(e){debug[8]&&console.log("[target clicked] $ (event.target):",$(e.target));var t=$(e.target);t.hasClass("qwizzled_target")&&(t.droppable("option","disabled")||q.label_dropped(t))}))})),e.find("td.qwizzled_labels div.qwizzled_label").each((function(){$(this).on("click",(function(e){if(debug[8]&&console.log("[label clicked] $ (event.target).html ():",$(e.target).html()),ignore_label_click_b)ignore_label_click_b=!1;else{var t,i=(t="div"==e.target.tagName.toLowerCase()?$(e.target):$(e.target).parents("div.qwizzled_label"))[0].id.match(/qwiz([^-]+)/)[1];$label_clicked[i]=t;var a=t.parents("td.qwizzled_labels");a.find(".qwizzled_highlight_label").removeClass("label_click_highlight"),a.find(".qwizzled_label_head").hide(),a.find(".qwizzled_label_head_label_clicked").show(),t.find(".qwizzled_highlight_label").addClass("label_click_highlight"),q.label_dragstart(t,!0)}}))})),e.find("div.qwizzled_canvas div.ui-resizable-handle").remove(),e.find("div.qwizzled_image div.qwizzled_target").css("border-width","2px"),e.find(".qwizzled_highlight_label").css("border","none"),e.find(".qwizzled_highlight_label *").css("word-wrap","normal"),e.find("div.qwizzled_image").each((function(){var e=$
13(this).width(),t=$(this).height();$(this).find("img").attr("width",e).attr("height",t).removeAttr("sizes").removeAttr("srcset")})),q.init_qwizzled2(e,t,i)},this.init_qwizzled2=function(e,t,i){qwizdata[t].$qwizzled||(qwizdata[t].$qwizzled={});var a="qwiz"+t+"-q"+i;qwizdata[t].$qwizzled[a]=e.clone(!0)},this.init_textentry_autocomplete=function(e){debug[6]&&console.log("[init_textentry_autocomplete]"),e.find("input.qwiz_textentry").autocomplete({source:find_matching_terms,close:menu_closed,open:menu_shown,select:q.item_selected}),e.find("input.qwiz_textentry").keyup(menu_closed),e.find("input.qwiz_single_char_entry").keyup(single_char_textentry_keyup)},this.label_dragstart=function(e,t){var i=e[0].id.match(/qwiz([^-]+)/)[1];if(t)debug[8]&&console.log("[label_dragstart] $label_clicked[i_qwiz].html():",$label_clicked[i].html());else{if($label_clicked[i]){$label_clicked[i].find(".qwizzled_highlight_label").removeClass("label_click_highlight");var a=e.parents("td.qwizzled_labels");a.find(".qwizzled_label_head").hide(),a.find(".qwizzled_label_head_standard").show(),$label_clicked[i]=""}$prev_label_clicked[i]=0}if(try_again_obj&&$prev_label_clicked[i]!==$label_clicked[i]){var s=try_again_obj;try_again_obj="",debug[8]&&(console.log("[label_dragstart] $label.html():",e.html()),console.log("[label_dragstart] local_try_again_obj:",s),console.log("[label_dragstart] local_try_again_obj.$label.attr ('id'):",s.$label.attr("id"))),s.$label.find(".qwizzled_highlight_label").css({background:""}),s.$label.find(".qwizzled_highlight_label img").css({outline:""}),s.$label.attr("id")!=e.attr("id")&&(s.$label.animate({left:"0px",top:"0px"},{duration:750}),s.$label.find(".qwizzled_highlight_label").removeClass("label_click_highlight")),s.$feedback.hide(),s.$target.droppable("enable")}$prev_label_clicked[i]=""},this.label_dropped=function(e,t){if(debug[8]&&console.log("[label_dropped]: $target:",e,", $label:",t),t)ignore_label_click_b=!0;else{var i=e.parents("div.qwizq")[0].id.match(/qwiz([^-]+)/)[1];if(!$label_clicked[i])return!1;debug[8]&&console.log("[label_dropped]: $label_clicked[i_qwiz]:",$label_clicked[i]);var a=(t=$label_clicked[i]).parents("td.qwizzled_labels");a.find(".qwizzled_label_head").hide();var s=document_qwiz_mobile?"mobile":"standard";a.find(".qwizzled_label_head_"+s).show()}(o=t.attr("class").match(/qwizzled_n_targets([0-9]*)/))||t.find(".qwizzled_highlight_label").removeClass("label_click_highlight");var _,o=t.attr("class").match(/qtarget_assoc([0-9]+)/);_=o?o[1]:t.data("label_target_id"),debug[8]&&console.log("[label_dropped] $target:",e,", assoc_id:",_);var n="#"+t.attr("id").substr(6),r=n.split("-"),d=r[0]+"-"+r[1],c=(i=r[0].substr(5),r[1].substr(1));if(debug[8]&&console.log("[label_dropped] question_selector:",d),qwizdata[i].record_start_b&&document_qwiz_user_logged_in_b){qwizdata[i].record_start_b=!1;var l={type:"start",confirm:"js"};record_response(i,qwizdata[i].qrecord_id,l,!0)}1!=qwizdata[i].user_question_number||!q.no_intro_b[i]&&1!=qwizdata[i].n_questions||($("div#icon_qwiz"+i).hide(),alert_not_logged_in(i),qwizdata[i].qwiz_timer&&start_timers(i)),qwizdata[i].n_label_attempts++,$("[id^=qwiz"+i+"-q"+c+"-a]").hide();var w="#qwiz"+i+"-q"+c,h=!1;if(qwizdata[i].qrecord_id&&document_qwiz_user_logged_in_b)if(qqc.isInteger(qwizdata[i].dataset_id[c])){if(!qwizdata[i].q_and_a_text[c]){var u,z=$(w+" div.qwizzled_image img").attr("src");
13z?u=z:z="",$(w+" div.qwizzled_label").each((function(){var e=$(this).html();e&&(u+="\t"+e)})),u=qqc.remove_tags_eols(u),qwizdata[i].q_and_a_text[c]=qqc.q_and_a_hash(u),qwizdata[i].q_and_a_crc32[c]=qwiz_crc32($(w).html()),debug[0]&&console.log("[label_dropped] qwizdata[i_qwiz].q_and_a_crc32[i_question]:",qwizdata[i].q_and_a_crc32[c])}}else qwizdata[i].q_and_a_text[c]=qwizdata[i].dataset_id[c],qwizdata[i].q_and_a_crc32[c]="dataset";var m=!1;if(e.hasClass("qwizzled_target-"+_))if(debug[8]&&(console.log("[label_dropped] feedback_selector:",n+"c"),console.log("[label_dropped] qwizdata[i_qwiz].n_questions:",qwizdata[i].n_questions)),$(n+"c").show(),place_label(e,t),qwizdata[i].n_labels_correct++,qwizdata[i].n_labels_correct==qwizdata[i].n_label_targets){m=!0;var p,g=qwizdata[i].n_label_attempts,b=qwizdata[i].n_label_targets;(h=g==b)?p="You placed all of the items correctly on the first try!":(p=(p=plural(T("It took you one try"),T("It took you %s tries"),g)+" "+plural(T("to place this label correctly"),T("to place these labels correctly"),b)+".").replace("%s",qqc.number_to_word(g)),1==qwizdata[i].n_questions&&qwizdata[i].repeat_incorrect_b&&(p+="<br />Re-do those you did not label correctly ",qwizdata[i].qrecord_id&&document_qwiz_user_logged_in_b&&(p+="to get this question marked “correct” "),p+='<button class="qwiz_button" onclick="qwiz_.next_question ('+i+', true)">
13Re-do</button>',q.qwizard_b||(qwizdata[i].answered_correctly[c]=-1))),$(w+"-ff").html(p).show(),qwizdata[i].n_questions>1||qwizdata[i].combo||qwizdata[i].use_dataset?(q.qwizard_b||(qwizdata[i].answered_correctly[c]=h?1:-1,h?(qwizdata[i].n_correct++,qwizdata[i].n_qs_done&&qwizdata[i].n_qs_done.add(qwizdata[i].dataset_id[c])):qwizdata[i].n_incorrect++,update_topic_statistics(i,c,h)),update_progress_show_next(i)):q.display_diagram_progress(i),update_progress_show_next(i)}else{var f=e.attr("id");void 0===qwizdata[i].correct_on_try1[c]&&(qwizdata[i].correct_on_try1[c]={}),qwizdata[i].correct_on_try1[c][f]||(qwizdata[i].correct_on_try1[c][f]=1),q.display_diagram_progress(i)}else{if(debug[8]&&(console.log("[label_dropped] feedback_selector:",n+"x"),console.log("[label_dropped] qwizdata[i_qwiz].n_questions:",qwizdata[i].n_questions)),$label_clicked[i]){var v=e.offset(),y=v.left,x=v.top,k=$label_clicked[i].data("label_x"),A=$label_clicked[i].data("label_y");debug[8]&&(console.log("[label_dropped] target_x:",y,", target_y:",x),console.log("[label_dropped] label_x:",k,", label_y:",A)),t.css({left:y-k+"px",top:x-A+"px"}),$label_clicked[i]=""}t.find(".qwizzled_highlight_label").css({background:"#FF8080"}),t.find(".qwizzled_highlight_label img").css({outline:"2px solid #FF8080"});var C=$(n+"x");C.show(),try_again_obj={$label:t,$feedback:C,$target:e},e.droppable("disable");f=e.attr("id");void 0===qwizdata[i].correct_on_try1[c]&&(qwizdata[i].correct_on_try1[c]={}),qwizdata[i].correct_on_try1[c][f]=-1}if(qwizdata[i].qrecord_id&&document_qwiz_user_logged_in_b){var I=t.find("span.qwizzled_highlight_label").html();I=qqc.remove_tags_eols(I);var O=e.attr("class").match(/qwizzled_target-([0-9]*)/)[1],j=$(w).find("div.qtarget_assoc"+O).find("span.qwizzled_highlight_label").html();j||(j=$(w).find('div.qwizzled_label[data-label_target_id="'+O+'"]').find("span.qwizzled_highlight_label").html()),j=qqc.remove_tags_eols(j);l={q_and_a_text:btoa(encodeURIComponent(qwizdata[i].q_and_a_text[c])),q_and_a_crc32:qwizdata[i].q_and_a_crc32[c],i_question:qwizdata[i].dataset_id[c],unit:qwizdata[i].unit[c],level:qwizdata[i].level[c],type:"labeled_diagram",response:I+"\t"+j,correct_b:"",confirm:"js"};if(record_response(i,qwizdata[i].qrecord_id,l),m){l={q_and_a_text:btoa(encodeURIComponent(qwizdata[i].q_and_a_text[c])),q_and_a_crc32:qwizdata[i].q_and_a_crc32[c],i_question:qwizdata[i].dataset_id[c],unit:qwizdata[i].unit[c],level:qwizdata[i].level[c],type:"labeled_diagram",response:"done",correct_b:h?1:"",confirm:"js"};setTimeout((function(){record_response(i,qwizdata[i].qrecord_id,l,!0)}),500)}}},this.process_qwiz_pair=function(e,t,i,a,s){q.qwizard_b=i,"undefined"!=typeof qwizard&&(qw=qwizard),a?(n_qwizzes=1,set_qwizard_data_b=!0,q.no_intro_b=[],debug[0]&&console.log("[process_qwiz_pair] htm.substr (0, 2000):",e.substr(0,2e3))):set_qwizard_data_b=!1,qwizdata[t]={},qwizdata[t].questions=[],qwizdata[t].answered_correctly=[],qwizdata[t].i_questions_done=[],qwizdata[t].n_correct=0,qwizdata[t].n_incorrect=0,qwizdata[t].i_question=-1,qwizdata[t].i_user_question=-1,qwizdata[t].ii_question=0,qwizdata[t].user_question_number=0,qwizdata[t].initial_width=500,qwizdata[t].hangman={},qwizdata[t].use_dataset="",qwizdata[t].dataset_id={},qwizdata[t].use_dataset_question_ids={},qwizdata[t].bg_img={},qwizdata[t].align="",qwizdata[t].qrecord_id="",qwizdata[t].information_question_b={},qwizdata[t].unit=[],qwizdata[t].level=[],qwizdata[t].parts_htm={},qwizdata[t].hotspot_user_interaction={},qwizdata[t].hotspot_labels_stick={},qwizdata[t].show_hotspots={},qwizdata[t].find_the_dot={},qwizdata[t].ctx={},qwizdata[t].current_xy_hotspot_no={};var _=(F=e.match(/\[qwiz([^\]]*)\]/m))[0],o=F[1];_=qqc.replace_smart_quotes(_),o=qqc.replace_smart_quotes(o),debug[0]&&(console.log("[process_qwiz_pair] qwiz_tag: ",_),console.log("[process_qwiz_pair] attributes: ",o)),set_qwizard_data_b&&qw.set_qwizard_data("qwiz_deck_attributes",o);var n=!1;qwizdata[t].icon_swhs=!1,qwizdata[t].summary_b="false"!=get_attr(o,"summary");const r="true"==get_attr(o,"random");qwizdata[t].random_b=r,q.qwizard_b&&(qwizdata[t].attr_random_b=r);const d=get_attr(o,"reshow_after");d&&(qwizdata[t].reshow_after=d);var c,l=get_attr(o,"use_dataset",!0);(l||(c=get_attr(o,"dataset",!0))&&(regular_page_f?l=c:qwizdata[t].dataset=c),l||c)&&("true"==get_attr(o,"combo")&&(qwizdata[t].combo=!0,qwizdata[t].dataset_labels=get_attr(o,"dataset_labels"),qwizdata[t].dataset_label_info=get_attr(o,"dataset_label_info")));if(l){qwizdata[t].use_dataset=l;var w=get_attr(o,"dataset_intro");
13w&&"true"!=w?"false"==w&&(w=!1):w=!0,qwizdata[t].dataset_intro_f=w;var h="false"!=get_attr(o,"spaced_repetition");if(qwizdata[t].dataset_questions_to_do=h?"spaced_repetition":"all",w){const e=get_attr(o,"default_max_to_practice");e&&(qwizdata[t].default_max_to_practice=parseInt(e))}if(F=_.match(/\sstyle\s*=\s*"[^"]+"/gm))for(var u=F.length,z=0;z<u;z++){var m=encodeURIComponent(F[z]);_=_.replace(F[z],m)}var p=get_attr(_,"display_name");if(p){qwizdata[t].use_dataset_options_display_name=decodeURIComponent(p);_=_.replace(/\sdisplay_name\s*=\s*"[^"]*?"/,"")}_=decodeURIComponent(_)}const g=parseInt(get_attr(o,"questions_to_show"));qqc.isInteger(g)&&g>0&&(qwizdata[t].questions_to_show=g);var b=get_attr(o,"repeat_incorrect");qwizdata[t].repeat_incorrect_b="false"!=b,debug[0]&&console.log("[process_qwiz_pair] repeat_incorrect_value:",b,", repeat_incorrect_b:",qwizdata[t].repeat_incorrect_b);var f=get_attr(o,"align");"center"!=f&&"right"!=f&&"tiled"!=f||(qwizdata[t].align=f,"tiled"==f&&(qwizdata[t].spacing=20));var v=parseInt(get_attr(o,"spacing"));qqc.isInteger(v)&&(qwizdata[t].spacing=v),qwizdata[t].hide_forward_back_b="true"==get_attr(o,"hide_forward_back"),qwizdata[t].hide_progress_b="true"==get_attr(o,"hide_progress"),qwizdata[t].hide_qwizcards_icon_b="true"==get_attr(o,"hide_qwizcards_icon");const y=get_attr(o,"mc_style");y&&(qwizdata[t].mc_style=y);var x=get_attr(o,"mobile_enabled");x||(x=document_qwiz_mobile_enabled),qwizdata[t].mobile_enabled=x;var k=get_attr(o,"qrecord_id",!0);if(k){if(qwizdata[t].combo){var $=k.split("; ");qwizdata[t].combo_qrecord_id=$[0]}qwizdata[t].qrecord_id=k,qwizdata[t].q_and_a_text={},qwizdata[t].q_and_a_crc32={};const e=get_attr(o,"display_pay_screen");if(e&&"false"!=e){qwizdata[t].display_pay_screen=e;const i=get_attr(o,"immediate_payment");i&&"false"!=i&&(qwizdata[t].immediate_payment=!0)}q.qrecord_b||(q.qrecord_b=!0,"undefined"!=typeof document_qwiz_user_logged_in_b&&"not ready"!=document_qwiz_user_logged_in_b||qqc.check_session_id(t,/register/.test(e)))}if(q.qwizard_b||set_qwizard_data_b){const e=!!get_attr(o,"dataset");q.dataset_b=e,set_qwizard_data_b&&(qw.questions_cards_dataset_b=e)}const A=get_attr(o,"question_time_limit");A&&(qwizdata[t].question_time_limit=parseInt(A));const C="true"==get_attr(o,"quiz_timer");C&&(qwizdata[t].qwiz_timer=C);var I=get_attr(o,"unit");I?(qwizdata[t].default_unit=I.replace(/\s/g,"_"),set_qwizard_data_b&&qw.set_qwizard_data("default_unit",I)):qwizdata[t].default_unit="null";"true"==get_attr(o,"generative_feedback")&&(qwizdata[t].generative_feedback=!0);const O=get_attr(o,"prompt_intro");O&&(qwizdata[t].default_prompt_intro=O);const j=get_attr(o,"prompt_intro_add");j&&(qwizdata[t].default_prompt_intro_add=j);const S=get_attr(o,"hint_prompt_intro");S&&(qwizdata[t].default_hint_prompt_intro=S);const E=get_attr(o,"prompt_for_question");E&&(qwizdata[t].default_prompt_for_question=E);const M=get_attr(o,"prompt_for_response");M&&(qwizdata[t].default_prompt_for_response=M);const R=get_attr(o,"hint_prompt_for_response");R&&(qwizdata[t].default_hint_prompt_for_response=R);const Y=get_attr(o,"response_min_chars");Y&&(qwizdata[t].default_response_min_chars=Y);const B=get_attr(o,"prompt_for_feedback");B&&(qwizdata[t].default_prompt_for_feedback=B);const N=get_attr(o,"temperature");N&&(qwizdata[t].default_temperature=N);"true"==get_attr(o,"random_mc")&&(qwizdata[t].default_random_mc=!0);var F,L="",W=!1;if(F=e.match(/\[qwiz[^\]]*\]((<\/[^>]+>\s*)*)/m,"")){var G=F[1];debug[0]&&console.log("[process_qwiz_pair] initial_closing_tags: ",G)}e=(e=e.replace(/\[qwiz[^\]]*\]((<\/[^>]+>\s*)*)/m,"")).replace(/(<(p|h[1-6]|span)[^>]*>)*\[\/qwiz\]$/,"");var D=(F=(e=qqc.trim(e)).match(/\[(q|<code><\/code>q)([^\]]*)\]/gm))?F.length:0;if(l||c||q.qwizard_b||0!=D){e=qqc.process_inline_textentry_terms(e,"terms",qwizdata,t),errmsgs=errmsgs.concat(qwizdata.additional_errmsgs),e=qqc.process_inline_textentry_terms(e,"add_terms",qwizdata,t),errmsgs=errmsgs.concat(qwizdata.additional_errmsgs);var Q=qqc.parse_html_block(e.substr(0,2e3),["^"],["[h]","[i]","[q]","[q "],"[<code></code>q","return whitespace");Q&&(e=e.replace(Q,"")),e=process_header(e,t,0,!0),set_qwizard_data_b&&"NA"!=header_html&&qw.set_qwizard_data("header_text",header_html);var P=qqc.parse_html_block(e.substr(0,5e3),["[i]"],["[q]","[q ","[<code></code>q",'<div class="qwizzled_question',"[x]"]);if("NA"==P)""==(P=qqc.parse_html_block(e.substr(0,5e3),["^"],["[q]","[q ","[<code></code>q",'<div class="qwizzled_question',"[x]"],!0))&&(l?P="<br /><br /><br />":W=!0);else{var U=e.substr(0,200);U=qqc.trim(U);var Z=qqc.opening_tag_shortcode_pos("[i]",U);U=U.substr(Z,5);var H=P.replace(/<br[^>]*>/g,"");U!=(H=qqc.trim(H).substr(0,5))&&errmsgs.push(T("Text before intro")+" [i]. qwiz: "+(t+1)),P=P.replace("[i]",""),P=qqc.balance_closing_tag(P)}q.qwizard_b&&(P=qqc.shortcodes_to_video_elements(P)),(!W||q.qwizard_b||qwizdata[t].question_time_limit)&&(debug[0]&&console.log("[process_qwiz_pair] intro_html:",P),L+='<div class="intro-qwiz'+t+' qwiz-intro qwiz_editable">'+qqc.decode_image_tags(P)+"</div>\n"),set_qwizard_data_b&&(intro_hmtl=qqc.remove_empty_opening_tags(P),qw.set_qwizard_data("intro_text",P));var V=qqc.parse_html_block(e,["[x]"],[]);if("NA"!=V)if(-1!=(V=V.replace(/\[x\]/,"")).search(/\[q[ \]]|<div class="qwizzled_question/))errmsgs.push("[x] "+T("(exit text) must be last")+". qwiz: "+(t+1));else{var J=qqc.opening_tag_shortcode_pos("[x]",e);e=e.substr(0,J)}else V="";if(set_qwizard_data_b){var X=qqc.shortcodes_to_video_elements(V);X=qqc.remove_empty_opening_tags(X),qw.set_qwizard_data("exit_text",X)}
13if(l||-1!=e.search(/use_dataset_question\s*=\s*/)&&(n=!0,qwizdata[t].use_dataset_questions_htm=e),l||n&&!s)s&&(qwizard.questions_cards_dataset_b=!1),L+='<div id="dataset_questions-qwiz'+t+'"></div>';else if(0==D)qwizdata[t].n_questions=0,L+='<div id="qwiz'+t+'-q-1" class="qwizq"></div>';else{qwizdata[t].n_questions=D;const i=qwizdata[t].questions_to_show;i&&i<D?(qwizdata[t].n_questions_for_done=i,qwizdata[t].random_b=!0):qwizdata[t].n_questions_for_done=D,L=q.process_questions(e,L,t,void 0,void 0,s)}}else errmsgs.push(T('Did not find question tags ("[q]")')+". qwiz: "+(t+1)),header_html="";return q.no_intro_b[t]=W&&!qwizdata[t].question_time_limit,L=create_qwiz_divs(t,_,L,V),void 0!==q.qwizard_b&&"undefined"!=typeof qwizard&&(qwizard.errmsgs=errmsgs),L},this.process_questions=function(e,t,i,a,s,_,o){s&&(qw=qwizard,n_qwizzes=1,set_qwizard_data_b=!0,q.qwizard_b=!0),number_first_question=void 0!==a?a:0,set_qwizard_data_b||-1!=e.indexOf("[!")&&(e=e.replace(/\[!+\][^]*?\[\/!+\]/gm,""));var n=e.match(/(\[q [^\]]*\]|<div class="qwizzled_question|\[q\])[^]*/m)[0],r=n.match(/\[(<code><\/code>)*(q\]|q\s+[^\]]*\])/gm);(debug[4]||debug[11])&&console.log("[process_questions] question_shortcodes: ",r),n_questions=r.length,qwizdata[i].question_topics=new Array(n_questions),o&&(qwizdata[i].question_qrecord_ids=o),q.qwizard_b&&(qwizdata[i].qwizard_multiple_choice_b=[]),qwizdata[i].units=[],qwizdata[i].topics=[],qwizdata[i].levels=[];for(var d=e.match(/(<[^\/][^>]*>\s*)*?(\[q[ \]]|\[<code><\/code>q)/gm),c=[],l=d.length,w=0;w<l;w++){var h=d[w];h=(h=h.replace(/\[q[ \]]|\[<code><\/code>q/gm,"")).replace(/[^]*<(img|input)[^>]+>/,""),c.push(h)}(debug[0]||debug[11])&&(console.log("[process_questions] q_opening_tags: ",c),console.log("[process_questions] question_html: ",n));var u="[q"!=n.substr(0,2);if(u)n=n.replace(/<div class="qwizzled_question[^>]*>/,"");else{var z=n.indexOf("]")+1;n=n.substr(z)}var m=n.split(/<div class="qwizzled_question[^_][^>]*>/);(debug[0]||debug[11])&&console.log("[process_questions] qwizzled_pieces.length:",m.length);var p=[];if(1==m.length){var g=n.split(/(?:(?:<(?:p|h[1-6]|span|em|strong|code)[^>]*|<i|<b)>(?:\s| )*)*?(?:\[q [^\]]*\]|\[<code><\/code>q [^\]]*\]|\[q\]|\[<code><\/code>q\])/);(debug[0]||debug[11])&&console.log("[process_questions] q_split:",g);var b=0;u&&(p.push(g[0]+"[q]"+g[1]),b=2);for(var f=b;f<g.length;f++)p.push(g[f])}else if(m.length>1)if(u)for(var v=0;v<m.length;v++){g=m[v].split(/\[q [^\]]*\]|\[<code><\/code>q [^\]]*\]|\[q\]|\[<code><\/code>q\]/);p.push(g[0]+"[q]"+g[1]);for(f=2;f<g.length;f++)p.push(g[f])}else{for(g=m[0].split(/\[q [^\]]*\]|\[q\]/),f=0;f<g.length;f++)p.push(g[f]);for(v=1;v<m.length;v++){g=m[v].split(/\[q [^\]]*\]|\[<code><\/code>q [^\]]*\]|\[q\]|\[<code><\/code>q\]/);p.push(g[0]+"[q]"+g[1]);for(f=2;f<g.length;f++)p.push(g[f])}}if(set_qwizard_data_b&&void 0===a&&qw.set_qwizard_data("n_questions",n_questions),!q.qwizard_b){qwizdata[i].n_questions=n_questions;const e=qwizdata[i].questions_to_show;e&&e<n_questions?(qwizdata[i].n_questions_for_done=e,qwizdata[i].random_b=!0):qwizdata[i].n_questions_for_done=n_questions}(debug[0]||debug[11])&&(console.log("[process_questions] n_questions:",n_questions),console.log("[process_questions] questions_html:",p.join("\n================================================\n")));for(var y,x=[],k=!1,$=0;$<n_questions;$++){var A,C=$+number_first_question;if(A=void 0!==a?r[0]:r[C],question_topic=process_question_attributes(i,C,A,a),question_topic&&(k=!0),-1!=p[$].indexOf("[hangman")||-1!=p[$].indexOf("hangman_img_wrapper"))y=process_hangman(i,C,p[$],c[$]);else if(-1!=p[$].indexOf("[textentry"))y=process_textentry(i,C,p[$],c[$]);else if(-1!=p[$].search(/\[c\]|\[c\*\]/m))y=process_multiple_choice(i,C,p[$],c[$]);else if(-1!=p[$].indexOf("hotspot_image_stack"))qwizdata[i].hotspot_b=!0,y=process_hotspot_diagram(i,C,p[$],c[$],_);else if(-1!=p[$].search(/<div[^>]+class=".*?qwizzled_label/m))qwizzled_b=!0,qwizdata[i].qwizzled_b=!0,y=process_qwizzled(i,C,p[$],c[$],r[$]),qwizdata[i].correct_on_try1?qwizdata[i].correct_on_try1[C]={}:qwizdata[i].correct_on_try1=[];else{var I=p[$],O=I.replace(/<[^>]+>| |\s/gm,"");if(O||-1!=I.indexOf("img")&&(O=!0),O){const e=I.indexOf("[f]");var j;if(-1!=e&&(errmsgs.push(T("Question appears to be information-only, but feeedback ([f]) was provided")+". qwiz: "+(i+1)+", "+T("question")+" "+(C+1)),q.wordpress_page_f&&(I=cvt_feedback(I,e))),qwizdata[i].information_question_b[C]=!0,qwizdata[i].qrecord_id)qqc.isInteger(qwizdata[i].dataset_id[C])?(j=qqc.remove_tags_eols(I),qwizdata[i].q_and_a_text[C]=qqc.q_and_a_hash(j),qwizdata[i].q_and_a_crc32[C]=qwiz_crc32(p[$])):(qwizdata[i].q_and_a_text[C]=qwizdata[i].dataset_id[C],qwizdata[i].q_and_a_crc32[C]="dataset")}else qwizdata[i].use_dataset_question_ids[C]||errmsgs.push(T("Question is completely blank")+". qwiz: "+(i+1)+", "+T("question")+" "+(C+1));set_qwizard_data_b&&(qw.questions_cards[C].type="information_only",I=qqc.shortcodes_to_video_elements(I),qw.questions_cards[C].question_text=c[$]+I),y='<div id="qwiz'+i+"-q"+C+'" class="qwizq"'+create_bg_img_style(i,C)+'>\n<div class="qwiz-question qwiz_editable">
13'+c[$]+I+"</div></div>"}x.push(y)}t+=x.join("\n");const S=Object.values(qwizdata[i].dataset_id);if(S.length>1){S.sort();const e=S.length;for(var E=!1,M=1;M<e;M++)S[M]==S[M-1]&&(errmsgs.push(T("Duplicate")+" dataset_id: "+S[M]+". qwiz: "+(i+1)),E=!0);E&&errmsgs.push(T('Please delete the duplicate dataset_id="..." attribute(s); new IDs will be created'))}return k&&debug[4]&&console.log("[process_questions] topics: "+qwizdata[i].topics.join("; ")),set_qwizard_data_b&&(qw.unit_names=qwizdata[i].units,qw.level_names=qwizdata[i].levels),qwizdata[i].topics.length&&(check_questions_have_topics(i),set_qwizard_data_b&&(qw.topic_names=qwizdata[i].topics)),(debug[3]||debug[11])&&console.log("[process_questions] new_htm: ",t),debug[12]&&console.log("[process_questions] errmsgs: ",errmsgs.join("\n")),t},this.qwiz_password_focus=function(e,t){e.qwiz_pw="",e.value="",$("#qwiz_login-qwiz"+t+" p.login_error").hide()},this.restart_quiz=function(e){var t=$("#summary-qwiz"+e);for(var i in t.hide(),t.find("button.summary_exit_mobile_qwiz").hide(),$("#qwiz"+e+" div.show_answer_got_it_or_not").hide(),1==qwizdata[e].n_questions&&$("#qwiz"+e+" div.single-question_exit").hide(),q.reset_counters(e),qwizdata[e].hotspot_user_interaction={},qwizdata[e].use_dataset&&(qwizdata[e].information_question_b={},qwizdata[e].hangman={},qwizdata[e].textentry=""),q.display_progress(e),qwizdata[e].$qwizzled)$("div#"+i).replaceWith(qwizdata[e].$qwizzled[i]),qwizdata[e].$qwizzled[i]=$("div#"+i).clone(!0);if(qwizdata[e].qwizzled_b&&(qwizdata[e].correct_on_try1=[]),$("#qwiz"+e).find("div.qwizq").hide(),qwizdata[e].hide_forward_back_b||($(".bbfe-qwiz"+e).css({visibility:"visible",opacity:.2}).removeClass("hover"),$("span.question-number-qwiz"+e).css({visibility:"visible"}).html(1)),$("span.response_recorded_wrapper-qwiz"+e).css({display:"none"}),!qwizdata[e].qwiz_timer||qwizdata[e].n_qs_done&&0!=qwizdata[e].n_qs_done.size||qwizdata[e].$qwiz_timer.html("0:00"),qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b){qwizdata[e].record_start_b=!1;record_response(e,qwizdata[e].qrecord_id,{type:"start",confirm:"js"},!0)}q.init_question_order(e),q.next_question(e,!0)},this.reset_counters=function(e){const t=qwizdata[e].n_questions;for(var i=0;i<t;i++)qwizdata[e].answered_correctly[i]=0,qwizdata[e].i_questions_done=[],qwizdata[e].questions[i]={};qwizdata[e].n_correct=0,qwizdata[e].n_incorrect=0,qwizdata[e].hotspot_user_interaction={};for(var a=qwizdata[e].topics.length,s=0;s<a;s++){var _=qwizdata[e].topics[s];qwizdata[e].topic_statistics[_].n_correct=0,qwizdata[e].topic_statistics[_].n_incorrect=0}qwizdata[e].i_question=-1,qwizdata[e].i_user_question=-1,qwizdata[e].ii_question=0,qwizdata[e].user_question_number=0},this.record_quiz_time_callback=function(e){let t=e.i_qwiz;e.errmsg?(alert(e.errmsg),qwizdata[t].when_done_unix=0):(qwizdata[t].quiz_elapsed_time_id=e.quiz_elapsed_time_id,qwizdata[t].when_done_unix=e.when_done_unix)},this.redo_question=function(e){1==qwizdata[e].n_questions&&$("#qwiz"+e+" div.single-question_exit").hide(),qwizdata[e].i_question=qwizdata[e].i_question-1,qwizdata[e].answered_correctly[0]=0,qwizdata[e].n_correct=0,q.next_question(e,!0)},this.next_question=function(e,t,i,a){if(debug[0]&&console.log("[next_question] qwizdata[i_qwiz].i_question:",qwizdata[e].i_question),qwizdata[e].bck_f)return void q.fwd_question(e,!1);const s=$("div#overlay-times-up-qwiz"+e);s.is(":visible")&&s.hide();var _=qwizdata[e].i_question;if(-1!=_&&qwizdata[e].combo&&!a)return void qqc.combo_next("Q",e,qwizdata[e].combo_i_deck);-1==_&&(qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f||$(".bbfe-qwiz"+e).css({visibility:"visible",opacity:.2}).removeClass("hover"));const o=qwizdata[e].n_questions;debug[0]&&console.log("[next_question] i_question: ",_,", n_questions: ",o);var n="qwiz"+e,r=$("#"+n);document_qwiz_mobile?r.css("width",""):qwizdata[e].width_reset&&($("#xqwiz"+e).length?r.css({width:qwizdata[e].initial_width+"px","max-width":"","margin-bottom":""}):r.css({width:"","max-width":""}),r.css({transform:""}),r[0].qscale_fac="",r[0].qstart_left="",r[0].qstart_top="",qwizdata[e].width_reset=!1);var d=!1;if(i=!!i,-1!=_||i){var c=n+"-q"+_;if($("#"+c).hide(),document_qwiz_mobile&&$("#mobile_"+c).hide(),qwizdata[e].pay_quiz_deck_id&&("preview_questions"==qwizdata[e].pay_quiz_ok||"preview_period_expired"==qwizdata[e].pay_quiz_ok||"no_free_trial"==qwizdata[e].pay_quiz_ok)&&qqc.preview_limit("qwiz",qwizdata,e))return}else if(qwizdata[e].use_dataset||qwizdata[e].use_dataset_questions_htm||qwizdata[e].combo||o>1||q.qwizard_b){var l=-1;if(!q.no_intro_b[e]||qwizdata[e].use_dataset_questions_htm){if(d=!0,!t&&!q.qwizard_b&&qwizdata[e].qrecord_id){const t="undefined"!=typeof document_qwiz_user_logged_in_b&&document_qwiz_user_logged_in_b&&"undefined"!=typeof document_qwiz_username;if(!(t||"undefined"!=typeof document_qwiz_declined_login_b&&document_qwiz_declined_login_b))return q.display_login(e),!1;if(t&!document_qwiz_wp_user_session_id){var w=!0;if(!$.cookie("qwiz_current_login_lt_nmin_ago")){w=!1;var h="";if(document_qwiz_team_b&&(h=" "+T("a team")+":"),confirm(T("You are logged in as")+h+" "+document_qwiz_username+".\n"+T('Do you want to continue? (Click "Cancel" to sign out)'))){var u={path:"/",expires:qqc.get_qwiz_param("login_timeout_min",40)/1440};$.cookie("qwiz_current_login_lt_nmin_ago",1,u)}else qqc.sign_out(),document_qwiz_user_logged_in_b=!1}if(w&&document_qwiz_team_b&&!confirm(T("You are logged in as team")+": "+document_qwiz_username+".\n"+T("Do you want to continue as this team?"))){document_qwiz_session_id=document_qwiz_session_id.split(";")[0],document_qwiz_username=document_qwiz_username.split("; ")[0],document_qwiz_team_b=!1,qqc.set_user_menus_and_icons();var z=T("OK. Only %s is logged in now");z=z.replace("%s",document_qwiz_username),alert(z)}if(qwizdata[e].record_start_b=!1,document_qwiz_user_logged_in_b){var m={type:"start",confirm:"js"};record_response(e,qwizdata[e].qrecord_id,m,!0)}}}if(qwizdata[e].use_dataset||qwizdata[e].use_dataset_questions_htm){d&&qqc.is_mobile(qwizdata[e].mobile_enabled)&&q.go_mobile(e);var p=qwizdata[e].dataset_intro_f;if(p&&"topics_only"!=p)q.display_login(e,!1,"use_dataset_options");else{if($(".intro-qwiz"+e).hide(),qwizdata[e].use_dataset)var[g,b,f]=qqc.parse_use_dataset(qwizdata[e].use_dataset);else var b=[],f=[];qqc.get_dataset_questions(g,qname,e,qwizdata[e].qrecord_id,b,f,1e4,qwizdata[e].dataset_questions_to_do,!1,qwizdata[e].use_dataset_questions_htm),l=0}}}else q.no_intro_b[e]&&qwizdata[e].qwiz_timer&&start_timers(e);qwizdata[e].use_dataset||qwizdata[e].use_dataset_questions_htm||q.next_question_from_intro(e,l)}else $("#mode-"+n).css("visibility","hidden");if(0!=o){if(next_button_active_b||($("#next_button-"+n).hide(),qwizdata[e].next_button_show_b=!1),-1!=_||i){const t=qwizdata[e].hotspot_user_interaction[_],i=t&&"info_only"==t;if((qwizdata[e].information_question_b[_]||i)&&($("#next_button_text-qwiz"+e).html(T("Next question")),!q.qwizard_b)){qwizdata[e].answered_correctly[_]=1,qwizdata[e].n_correct++,qwizdata[e].n_qs_done&&qwizdata[e].n_qs_done.add(qwizdata[e].dataset_id[_]),q.display_progress(e),1!=qwizdata[e].user_question_number||!q.no_intro_b[e]&&1!=qwizdata[e].n_questions||($("div#icon_qwiz"+e).hide(),alert_not_logged_in(e),qwizdata[e].qwiz_timer&&start_timers(e));if(qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b){m={q_and_a_text:btoa(encodeURIComponent(qwizdata[e].q_and_a_text[_])),q_and_a_crc32:qwizdata[e].q_and_a_crc32[_],i_question:qwizdata[e].dataset_id[_],unit:qwizdata[e].unit[_],level:qwizdata[e].level[_],type:"information_only",response:"continue",correct_b:1,confirm:"js"};record_response(e,qwizdata[e].qrecord_id,m)}}}if(next_button_active_b&&qwizdata[e].user_question_number==o)q.display_summary_and_exit(e);else if(!qwizdata[e].use_dataset||-1!=_||i&&!q.qwizard_b){var v=qwizdata[e].n_correct;qwizdata[e].repeat_incorrect_b||(v+=qwizdata[e].n_incorrect);var y=qwizdata[e].n_questions_for_done;if(debug[0]&&console.log("[next_question] n_done:",v,", n_questions:",o,", n_questions_for_done:",y),v>=y){-1==qwizdata[e].i_user_question&&(qwizdata[e].i_question=0,qwizdata[e].i_user_question=0);l=qwizdata[e].i_user_question;qwizdata[e].questions[o]={i_user_prev_question:l,user_question_number:"--"},qwizdata[e].questions[l].i_user_next_question=o,qwizdata[e].i_user_question=o,qwizdata[e].saved_i_question=o,$("span.question-number-qwiz"+e).html("--"),qwizdata[e].qwiz_timer&&(qwizdata[e].n_qs&&qwizdata[e].n_qs_done.size==qwizdata[e].n_qs&&(qwizdata[e].n_qs_done=new Set),stop_timer(e)),stop_timer(e,!0,!0),qwizdata[e].$question_timer&&qwizdata[e].$question_timer.hide(),q.display_summary_and_exit(e)}else{if(q.qwizard_b)qwizdata[e].i_question++,_=qwizdata[e].i_question;else{var x;const t=qwizdata[e].reshow_after;for(;;){if((x=qwizdata[e].ii_question)>=qwizdata[e].n_questions_for_done&&(x=0,qwizdata[e].ii_question=0),_=qwizdata[e].question_order[x],qwizdata[e].repeat_incorrect_b){if(1!=qwizdata[e].answered_correctly[_]){var k=!1;if(t){const i=qwizdata[e].i_questions_done,a=i.length-t;if(a>=0){const t=i[a];1!=qwizdata[e].answered_correctly[t]&&(k=!0,_=t)}}qwizdata[e].i_questions_done.push(_),k||qwizdata[e].ii_question++;break}}else if(void 0===qwizdata[e].answered_correctly[_]||0==qwizdata[e].answered_correctly[_]){qwizdata[e].ii_question++;break}qwizdata[e].ii_question++}}var A=qwizdata[e].i_user_question;qwizdata[e].i_question=_,void 0===qwizdata[e].questions[_]&&(qwizdata[e].questions[_]={});var C=qwizdata[e].questions[_];if(A!=C.i_user_prev_question&&(C.i_user_prev_question=A),-1==A)qwizdata[e].i_first_user_question=_,debug[0]&&console.log("[next_question] i_first_user_question:",_);else{var I=qwizdata[e].questions[A];I?I.i_user_next_question=_:debug[0]&&console.log("[next_question] prev_question for i_prev_question",A,"does not exist"),q.qwizard_b||$(".bck-question-qwiz"+e).css({opacity:.5}).addClass("hover")}qwizdata[e].i_user_question=_,void 0===C.user_question_number&&(qwizdata[e].user_question_number++,C.user_question_number=qwizdata[e].user_question_number),q.qwizard_b||$("span.question-number-qwiz"+e).html(C.user_question_number),q.display_question(e,_,d),q.qwizard_b&&o&&(qwizard.set_qwizard_data("i_question",_),qwizard.go_to_question2(),"hotspot_diagram"!=qw.questions_cards[_].type&&q.display_progress(e))}}}else debug[0]&&console.log("[next_question] n_questions:",o)},this.next_question_from_intro=function(e,t){qwizdata[e].n_questions&&($(".intro-qwiz"+e).hide(),q.no_intro_b[e]||($("#icon_qwiz"+e).hide(),qwizdata[e].qwiz_timer&&(qwizdata[e].n_qs&&(qwizdata[e].n_qs_done||(qwizdata[e].n_qs_done=new Set)),start_timers(e))),$(".bbfe-qwiz"+e).css({visibility:"visible",opacity:.2}).removeClass("hover"),$("span.question-number-qwiz"+e).html(1),$("#next_button-qwiz"+e).css("text-align","left"),qwizdata[e].use_dataset||qwizdata[e].use_dataset_questions_htm||q.display_progress(e,!0),$("#next_button_text-qwiz"+e).html(T("Next question")))},this.bck_question=function(e,t){if(debug[0]&&console.log("[bck_question] i_qwiz:",e),$(".bck-question-qwiz"+e).hasClass("hover")){qwizdata[e].bck_f=!0;var i=qwizdata[e].i_user_question,a=i;if(t){if(qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f)return qwizdata[e].saved_i_question=qwizdata[e].i_question,$(".bck-question-qwiz"+e).css({opacity:.2}).removeClass("hover"),$(".fwd-question-qwiz"+e).css({opacity:.5}).addClass("hover"),$("span.question-number-qwiz"+e).html("--"),hide_current_question(e,a),i==qwizdata[e].n_questions&&$("div#summary-qwiz"+e).hide(),qwizdata[e].i_question=-1,void q.display_login(e,!1,"use_dataset_options");
13i=qwizdata[e].i_first_user_question}else if(-1==(i=qwizdata[e].questions[i].i_user_prev_question))return;hide_current_question(e,a),$("div#summary-qwiz"+e).hide(),qwizdata[e].i_user_question=i;var s=qwizdata[e].questions[i];if(t||-1==s.i_user_prev_question){var _=$(".bck-question-qwiz"+e);qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f&&(_=_.last()),_.css({opacity:.2}).removeClass("hover")}var o=s.user_question_number;$("span.question-number-qwiz"+e).html(o),$(".fwd-question-qwiz"+e).css({opacity:.5}).addClass("hover"),qwizq_id="qwiz"+e+"-q"+i,document_qwiz_mobile?$(`div#mobile_${qwizq_id}, div.mobile_${qwizq_id}`).show():$(`div#${qwizq_id}, div.${qwizq_id}`).show(),$(`div.${qwizq_id}-a0_gen`).show(),$("#next_button-qwiz"+e).hide()}},this.fwd_question=function(e,t){if($(".fwd-question-qwiz"+e).hasClass("hover")){if(-1==qwizdata[e].i_question)$("#qwiz_login-qwiz"+e).hide();else{var i=qwizdata[e].i_user_question,a="qwiz"+e+"-q"+i;$(`div#${a}, div.${a}`).hide(),$(`div#mobile_${a}, div.mobile_${a}`).hide()}t?(-1==qwizdata[e].i_question&&(qwizdata[e].i_question=qwizdata[e].saved_i_question),i=qwizdata[e].i_question):-1==qwizdata[e].i_question?(i=qwizdata[e].i_first_user_question,qwizdata[e].i_question=qwizdata[e].saved_i_question):i=qwizdata[e].questions[i].i_user_next_question,qwizdata[e].i_user_question=i;var s=qwizdata[e].questions[i];i==qwizdata[e].i_question&&(qwizdata[e].bck_f=!1,$(".fwd-question-qwiz"+e).css({opacity:.2}).removeClass("hover"),qwizdata[e].next_button_show_b&&$("#next_button-qwiz"+e).show());var _=s.user_question_number;$("span.question-number-qwiz"+e).html(_),i==qwizdata[e].n_questions?$("div#summary-qwiz"+e).show():(a="qwiz"+e+"-q"+i,document_qwiz_mobile?$(`div#mobile_${a}, div.mobile_${a}`).show():$(`div#${a}, div.${a}`).show(),qwizdata[e].summary_b||_==qwizdata[e].n_questions&&$("div#summary-qwiz"+e).show());var o=$(".bck-question-qwiz"+e);-1==s.i_user_prev_question&&(o=o.first()),o.css({opacity:.5}).addClass("hover")}},this.init_question_order=function(e){var t=qwizdata[e].n_questions;qwizdata[e].question_order=new Array(t);for(var i=0;i<t;i++)qwizdata[e].question_order[i]=i;qwizdata[e].random_b&&(qwizdata[e].question_order=qqc.shuffle(qwizdata[e].question_order),debug[0]&&console.log("[init_question_order] qwizdata[i_qwiz].question_order:",qwizdata[e].question_order))},this.display_question=function(e,t,i){var a="qwiz"+e+"-q"+t,s=$(`div#${a}, div.${a}`);debug[0]&&(console.log("[display_question] start_quiz_b:",i),console.log("[display_question] $qwizq:",s)),s.find("[id^="+a+"-a]").hide(),(h=$("div.mobile_"+a
13)).find("[id^=mobile_"+a+"-a]").hide();var _=s.find('input[name="qwiz_img"]');_.length&&(_.changeElements("img"),h.find('input[name="qwiz_img"]').changeElements("img")),qwizdata[e].question_time_limit&&start_timers(e,qwizdata[e].question_time_limit),q.qwizard_b||s.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this)}));var o=s.hasClass("qwizzled");if(o){if(qwizdata[e].$qwizzled||(qwizdata[e].$qwizzled={}),void 0===qwizdata[e].$qwizzled[a]&&(q.qwizard_b?q.init_qwizzled2(s,e,t):q.init_qwizzled(s,e,t)),qwizdata[e].n_labels_correct=0,qwizdata[e].n_label_attempts=0,-1==qwizdata[e].answered_correctly[t]){s.replaceWith(qwizdata[e].$qwizzled[a]);s=$("div#"+a);qwizdata[e].$qwizzled[a]=$("div#"+a).clone(!0);q.qwizard_b||setTimeout((function(){debug[8]&&console.log("[display_question > delay_init_drag_and_drop] i_qwiz:",e,", i_question:",t),q.init_drag_and_drop(s[0])}),100);setTimeout((function(){place_labels(e,t,a)}),200)}var n=0,r={};s.find("span.qwizzled_target").not(".decoy").each((function(){var e=$
13(this).attr("class"),t=e.match(/qtarget_sib-[0-9]*/);if(t){var i=t[0];r[i]=1}else if(t=e.match(/qwizzled_target-[0-9]*/)){i=t[0];r[i]=1}else n++})),n+=s.find("div.qwizzled_target").not(".decoy").length,qwizdata[e].n_label_targets=n+Object.keys(r).length,q.display_diagram_progress(e)}else if(s.hasClass("hotspot_diagram")){const i=s.find("div.hotspot_image_stack");qwizdata[e].$hotspot_image_stack[t]=i;const a=i.find("canvas.layer0_edited");if(q.qwizard_b)i.find("img.layer0_edited, img.qwiz_style_layer").addClass("qwizard_display_block_important"),i.find("div.qwiz_hotspot_label").removeClass("qwizard_display_none_important"),$("#icon_qwiz"+e).hide();else{qwizdata[e].n_labels_correct=0,qwizdata[e].n_label_attempts=0;const _=qwizdata[e].show_hotspots[t],o=qwizdata[e].find_the_dot[t];if(o){const a=create_find_the_dot_html(e,qwizdata[e].find_the_dot[t]);i.before(a),i.find("img.qwiz_layer0, img.qwiz_style_layer").hide(),s.find("input.find_the_dot_dot_color").simpleColor({boxWidth:"25px",boxHeight:"17px",onSelect:find_the_dot_color_selected}),s.find("input.find_the_dot_background_color").simpleColor({boxWidth:"25px",boxHeight:"17px",onSelect:find_the_dot_color_selected}),q.update_find_the_dot(e,!1,!0),i.find("canvas.layer0_edited").css({outline:"1px dotted gray"}).show()}else{qwizdata[e].spotmap_width[t]=a.data("qwiz_spotmap_width"),qwizdata[e].spotmap_height[t]=a.data("qwiz_spotmap_height");const i=a.data("qwiz_sparsemap");qwizdata[e].sparsemap[t]=i;const s=a.data("qwiz_spotmap");s&&(qwizdata[e].spotmap[t]=i?JSON.parse(s.replace(/(\d+):/g,'"$1":')):new Uint8ClampedArray(base64js.toByteArray(s)))}qwizdata[e].hotspot_image_width[t]=a.attr("width"),qwizdata[e].hotspot_image_height[t]=a.attr("height"),i.find("img.hotspot_only_image").hide(),_&&-1!=_.indexOf("always")&&i.find("img.qwiz_style_layer").show();const n=qwizdata[e].hotspot_user_interaction[t];var d;if(!n||"label_prompt"==n)if(-1==qwizdata[e].answered_correctly[t]){var c=0;d=qwizdata[e].n_hotspots[t];for(var l=0;l<d;l++){const i=qwizdata[e].hotspot_nos[t][l]%1e3;qwizdata[e].hotspot_nos[t][l]<0&&(qwizdata[e].hotspot_nos[t][l]=-i,c++)}qwizdata[e].n_hotspots_to_do[t]=c,debug[0]&&console.log("[display_question] n_hotspots_to_do:",c),qwizdata[e].n_labels_correct=d-c,qwizdata[e].n_label_attempts=0}const r=qwizdata[e].hotspot_labels_stick[t];if(-1!=qwizdata[e].answered_correctly[t]&&(qwizdata[e].hotspot_nos[t]=[],qwizdata[e].hotspot_labels[t]=[],qwizdata[e].hotspot_ver2_f[t]=i.find(".qwiz_hotspot1").hasClass("qwiz_hotspot_ver2"),i.find("div.qwiz_hotspot_label").not(".qwiz_hotspot_deleted").each((function(){const i=$(this),a=i.attr("class").match(/ qwiz_hotspot(\d+)/)[1];qwizdata[e].hotspot_nos[t].push(parseInt(a)),i.find("div.ui-resizable-handle").remove();var s=i.find("div.qwiz_hotspot_label_editable").text();s=qqc.remove_tags_eols(s),qwizdata[e].hotspot_labels[t].push(s),!r||"keep"!=r&&"temporary"!=r||(i.off("mouseenter mouseleave"),i.on("mouseenter",(function(){i.css({opacity:.1})})).on("mouseleave",(function(){i.css({opacity:1})})))})),d=qwizdata[e].hotspot_nos[t].length,qwizdata[e].n_hotspots[t]=d,d||errmsgs.push(T("No hotspots set for hotspot_diagram"),NaN+(e+1)+", "+T("question")+" "+(t+1)),qwizdata[e].n_hotspots_to_do[t]=d,debug[0]&&console.log("[display_question] n_hotspots:",d),_&&-1==_.indexOf("hide")&&!o&&init_hotspot_image_canvas(e,t,i)),qwizdata[e].n_label_targets=d,qwizdata[e].answered_correctly[t]=1,i.find("div.qwiz_hotspot_label").hide(),!n||"label_prompt"==n){s.find("div.hotspot_click_feedback").html("<b>Click on:</b>");const i=pick_random_hotspot(e,t);qwizdata[e].current_query_hotspot_no[t]=i,set_hotspot_label_query(e,t,s)}i.off("click.hotspot_diagram_click"),n&&"info_only"==n?((qwizdata[e].n_questions>1||qwizdata[e].combo||qwizdata[e].use_dataset)&&($("#next_button_text-qwiz"+e).html(T("Continue")),q.position_show_next_button(e),qwizdata[e].next_button_show_b=!0),1==qwizdata[e].user_question_number&&alert_not_logged_in(e)):i.on("click.hotspot_diagram_click",qwiz_.hotspot_diagram_click),(_&&-1!=_.indexOf("hover_show")||r&&-1!=r.indexOf("hover_show"))&&(i.off("mousemove click.mobile_hover_eq"),i.on("mousemove click.mobile_hover_eq",show_hotspot_on_hover),_&&-1==_.indexOf("keep")&&(i.off("mouseleave"),i.on("mouseleave",hide_hotspots)),qwizdata[e].current_xy_hotspot_no=-1),qwizdata[e].icon_swhs&&!qwizdata[e].hide_qwizcards_icon_b&&i.append(create_icon_qwiz_div(e));var w=T("Correctly clicked");
13n&&("find_hotspots"==n?w=T("Found"):"info_only"==n&&(w=T("Visited"))),q.display_diagram_progress(e,w)}}if(i&&qqc.is_mobile(qwizdata[e].mobile_enabled))q.go_mobile(e);else if(document_qwiz_mobile){var h;(h=$(`div#mobile_${a}, div.mobile_${a}`)).length?h.show():s.show(),window.scrollTo(0,1)}else if(debug[0]&&console.log("[display_question] $qwizq:",s),s.css("display","block"),q.qwizard_b){var u=!1;if(qwizdata[e].use_dataset_question_ids[t]){var z=s.find(".qwiz_editable");z.length&&(z.removeClass("qwiz_editable"),u=!0)}else{s.find("div.hangman_image").length;$(`div#${a} .qwiz_editable`).first().each((function(){qwizard.init_tinymce(this),u=!0})),$(`div#${a} .qwiz_editable`).slice(1).each((function(){qwizard.init_tinymce_onclick(this)}))}if(u){var m=t;debug[0]&&console.log("[display_question] reset_i_question:",m);setTimeout((function(){if(void 0!==qwizdata[e].parts_htm[m])for(var t=qwizdata[e].parts_htm[m],i=t.length,a=1;a<=i;a++){var _=t[a];$("#qwiz"+e+"-q"+m+" div.qwiz-part"+a).html(_),debug[12]&&console.log("part_htm:",_)}q.init_textentry_autocomplete(s)}),300)}}setTimeout((function(){const t=$(`#qwiz${e}`).offset().top;$(window).scrollTop()>t&&$("html, body").animate({scrollTop:t-20},1e3,"easeInOutCubic")}),20);var p="#qwiz"+e;q.preview&&(p+="-q"+t+".qwizq_preview");var g=$(p);if(!document_qwiz_mobile&&!document_qwiz_force_mobile_f)if(o){var b=10+s.find("table.qwizzled_table").outerWidth();if(debug[0]&&console.log("[display_question] table_width:",b,", initial_width:",qwizdata[e].initial_width),b>qwizdata[e].initial_width&&(g.css({width:b+"px","max-width":"none"}),qwizdata[e].width_reset=!0),q.qwizard_b)s.find(".qwizzled_highlight_label").addClass("no_move")}else{var f=s.find("img");if(f.length){var v=10+f.outerWidth();q.qwizard_b&&set_initial_width(e),debug[0]&&console.log("[display_question] img_width:",v,", initial_width:",qwizdata[e].initial_width),v>qwizdata[e].initial_width&&(g.css({width:v+"px","max-width":"none"}),qwizdata[e].width_reset=!0)}}if(g.length)if(g.is(":visible"))scale_quiz_to_container(g);else{new IntersectionObserver(scale_quiz_to_container_when_visible,{threshold:1}).observe(g[0])}if(!o)if(qwizdata[e].textentry&&qwizdata[e].textentry[t]){var y=$("#textentry-qwiz"+e+"-q"+t);if(qwizdata[e].textentry[t].textentry_suggest_b){if(!qwizdata[e].textentry[t].single_char_b){if(qwizdata[e].terms)qwizdata[e].textentry_terms_metaphones||(qwizdata[e].textentry_terms_metaphones=qqc.process_textentry_terms(qwizdata[e].terms));else if(!default_textentry_terms_metaphones){var x=qqc.get_qwiz_param("url","./"),k="";"body"==content&&"./"==x?"undefined"!=typeof document_qwiz_terms&&(k=document_qwiz_terms):k=qqc.get_textentry_terms(x+"terms.txt",qwizdata),default_textentry_terms_metaphones=qqc.process_textentry_terms(k)}var A;if(qwizdata[e].add_terms&&(qwizdata[e].add_textentry_terms_metaphones||(qwizdata[e].add_textentry_terms_metaphones=qqc.process_textentry_terms(qwizdata[e].add_terms))),qwizdata[e].check_answer_disabled_b=!0,qwizdata[e].textentry_n_hints=0,textentry_answers[e]=qwizdata[e].textentry[t].answers,textentry_answer_metaphones[e]=textentry_answers[e].map((function(e){return e=e.replace(/\s*(\S+)\s.*/,"$1"),qqc.metaphone(e)})),qwizdata[e].textentry[t].use_terms_b)A=qwizdata[e].textentry[t].textentry_plural_b?"plural":"singular",qwizdata[e].terms?current_question_textentry_terms_metaphones[e]=qwizdata[e].textentry_terms_metaphones[A]:current_question_textentry_terms_metaphones[e]=default_textentry_terms_metaphones[A],qwizdata[e].add_terms&&(current_question_textentry_terms_metaphones[e]=current_question_textentry_terms_metaphones[e].concat(qwizdata[e].add_textentry_terms_metaphones[A]));else current_question_textentry_terms_metaphones[e]=[];var C=textentry_answers[e].map((function(e){return[e,qqc.metaphone(e)]}));if(debug[6]&&console.log("[display_question] textentry_answers_metaphones: ",C),current_question_textentry_terms_metaphones[e]=current_question_textentry_terms_metaphones[e].concat(C),current_question_textentry_terms_metaphones[e]=qqc.sort_dedupe_terms_metaphones(current_question_textentry_terms_metaphones[e]),debug[6]){console.log("[display_question] current_question_textentry_terms_metaphones[i_qwiz].length: ",current_question_textentry_terms_metaphones[e].length),console.log("[display_question] current_question_textentry_terms_metaphones[i_qwiz].slice (0, 10): ",current_question_textentry_terms_metaphones[e].slice(0,10));var I=current_question_textentry_terms_metaphones[e].length-10;I>0&&console.log("[display_question] current_question_textentry_terms_metaphones[i_qwiz].slice ("+I+"): ",current_question_textentry_terms_metaphones[e].slice(I))}var O,j,S,E=qwizdata[e].textentry[t],M=E.textentry_minlength,R=E.first_correct_answer.length;R<M&&(M=R),y.autocomplete("instance")||q.init_textentry_autocomplete(s),y.autocomplete("option","minLength",M),M<=1?(O=T("Type a letter/number"),j=T("Type a letter")):(M=Math.max(M,3),O=(O=T("Type %s+ letters/numbers, then select")).replace("%s",M),j=(j=T("Type %s+ letters")).replace("%s",M)),y.attr("placeholder",O),$("#textentry_check_answer_div-qwiz"+e+"-q"+t+" button.textentry_check_answer").html(j),qwizdata[e].check_answer=j,E.textentry_minlength=M,(S=$("#textentry_check_answer_div-qwiz"+e+"-q"+t)).find("button.textentry_check_answer").addClass("qwiz_button_disabled"),qwizdata[e].check_answer_disabled_b=!0,S.css({display:"inline-block"}),0!=t||!q.no_intro_b[e]&&1!=qwizdata[e].n_questions?q.start_hint_timeout(e):$("div#qwiz"+e).attr("onmouseenter",qname+".start_hint_timeout ("+e+")")}}else(S=$("#textentry_check_answer_div-qwiz"+e+"-q"+t)).find("button.textentry_check_answer").removeClass("qwiz_button_disabled"),qwizdata[e].check_answer_disabled_b=!1,S.css({display:"inline-block"});y.length&&(y.val("").removeAttr("disabled"),qwizdata[e].n_correct+qwizdata[e].n_incorrect==0&&q.no_intro_b[e]||(panel_exit_mobile_just_closed_b=!0,q.preview||y.focus()))}else if(qwizdata[e].information_question_b[t])(qwizdata[e].n_questions>1||qwizdata[e].combo||qwizdata[e].use_dataset)&&($("#next_button_text-qwiz"+e).html(T("Continue")),q.position_show_next_button(e),qwizdata[e].next_button_show_b=!0);else if(void 0!==qwizdata[e].hangman[t]){var Y=qwizdata[e].hangman[t],B=Y.n_hangman;Y.n_hangman_done=0,Y.n_hangman_correct=0;for(var N,F=!0,L=0;L<B;L++)if($hangman=s.find("span.qwiz_hangman.qwiz_hangman_c"+L),N=Y.hangman_final_entry[L],-1==qwizdata[e].answered_correctly[t]&&B>1&&Y.hangman_incorrect_chars[L].length<=3&&0==Y.hangman_n_hints[L])$hangman.find("span.hangman_current_entry").html(N),Y.n_hangman_done++,Y.n_hangman_correct++;else{var W,G=N.replace(/>[a-z0-9]</gi,"> <");if(Y.hangman_current_entry[L]=G.replace(/u> </g,"u>\t<"),$hangman.find("span.hangman_current_entry").html(G),q.qwizard_b&&"placeholder"==Y.hangman_answer[L]||($hangman.find("input").off("mousedown"),$("#hangman_hint-qwiz"+e+"-q"+t+"-c"+L).removeAttr("disabled").removeClass("qwiz_button_disabled")),Y.hangman_incorrect_chars[L]="",Y.hangman_incorrect_chars_before_hint[L]=6,Y.hangman_n_hints[L]=0,$hangman[0].done_f=!1,$hangman.find("span.hangman_status").html(""),W=-1!=Y.hangman_answer[L].search(/[a-z]/i)?T
13("Type letters in the box"):T("Type numbers in the box"),$hangman.find("span.hangman_type_letters").html('<span class="type_letters">'+W+"</span>").show(),s.find("div.qwiz_hangman_msg").hide(),(qwizdata[e].user_question_number>1||!q.no_intro_b[e]||-1==qwizdata[e].answered_correctly[t])&&F&&!q.preview){F=!1,panel_exit_mobile_just_closed_b=!0;var D=s.find("span.qwiz_hangman.qwiz_hangman_c"+L+" input");suppress_hangman_hint_b=!0,q.qwizard_b||D[0].focus()}}}else{if(!q.qwizard_b){var Q=qwizdata[e].default_random_mc;if(qwizdata[e].random_mc&&void 0!==qwizdata[e].random_mc[t]&&(Q=qwizdata[e].random_mc[t]),Q){const e=s.find("span.qwiz-choices"),t=e.length;for(l=0;l<t-1;l++){const i=Math.floor(Math.random()*t);e[0].before(e[i])}}}$("input[name="+a+"]").removeAttr("disabled").prop("checked",!1),$("#mobile_"+a+" li.mobile_choice").show(),s.find("button.show_the_answer").removeClass("qwiz_button_disabled").removeAttr("disabled").show(),s.find("li.mobile_choice").show();$(`div.qwiz${e}-q${t}-a0_gen`);q.qwizard_b||(s.find(`.choices-${a}, .choices-${a} .qwiz-choice`).css({cursor:"",color:""}),s.find(".qwiz_correct_choice").removeClass("qwiz_correct_choice"),s.find(".qwiz_incorrect_choice").removeClass("qwiz_incorrect_choice"))}},this.show_response_recorded=function(e){if(!q.preview){var t=DateFormat.format.date((new Date).getTime(),"h:mm:ss");$(`span.response_recorded-qwiz${e} img.response_recording`).removeClass("response_recording_spin").attr("title",T("Response to question")+" "+qwizdata[e].user_question_number+" "+T("recorded")+" "+t)}},this.pay_lock_settings=function(e,t,i,a,s){qqc.pay_lock_settings(qname,qwizdata,n_qwizzes,t,i,a,e,s)},this.go_mobile=function(e){non_mobile_scrollLeft=window.scrollX,non_mobile_scrollTop=window.scrollY;var t=$("#qwiz"+e);if(qwizdata[e].qwiz_style=t.attr("style"),t.removeAttr("style").removeClass("qwiz").addClass("qwiz-mobile qwizard_qwiz_deck_div"),t.after('<div id="qwiz_div_placeholder"></div>'),t.appendTo("body"),window.scrollTo(0,0),$("body").css({overflow:"hidden"}),$("#icon_qwiz"+e).hide(),qqc.is_mobile(qwizdata[e].mobile_enabled)||!document_qwiz_force_mobile_f){t.find(".qwizzled_label_head_standard").hide(),t.find(".qwizzled_label_head_mobile").show();const _=qwizdata[e].i_user_question;if((-1==_||_<qwizdata[e].n_questions)&&!qwizdata[e].login_show_b){var i="qwiz"+e+"-q"+_,a=$("#"+i),s=$("#mobile_qwiz"+e+"-q"+_);s.length?(s.show(),a.hide()):a.show()}if(qwizdata[e].$qwizzled&&qwizdata[e].$qwizzled[i])reset_label_positions(a),t.css("width","");else if(qwizdata[e].generative_response&&qwizdata[e].generative_response[_]){const t=$(`#qwiz${e}-q${_} textarea`).val();$(`#mobile_qwiz${e}-q${_} textarea`).val(t).trigger("input")}$(".go-mobile-qwiz"+e).hide(),document_qwiz_force_mobile_f||($(".exit-mobile-qwiz"+e).show(),$("#mode-qwiz"+e).hide(),$("#icon-exit-mobile-qwiz"+e).show(),$("#summary-qwiz"+e).find("button.summary_exit_mobile_qwiz").show()),document_qwiz_mobile="mobile_",scale_quiz_to_container(t)}},this.open_panel_exit_mobile=function(e){$("#overlay-exit-mobile-qwiz"+e).show().animate({top:"0px"},500),panel_exit_mobile_open_b=!0,$("#icon-exit-mobile-qwiz"+e).hide()},this.close_panel_exit_mobile=function(e){return $(e).animate({top:"-100px"},500,(function(){$(this).hide(),$("div.icon-exit-mobile-qwiz").show()})),window.scrollTo($(window).scrollLeft(),1),panel_exit_mobile_open_b=!1,panel_exit_mobile_just_closed_b=!0,!1},this.exit_mobile=function(e){var t=$("#qwiz"+e);t.attr("style",qwizdata[e].qwiz_style).removeClass("qwiz-mobile qwizard_qwiz_deck_div").addClass("qwiz"),$("#xqwiz"+e).length&&$("#qwiz"+e).css("width",qwizdata[e].initial_width+"px"),$("#qwiz_div_placeholder").replaceWith(t),$("body").css({overflow:""}),window.scrollTo(non_mobile_scrollLeft,non_mobile_scrollTop),$("#overlay-exit-mobile-qwiz"+e).css({top:"-100px",display:"none"}),$(window).off("scroll"),t.find(".qwizzled_label_head_standard").show(),t.find(".qwizzled_label_head_mobile").hide();const i=qwizdata[e].i_user_question;var a,s="qwiz"+e+"-q"+i,_=$("."+s);i>=0&&i<qwizdata[e].n_questions&&!qwizdata[e].login_show_b&&($(".mobile_qwiz"+e+"-q"+i).hide(),_.show());if((a=qwizdata[e].$qwizzled&&qwizdata[e].$qwizzled[s]?_.find("table.qwizzled_table"):_.find("img")).length){var o=10+a.outerWidth();if(o>qwizdata[e].initial_width){var n="#qwiz"+e;q.preview&&(n+="-q"+i+".qwizq_preview"),$(n).css({width:o+"px","max-width":"none"}),qwizdata[e].width_reset=!0}qwizdata[e].$qwizzled&&qwizdata[e].$qwizzled[s]&&reset_label_positions(_)}if(i>=0&&i<qwizdata[e].n_questions&&qwizdata[e].generative_response&&qwizdata[e].generative_response[i]){const t=$(`#mobile_qwiz${e}-q${i} textarea`).val();$(`#qwiz${e}-q${i} textarea`).val(t).trigger("input")}$("div.icon-exit-mobile-qwiz, div.icon-panel-exit-mobile-qwiz").hide(),$(".exit-mobile-qwiz").hide(),$("button.summary_exit_mobile_qwiz").hide();const r=qwizdata[e].mobile_enabled;("Always"==r||"Small screens only"==r&&qqc.is_mobile(r))&&$(".go-mobile-qwiz"+e).show(),document_qwiz_mobile="",panel_exit_mobile_just_closed_b=!1},this.start_hint_timeout=function(e){$("div#qwiz"+e).removeAttr("onmouseenter");const t=qwizdata[e].i_question,i=$("#textentry_check_answer_div-qwiz"+e+"-q"+t);debug[0]&&console.log("[start_hint_timeout] $check_answer.length:",i.length);i.find("button.qwiz_textentry_hint").html("Hint").hide(),hint_timeout_sec>=0&&(show_hint_timeout[e]=setTimeout((function(){i.find("button.qwiz_textentry_hint").removeAttr("disabled").html("Hint").css({display:"inline-block"})}),1e3*hint_timeout_sec))},this.stuck_show_answer=function(e,t,i){const a=$(`#qwiz${t}-q${i}-a0`),s=$(`#mobile_qwiz${t}-q${i}-a0`),_=a.find(".answer_guide_header"),o=s.find(".answer_guide_header"),n=`<p class="answer_guide_header" style="font-weight: bold; color: blue;">${T("Answer Guide")}</p>`;
130==_.length&&a.prepend(n).css({border:"2px solid blue",padding:"5px"}),0==o.length&&s.prepend(n).css({border:"2px solid blue",padding:"5px"}),a.show(),s.show(),q.preview||qwizdata[t].bck_f||($(`#show_answer_got_it_or_not-qwiz${t}-q${i}`).show(),$(`#mobile_show_answer_got_it_or_not-qwiz${t}-q${i}`).show(),$(`#show_answer_got_it_or_not-qwiz${t}-q${i} .ok_ive_got_it`).attr("disabled",!0).addClass("qwiz_button_disabled"),$(`#mobile_show_answer_got_it_or_not-qwiz${t}-q${i} .ok_ive_got_it`).attr("disabled",!0).addClass("qwiz_button_disabled"),$(`#show_answer_got_it_or_not-qwiz${t}-q${i} button.view_answer_guide`).html(T("Hide answer guide")),$(`#mobile_show_answer_got_it_or_not-qwiz${t}-q${i} button.view_answer_guide`).html(T("Hide answer guide")))};var first_decode_err_f=!0,hotspot_long_hover_id,hotspot_label_hide_id;function cvt_feedback(e,t){var i,a;const s=void 0!==t;if(s)i=e.substr(0,t),a=e.substr(t);else{if(c_pos=e.indexOf("[c]"),-1==c_pos)return e;i=e.substr(0,c_pos),a=e.substr(c_pos+3)}var _,o;-1==(t=a.indexOf("[f]"))&&(t=a.indexOf("[fx]"));var n="";if(-1!=t)for(_=a.substr(t+3),a=a.substr(0,t);;){-1==(t=_.indexOf("[f]"))?o=_:(o=_.substr(0,t),_=_.substr(t+3));var r=(d=feedback_decode(o)).c;if(r&&(n+="[f]"+r),-1==t)break}var d=feedback_decode(a),q="",c="";if(!s)q="[c"+d.star+"]",c=d.c;return i+q+c+n}function feedback_decode(e){var t,i=e.indexOf("[Qq]"),a="";-1!=i?(t=e.substr(0,i),a=e.substr(i+4)):t=e,debug[2]&&console.log("[feedback_decode] s_to_decode:",t);var s="",_="",o=t.split(/<[^>]+>/);if(o.length>1){for(var n=t.match(/<[^>]+>/g),r=[],d=n.length,q=!0,c=0;c<d;c++){if(""!=(l=o[c])){q&&(q=!1,/ /.test(l)&&(s="*"));try{r.push(Base64.decode(l))}catch(e){}}-1!=n[c].indexOf("qcodeq")&&(reinit_highlighting_f=!0,n[c]=n[c].replace("qcodeq","code")),r.push(n[c])}try{var l=o[d];q&&/ /.test(l)&&(s="*"),r.push(Base64.decode(l))}catch(e){}_=r.join("")}else{/ /.test(t)&&(s="*");try{_=Base64.decode(t)}catch(e){}}return _+=a,debug[2]&&console.log("[feedback_decode] decoded_s:",_),{c:_,star:s}}function create_hangman_textentry_editable_divs(e,t,i,a,s,_,o){o=qqc.shortcodes_to_video_elements(o);var n=[],r=create_bg_img_style(e,t);"response"!=s&&n.push('<div id="qwiz'+e+"-q"+t+'" class="qwizq qwizard_line_height"'+r+">\n"),void 0===qwizdata[e].parts_htm[t]&&(qwizdata[e].parts_htm[t]=[]);var d=0,q=1;for(o.length;;){var c=o.substr(d),l=c.search(_);if(-1==l)break;d+=l;var w=c.substr(0,l);1==q&&(w=i+w),-1==(w=qqc.remove_unmatched_tag(w,1==q)).search(/\S/)&&(w=" "),qwizdata[e].parts_htm[t][q]=w;var h=c.match(_);debug[9]&&console.log("[create_hangman_textentry_editable_divs] m[0]:",h[0]),d+=h[0].length,n.push('<div class="qwiz-question qwiz-question-'+s+" qwiz-parts qwiz-part"+q+' qwiz-inline qwiz_editable" data-i_part="'+q+'">\n'),n.push(w),n.push("</div>"),n.push(a[q-1]),q++}if("response"!=s){w=o.substr(d);-1==(w=qqc.remove_unmatched_tag(w,!1,!0)).search(/\S/)&&(w=" "),qwizdata[e].parts_htm[t][q]=w,n.push('<div class="qwiz-question qwiz-question-'+s+" qwiz-parts qwiz-part"+q+' qwiz-inline qwiz_editable" data-i_part="'+q+'">\n'),n.push(w),n.push("</div>")}return n.join("")}function update_hangman_input(e,t,i,a,s,_,o,n){for(var r=!1,d=!1,c=-1,l=new RegExp("u>"+e+"</u","i");;){var w=i.substr(c+1).match(l);if(!w)break;c+=w.index+2,t=qqc.setCharAt(t,c+1,w[0][2]),d=!0}debug[9]&&console.log("[update_hangman_input] keychar:",e,", good_char_b:",d);var h=qwizdata[a].hangman[s],u=h.hangman_incorrect_chars[_],z=(r=!1,!1);if(d){h.hangman_current_entry[_]=t;var m=t.replace(/\t/g," ");$(o).parents("span.qwiz_hangman.qwiz_hangman_c"+_).find("span.hangman_current_entry").html(m),(r=-1==t.indexOf("<u>\t</u>"))&&(h.n_hangman_done++,z=h.n_hangman_done==h.n_hangman)}else e=e.toLowerCase(),-1==u.indexOf(e)&&(u+=e).length>6&&(r=!0,h.n_hangman_done++,z=h.n_hangman_done==h.n_hangman),h.hangman_incorrect_chars[_]=u,debug[9]&&console.log("[hangman_keyup] hangman_incorrect_chars:",u);if(r){$(o).on("mousedown",(function(e){e.preventDefault()})),o.parentElement.done_f=!0;const e=h.hangman_n_hints[_];var p=u.length<=6&&0==e;if(p)h.n_hangman_correct++,h.n_hangman>1&&($("div#qwiz"+a+"-q"+s+" div.qwiz-feedback").hide(),$("div#qwiz"+a+"-q"+s+" div.qwiz_hangman_msg").hide()),$("#qwiz"+a+"-q"+s+"-a"+_).show(),z&&h.n_hangman_correct==h.n_hangman&&(q.qwizard_b||(qwizdata[a].n_correct++,qwizdata[a].n_qs_done&&qwizdata[a].n_qs_done.add(qwizdata[a].dataset_id[s])));else{h.n_hangman>1&&$("div#qwiz"+a+"-q"+s+" div.qwiz-feedback").hide();var g="<hr />";if(qwizdata[a].repeat_incorrect_b){const i=t.match(/<u>[^\t]<\/u>/g);if(i){i.length;1==i.length?g+=T("You got one letter correct")+". ":g=(g+=T("You got %s letters correct")+". ").replace("%s",qqc.number_to_word(i.length)),1==e?g+=T("You used one hint")+". ":e>1&&(g=(g+=T("You used %s hints")+". ").replace("%s",qqc.number_to_word(e))),u.length&&(g+=T("Incorrect letters")+": "+u+". "+T("Pick different letters when you see this word again."))}else g="<hr />"+T("Sorry, you entered more than six incorrect letters")+": "+u+". "+T("Choose different letters when you see this word again!")}else g="<hr />"+T("Sorry, you entered more than six incorrect letters.");$("div#qwiz"+a+"-q"+s+" div.qwiz_hangman_msg").html(g).show(),z&&h.n_hangman_correct!=h.n_hangman&&(q.qwizard_b||qwizdata[a].n_incorrect++)}if(z){if(q.qwizard_b||(qwizdata[a].answered_correctly[s]=h.n_hangman==h.n_hangman_correct?1:-1),o.blur(),qwizdata[a].qrecord_id&&document_qwiz_user_logged_in_b){var b=h.hangman_answer[_],f={q_and_a_text:btoa(encodeURIComponent(qwizdata[a].q_and_a_text[s])),q_and_a_crc32:qwizdata[a].q_and_a_crc32[s],i_question:qwizdata[a].dataset_id[s],unit:qwizdata[a].unit[s],level:qwizdata[a].level[s],type:"hangman",response:b,correct_b:p?1:"",confirm:"js"};record_response(a,qwizdata[a].qrecord_id,f)}update_topic_statistics(a,s,p),update_progress_show_next(a)}else{var v=!0;for(_=0;_<h.n_hangman;_++)if(h.hangman_current_entry[_]!=h.hangman_final_entry[_]&&h.hangman_incorrect_chars[_].length<=6){var y=$("div#qwiz"+a+"-q"+s+" span.qwiz_hangman.qwiz_hangman_c"+_);v?(y.find("input").focus(),v=!1):y.find("span.hangman_type_letters").show()}}r=!0}return r}function single_char_textentry_keyup(e){var t=e.target;if(debug[6]&&console.log("[single_char_textentry_keyup] input_el:",t),-1==t.value.search(/[a-z0-9]/i))return t.value="",!1;var i=t.id.match(/qwiz([0-9]+)/)[1];debug[6]&&console.log("[single_char_textentry_keyup] i_qwiz:",i),1==qwizdata[i].user_question_number&&($("div#icon_qwiz"+i).hide(),alert_not_logged_in(i),qwizdata[i].qwiz_timer&&start_timers(i)),q.textentry_check_answer(i,!0)}function process_feedback_item(e,t,i,a,s){debug[2]&&console.log("[process_feedback_item] choice_html: ",e);var _,o=qqc.parse_html_block(e,["[f]","[fx]"],["[f]","[fx]","[x]"]),n="";return"NA"!=o?(e=e.replace(o,""),debug[2]&&console.log("[process_feedback_item] feedback_item_html: ",o),_=-1!=o.indexOf("[fx]"),n=create_feedback_div_html(t,i,a,o=o.replace(/\[fx{0,1}\]/,""),"",s)):o="",debug[2]&&(console.log("[process_feedback_item] feedback_div:",n),console.log("[process_feedback_item] choice_html: ",e),console.log("[process_feedback_item] fx_b: ",_)),{feedback_div:n,choice_html:e,feedback_item_html:o,fx_b:_}}function init_hotspot_image_canvas(e,t,i){const a=i.find("canvas.layer0_edited")[0],s=a.getContext("2d");qwizdata[e].ctx[t]=s;const _=i.find("img.layer0_edited")[0];if(_.complete)s.drawImage(_,0,0,a.width,a.height);else{const e=new Image;e.src=_.src,e.onload=function(){s.drawImage(e,0,0,a.width,a.height)}}}function process_hotspot_diagram(e,t,i,a,s){debug[0]&&console.log("[process_hotspot_diagram] question_htm: ",i);var _=[];_.push('<div id="qwiz'+e+"-q"+t+'" class="qwizq hotspot_diagram">');const o=i.indexOf('<div class="hotspot_image_stack"'),n=i.substr(0,o);if(q.qwizard_b){_.push('<div class="qwiz_editable qwiz-question">'),_.push(a+n),_.push("</div>");var r=i.substr(o),d="";if(w=r.match(/<img class="qwiz_layer0[^_][^>]*>/)){var c=w[0].match(/ src="([^"]*)"/);c&&(d=c[1])}_.push(r),_.push('<div style="clear: both;"></div>'),_.push('<div class="hotspot_click_feedback hotspot_click_feedback_correct qwiz_editable"></div>'),_.push('<div class="hotspot_click_feedback hotspot_click_feedback_incorrect qwiz_editable"></div>')}else{_.push(a+i);const s=qwizdata[e].hotspot_user_interaction[t];s&&"info_only"==s||(_.push('<div style="clear: both;"></div>'),_.push('<div class="hotspot_click_feedback"></div>'),_.push('<div class="hotspot_label_query"></div>'))}if(_.push("</div>"),set_qwizard_data_b&&(qw.questions_cards[t].type="hotspot_diagram",qw.questions_cards[t].question_text=n,qw.questions_cards[t].hotspot_image_src=d,qw.questions_cards[t].canvas_el=""),_=_.join("\n"),debug[0]&&console.log("[process_hotspot_diagram] htm:",_),qwizdata[e].hotspot_nos||(qwizdata[e].hotspot_nos={},qwizdata[e].hotspot_labels={},qwizdata[e].hotspot_highlighted_fs={},qwizdata[e].hotspot_ver2_f={},qwizdata[e].n_hotspots_to_do={},qwizdata[e].$hotspot_image_stack={},qwizdata[e].hotspot_image_width={},qwizdata[e].hotspot_image_height={},qwizdata[e].spotmap={},qwizdata[e].spotmap_width={},qwizdata[e].spotmap_height={},qwizdata[e].sparsemap={},qwizdata[e].n_hotspots={},qwizdata[e].current_query_hotspot_no={}),qwizdata[e].qrecord_id)if(qqc.isInteger(qwizdata[e].dataset_id[t])){var l=qqc.remove_tags_eols(n);qwizdata[e].q_and_a_text[t]=qqc.q_and_a_hash(l),qwizdata[e].q_and_a_crc32[t]=qwiz_crc32(_),debug[0]&&(console.log("[process_hotspot_diagram] qwizdata[i_qwiz].q_and_a_text[i_question]:",qwizdata[e].q_and_a_text[t]),console.log("[process_hotspot_diagram] qwizdata[i_qwiz].q_and_a_crc32[
13i_question]:",qwizdata[e].q_and_a_crc32[t]))}else qwizdata[e].q_and_a_text[t]=qwizdata[e].dataset_id[t],qwizdata[e].q_and_a_crc32[t]="dataset";if(s){var w;qw.questions_cards[t].question_html=n,(w=i.match(/qwiz_layer0[^"]+"\s+src="([^"]+)/))?qw.questions_cards[t].image_url=w[1]:(console.log("[process_hotspot_diagram] (did not find image) question_htm:",i),qw.questions_cards[t].image_url="NA");var h=[],u=[],z=[];const e=/<div\s*(id=""){0,1}\s*class="qwiz_hotspot_label /,a='<span class="hotspot_label_feedback_correct_content">',s='<span class="hotspot_label_feedback_incorrect_content">';for(var m=i;;){const t=m.search(e);if(-1==t)break;const i=qqc.find_matching_block(m.substr(t));var p,g,b;if(-1!=i.indexOf("qwiz_hotspot_deleted"))p="[deleted]",g="",b="";else{const e=i.search('<div class="hotspot_label_feedback');p=(p=(p=(p=i.substr(0,e)).replace(/<div[^>]+>/,"")).replace(/<div[^>]+>/,"")).replace(/<\/div>[^]*/,"");const t=i.substr(e),_=t.search(a);g=(g=qqc.find_matching_block(t.substr(_)).substr(53)).replace(/<\/span>$/,"");const o=t.search(s);var f=t.substr(o);b=(b=(f=qqc.find_matching_block(f)).substr(55)).replace(/<\/span>$/,"")}h.push(p),u.push(g),z.push(b),m=m.substr(t+i.length)}if(qw.questions_cards[t].hotspot_labels=h,qw.questions_cards[t].feedback_corrects=u,qw.questions_cards[t].feedback_incorrects=z,(w=i.match(/<canvas.*?width="(\d+)/m))?qw.questions_cards[t].hotspot_image_width=w[1]:(console.log("[process_hotspot_diagram] (did not find canvas width) question_htm:",i),qw.questions_cards[t].hotspot_image_width=0),(w=i.match(/<canvas.*?height="(\d+)/m))?qw.questions_cards[t].hotspot_image_height=w[1]:(console.log("[process_hotspot_diagram] (did not find canvas height) question_htm:",i),qw.questions_cards[t].hotspot_image_height=0),(w=i.match(/qwiz_spotmap_width="(\d+)/m))?qw.questions_cards[t].spotmap_width=w[1]:(console.log("[process_hotspot_diagram] (did not find spotmap_width) question_htm:",i),qw.questions_cards[t].spotmap_width=0),(w=i.match(/qwiz_spotmap_height="(\d+)/m))?qw.questions_cards[t].spotmap_height=w[1]:(console.log("[process_hotspot_diagram] (did not find spotmap_height) question_htm:",i),qw.questions_cards[t].spotmap_height=0),w=i.match(/qwiz_sparsemap="(\d+)/m),qw.questions_cards[t].sparsemap=!!w&&"1"==w[1],(w=i.match(/qwiz_spotmap="([^"]+)/m))?qw.questions_cards[t].spotmap=w[1]:(console.log("[process_hotspot_diagram] (did not find spotmap) question_htm:",i),qw.questions_cards[t].spotmap=""),w=i.match(/img class="qwiz_style_layer[^"]+"\s+src="([^"]+)/)){var v=w[1];if("blob"==v.substr(0,4)){const e="wait"+(new Date).getTime();qqc.get_blob_as_data_url(e,v),v=e}qw.questions_cards[t].style_layer_src=v,debug[0]&&console.log("[process_hotspot_diagram] JSON.stringify (qw.questions_cards["+t+"]):",JSON.stringify(qw.questions_cards[t]))}}return _}
13function create_find_the_dot_html(e,t){const i=t.width,a=t.height,s=t.dot_color,_=t.background_color,o=t.controls,n=t.new_dot_button_style;var r=[];const d=o?"block":"none";r.push('<div class="find_the_dot_controls" style="display: '+d+'; margin-bottom: 2px;">'),r.push("Width"),r.push('<input class="find_the_dot_width" type="text" onchange="'+qname+".update_find_the_dot ("+e+')" value="'+i+'" />'),r.push("Height"),r.push('<input class="find_the_dot_height" type="text" onchange="'+qname+".update_find_the_dot ("+e+')" value="'+a+'" />'),r.push('<button class="qwiz_button_small" style="background: gray;">'),r.push("Go"),r.push(" </button>"),r.push(" "),r.push("Dot color"),r.push('<div class="qwiz_simplecolor_wrapper" style="z-index: 3;">'),r.push('<input class="find_the_dot_dot_color" type="text" value="'+s+'" />'),r.push("</div>"),r.push(" "),r.push("Background"),r.push('<div class="qwiz_simplecolor_wrapper" style="z-index: 2;">'),r.push('<input class="find_the_dot_background_color" type="text" value="'+_+'" />'),r.push("</div>"),r.push("</div>");var q=' class="qwiz_button qwiz_smaller"',c="float: right;";return n&&(q="","none"!=n&&(c+=n)),r.push("<button"+q+' style="'+c+'" onclick="'+qname+".update_find_the_dot ("+e+', true)" title="'+T("Place dot at new random location")+'">'),r.push("New dot"),r.push("</button>"),o&&r.push('One in <span class="find_the_dot_n_dots"></span>'),r.push("<br />"),r.join("\n")}function find_the_dot_color_selected(e,t){debug[0]&&console.log("[find_the_dot_color_selected] value:",e,", input_el:",t);const i=$(t).parents("div.qwiz")[0].id.substr(4),a=qwizdata[i].i_question,s=($(t).hasClass("find_the_dot_dot_color")?"dot":"background")+"_color";qwizdata[i].find_the_dot[a][s]="#"+e,q.update_find_the_dot(i)}this.hangman_show=function(e,t){if(suppress_hangman_hint_b)return suppress_hangman_hint_b=!1,!1;var i=$(e);if(i.find("span.hangman_type_letters").hide(),clearTimeout(e.i_hint_timeout),t){e.i_hint_timeout=setTimeout((function(){i.find("button.hangman_hint, span.hangman_status").fadeOut(1e3)}),750)}if(!e.done_f){i.find("button.hangman_hint").show();var a=i.find("span.hangman_status");a.html()&&a.show()}},this.hangman_hide=function(e){var t=$(e);e.i_hint_timeout=setTimeout((function(){t.find("button.hangman_hint, span.hangman_status").fadeOut(500)}),500)},this.hangman_keyup=function(e,t,i,a,s,_){1!=qwizdata[a].user_question_number||!q.no_intro_b[a]&&1!=qwizdata[a].n_questions||($("div#icon_qwiz"+a).hide(),alert_not_logged_in(a),qwizdata[a].qwiz_timer&&start_timers(a));var o=e.value;e.value=i,debug[9]&&console.log("[hangman_keyup] value.charCodeAt:",o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3));var n=o.replace(/[^a-z0-9]/gi,"");if(""==n)return!1;n=n.toLowerCase(),debug[9]&&console.log("[hangman_keyup] keychars:",n);for(var r=qwizdata[a].hangman[s].hangman_current_entry[_],d=qwizdata[a].hangman[s].hangman_final_entry[_],c=n.length,l=0;l<c;l++){var w;if(w=update_hangman_input(n[l],r,d,a,s,_,e))break}if(!w&&($("div#qwiz"+a+"-q"+s+" div.qwiz-feedback").hide(),$(e).parents("div.qwizq").find("div.qwiz_hangman_msg").hide(),qwizdata[a].hangman[s].hangman_incorrect_chars[_])){var h=qwizdata[a].hangman[s].hangman_incorrect_chars_before_hint[_],u=qqc.create_hangman_incorrect_chars_display(qwizdata[a].hangman[s].hangman_incorrect_chars[_],h,!0);$(e).parents("span.qwiz_hangman.qwiz_hangman_c"+_).find("span.hangman_status").html(u).show()}return!0},this.hangman_hint=function(e,t,i){if(qwizdata[e].hangman[t].hangman_n_hints[i]++,qwizdata[e].hangman[t].hangman_n_hints[i]>qwizdata[e].hangman[t].hangman_max_hints)return!1;qwizdata[e].hangman[t].hangman_n_hints[i]==qwizdata[e].hangman[t].hangman_max_hints?$("#hangman_hint-qwiz"+e+"-q"+t+"-c"+i).attr("disabled",!0).addClass("qwiz_button_disabled"):qwizdata[e].hangman[t].hangman_incorrect_chars_before_hint[i]=qwizdata[e].hangman[t].hangman_incorrect_chars[i].length;qwizdata[e].hangman[t].hangman_answer[i];var a=qwizdata[e].hangman[t].hangman_current_entry[i],s=a.match(/<u>.<\/u>/g),_=s.indexOf("<u>\t</u>");if(debug[9]&&(console.log("[hangman_hint] matches:",s),console.log("[hangman_hint] i_pos:",_)),-1!=_){var o=qwizdata[e].hangman[t].hangman_final_entry[i],n=(s=o.match(/<u>.<\/u>/g))[_][3],r=$("div#"+("qwiz"+e+"-q"+t)).find("span.qwiz_hangman.qwiz_hangman_c"+i+" input");update_hangman_input(n,a,o,e,t,i,r[0],!0),r.focus()}}
13,this.create_hotspot_image=function(e,t,i,a,s){if(debug[0])var _=(new Date).getTime();const o=s.canvas.width,n=s.canvas.height,r=s.getImageData(0,0,o,n).data,d=(new Uint32Array(r.buffer),"qwiz_tmp_hotspot-only_canvas-qwiz"+e);var c=$("canvas."+d),l=!0;c.length||(l=!1,$("body").append('<canvas class="'+d+' qwiz_display_none" width="'+o+'" height="'+n+'"></canvas>'),c=$("canvas."+d));const w=c[0];var h=w.getContext("2d");const u=qwizdata[e].find_the_dot[t];if(u){u.hotspot_only_new_f=!1,c.attr("width",o),c.attr("height",n),h.clearRect(0,0,o,n),h.beginPath();var[z,m,p]=qqc.hex_to_rgb(u.background_color.substr(1));z=255-z,m=255-m,p=255-p,h.strokeStyle="rgb("+z+", "+m+", "+p+")",h.lineWidth=2,h.arc(1+u.ix,1+u.iy,10,0,2*Math.PI),h.stroke();a.find("div.qwiz_hotspot_label.qwiz_hotspot"+i).css({left:8+u.ix,top:8+u.iy})}else{l&&(h.clearRect(0,0,o,n),h.beginPath());hotspot_indexof(qwizdata[e].hotspot_nos[t],i);const a=qwizdata[e].hotspot_ver2_f[t],[s,_,d]=q.hotspot_color_from_no(i,a);if(!a)if(11==i)var[g,b,f]=q.hotspot_color_from_no(1);else if(13==i)var[g,b,f]=q.hotspot_color_from_no(3);var v=!1;const c=$("div#qwiz"+e+"-q"+t),w=c.find("div.qwiz_hotspot_label.qwiz_hotspot1");var y,x=w.attr("data-border_all");x||(x=i);const u=(y=c.find("div.qwiz_hotspot_label.qwiz_hotspot"+x)).data("border_width");u&&"0"!=u&&(v=!0);var k=w.attr("data-highlight_all");if(k||(k=i),y=c.find("div.qwiz_hotspot_label.qwiz_hotspot"+k),!v){const e=y.data("highlight_brightness");e&&"0"!=e&&(v=!0)}if(!v){v=!!y.data("highlight_tint")}qwizdata[e].hotspot_highlighted_fs[t]||(qwizdata[e].hotspot_highlighted_fs[t]={}),qwizdata[e].hotspot_highlighted_fs[t][i]=v;const z=o*n;if(v){const e=c.find("img.qwiz_style_layer")[0];if(e.complete)h.drawImage(e,0,0,o,n);else{const t=new Image;t.src=e.src,t.onload=function(){h.drawImage(t,0,0,o,n)}}var A=(C=h.getImageData(0,0,o,n)).data,T=new Uint32Array(A.buffer);for(let e=0;e<z;e++){let t=e<<2;if(r[t+3]==q.hotspot_alpha_value){const i=r[t],a=r[t+1],o=r[t+2];rgb_same(i,s)&&rgb_same(a,_)&&rgb_same(o,d)||(T[e]=0)}else T[e]=0}}else{var C;A=(C=h.getImageData(0,0,o,n)).data,T=new Uint32Array(A.buffer);const e=-1065320320;for(let t=0;t<z;t++){let o=t<<2;if(r[o+3]==q.hotspot_alpha_value){const n=r[o],q=r[o+1],c=r[o+2];rgb_same(n,s)&&rgb_same(q,_)&&rgb_same(c,d)?a||11!=i&&13!=i||rgb_same(n,g)&&rgb_same(q,b)&&rgb_same(c,f)&&(T[t]=e):T[t]=e}else T[t]=e}}h.putImageData(C,0,0)}const I=w.toDataURL();return debug[0]&&(console.log("[create_hotspot_image] dataURL:",I),console.log("[create_hotspot_image] msec:",(new Date).getTime()-_)),I},this.update_find_the_dot=function(e,t,i){const a=qwizdata[e].i_question,s=$("div#qwiz"+e),_=$("div#qwiz"+e+"-q"+a),o=_.find("div.hotspot_image_stack"),n=o.find("canvas.layer0_edited"),r=n[0].getContext("2d");qwizdata[e].ctx[a]=r;const d=parseInt(_.find("input.find_the_dot_width").val()),c=parseInt(_.find("input.find_the_dot_height").val());if(d<1||d>1e3||c<1||c>1e3)return void alert("Please enter a number between 1 and 1000");var l=qwizdata[e].find_the_dot[a];if(l.hotspot_only_new_f=!0,!t){o.css({width:d,height:c}),n.attr("width",d),n.attr("height",c),qwizdata[e].hotspot_image_width[a]=d,qwizdata[e].hotspot_image_height[a]=c,_.find("span.find_the_dot_n_dots").html((d*c).toLocaleString());const t=10+parseInt(d);t>qwizdata[e].initial_width&&(s.css({width:t+"px","max-width":"none"}),qwizdata[e].width_reset=!0)}if(r.fillStyle=l.background_color,r.fillRect(0,0,d,c),(t||i)&&(l.ix=parseInt(Math.random()*d),l.iy=parseInt(Math.random()*c),t)){qwizdata[e].n_labels_correct=0,qwizdata[e].n_label_attempts=0,q.display_diagram_progress(e,T("Visited"));var w=qwizdata[e].hotspot_nos[a];const t=w.length;for(let e=0;e<t;e++)w[e]=w[e]%1e3}const h=l.ix,u=l.iy;r.fillStyle=l.dot_color,r.fillRect(h,u,1,1),qwizdata[e].sparsemap[a]=1;var z={};const m=Math.max(0,h-1),p=Math.min(d,h+2),g=Math.max(0,u-1),b=Math.min(c,u+2);for(var f=m;f<p;f++){z[f]={};for(var v=g;v<b;v++)z[f][v]=1}debug[0]&&console.log("[update_find_the_dot] spotmap:",z),qwizdata[e].spotmap[a]=z,qwizdata[e].spotmap_width[a]=d,qwizdata[e].spotmap_height[a]=c},this.hotspot_diagram_click=function(e){debug[0]&&console.log("[hotspot_diagram_click] event:",event);const t=$(event.target).parents("div.qwizq")[0].id.match(/qwiz(\d+)/)[1],i=qwizdata[t].i_question;if(1==qwizdata[t].user_question_number&&($("div#icon_qwiz"+t).hide(),alert_not_logged_in(t),qwizdata[t].qwiz_timer&&start_timers(t)),-1==qwizdata[t].use_dataset.indexOf("secure_hotspot")){const e=is_xy_hotspot(t,i,event.offsetX,event.offsetY);q.hotspot_diagram_click2(t,i,e)}else{const e={use_dataset:qwizdata[t].use_dataset,dataset_id:qwizdata[t].dataset_id[i],i_question:i,ix:event.offsetX,iy:event.offsetY};qqc.qjax(qname,t,"","is_xy_hotspot",e)}},this.hotspot_diagram_click2=function(e,t,i){const a=qwizdata[e].hotspot_nos[t],s=qwizdata[e].current_query_hotspot_no[t],_=qwizdata[e].$hotspot_image_stack[t];debug[0]&&console.log("[hotspot_diagram_click2] current_query_hotspot_no:",s),qwizdata[e].n_label_attempts++;var o=qwizdata[e].hotspot_user_interaction[t];o||(o="label_prompt");const n=qwizdata[e].show_hotspots[t];var r=qwizdata[e].hotspot_labels_stick[t];r||(r="hide");var d,c,l="",w=!1,h=!1,u=i>0;"label_prompt"==o?(c=s,u=i==s):c=i;const z=$("#qwiz"+e+"-q"+t);if(d=z.find("div.qwiz_hotspot_label.qwiz_hotspot"+c),c){var m=hotspot_indexof(a,c);-1==m&&(alert("Sorry, error"),m=0)}if("find_hotspots"==o&&(debug[0]&&console.log("[hotspot_diagram_click2] hotspot_nos:",a),Math.abs(a[m])>1e3&&(i=0,u=!1)),u){if(a[m]+=1e3*Math.sign(a[m]),n&&"always"!=n&&-1==n.indexOf("hide")){show_hotspot_on_hover();const a=_.find("img.qwiz_layer"+i),s=qwizdata[e].hotspot_highlighted_fs[t][i]?"keep":"temporary";_.find("img.hotspot_only_image.hotspot_temporary").removeClass("hotspot_temporary").hide(),-1!=n.indexOf("temporary")?a.addClass("hotspot_temporary").show():-1!=n.indexOf("keep")&&a.addClass("hotspot_"+s).show()}if("temporary"==r&&_.find("div.qwiz_hotspot_label").hide(),"temporary"==r||"keep"==r){setTimeout((function(){d.css({display:"inline-block"})}),100),"keep"==r&&d.addClass("hotspot_clicked")}qwizdata[e].n_labels_correct++,qwizdata[e].n_hotspots_to_do[t]--;
13if(l=`<img src="${qqc.get_qwiz_param("url","./")}images/checkmark_icon.png" /> `,(p=d.find("span.hotspot_label_feedback_correct_content")).length?(l+=p.html(),qqc.is_only_tags_and_whitespace(l)?l+=q.canned_feedback(!0):l=l.replace(/ /g," ")):l+=q.canned_feedback(!0),qwizdata[e].n_hotspots_to_do[t]&&"label_prompt"==o){l+="<div><b>"+T("Now click on:")+"</b></div>";const i=pick_random_hotspot(e,t);0==i?qwizdata[e].n_hotspots_to_do[t]=0:(qwizdata[e].current_query_hotspot_no[t]=i,set_hotspot_label_query(e,t,z))}if(!qwizdata[e].n_hotspots_to_do[t]){if(w=!0,set_hotspot_label_query(e,t,z,!0),_.off("mousemove click.hotspot_diagram_click click.mobile_hover_eq"),!q.qwizard_b&&!q.preview){if(h=1==qwizdata[e].answered_correctly[t]){if(qwizdata[e].n_correct++,qwizdata[e].n_qs_done&&qwizdata[e].n_qs_done.add(qwizdata[e].dataset_id[t]),"label_prompt"==o)l+="<div>"+T("You identified all of the items on the first try!")+"</div>";else if("find_hotspots"==o){const t=qwizdata[e].n_label_attempts;t==a.length?l+="<div>"+T("You identified all of the items on the first try!")+"</div>":l=(l+="<div>"+plural(T("It took you one try"),T("It took you %s tries"),t)+" "+plural(T("to identify this item"),T("to identify these items"),qwizdata[e].n_label_targets)+".</div>").replace("%s",qqc.number_to_word(t))}}else{const t=qwizdata[e].n_label_attempts;l=(l+="<div>"+plural(T("It took you one try"),T("It took you %s tries"),t)+" "+plural(T("to identify this item"),T("to identify these items"),qwizdata[e].n_label_targets)+".</div>").replace("%s",qqc.number_to_word(t)),qwizdata[e].n_incorrect++}update_topic_statistics(e,t,h)}update_progress_show_next(e)}}else if(("label_prompt"==o||i>0)&&(a[m]=-s,qwizdata[e].answered_correctly[t]=-1),n&&-1!=n.indexOf("keep")&&_.find("img.hotspot_only_image").removeClass("hotspot_clicked").hide(),"temporary"==r&&_.find("div.qwiz_hotspot_label").removeClass("hotspot_clicked").hide(),"label_prompt"==o){l="❌";const e=_.find(`div.qwiz_hotspot_label.qwiz_hotspot${i} div.qwiz_hotspot_label_editable`).html();var p;e&&!qqc.is_only_tags_and_whitespace(e)&&(l+='You clicked on: <span style="color: red;">'+e+"</span><br />"),(p=d.find("span.hotspot_label_feedback_incorrect_content")).length?(l+=p.html(),qqc.is_only_tags_and_whitespace(l)?l+=q.canned_feedback(!1):l=l.replace(/ /g," ")):l+=q.canned_feedback(!1),l+="<div><b>"+T("Please try again.  Click on")+":</b></div>"}z.find("div.hotspot_click_feedback").html(l);const g=T("label_prompt"==(!o||o)?"Correctly clicked":"Found");if(q.display_diagram_progress(e,g),!q.preview&&qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b){qwizdata[e].record_start_b&&record_response(e,qwizdata[e].qrecord_id,{type:"start"});if(setTimeout((function(){const s=qwizdata[e].hotspot_labels[t],_=s[m];let o="";if(i!=c){const e=hotspot_indexof(a,i);-1!=e&&(o=s[e]),o+="\t"}let n={q_and_a_text:btoa(encodeURIComponent(qwizdata[e].q_and_a_text[t])),q_and_a_crc32:qwizdata[e].q_and_a_crc32[t],i_question:qwizdata[e].dataset_id[t],unit:qwizdata[e].unit[t],level:qwizdata[e].level[t],type:"hotspot_diagram",response:o+_,correct_b:"",confirm:"js"};record_response(e,qwizdata[e].qrecord_id,n)}),100),w){setTimeout((function(){let i={q_and_a_text:btoa(encodeURIComponent(qwizdata[e].q_and_a_text[t])),q_and_a_crc32:qwizdata[e].q_and_a_crc32[t],i_question:qwizdata[e].dataset_id[t],unit:qwizdata[e].unit[t],level:qwizdata[e].level[t],type:"hotspot_diagram",response:"done",correct_b:h?1:"",confirm:"js"};record_response(e,qwizdata[e].qrecord_id,i,!0)}),600)}}};var delay_hide_hotspot_no=-1;function show_hotspot_on_hover(){debug[0]&&console.log("[show_hotspot_on_hover] event:",event);const e=$(event.target).parents("div.qwizq"),t=e[0].id.match(/qwiz(\d+)/)[1],i=qwizdata[t].i_question,a=qwizdata[t].current_xy_hotspot_no;var s=event.target.className;if(-1==s.indexOf("qwiz_hotspot_label")){const e=$(event.target).parents("div.qwiz_hotspot_label");s=e.length?e[0].className:""}if(s){const _=s.match(/qwiz_hotspot(\d+)/);if(_){const s=_[1];if(s==a||s==delay_hide_hotspot_no){clearTimeout(hotspot_label_hide_id),delay_hide_hotspot_no=-1,qwizdata[t].on_hotspot_label=!0;const a=qwizdata[t].hotspot_labels_stick[i];if(a&&-1==a.indexOf("keep")&&-1==a.indexOf("temporary")){const t=e.find("div.qwiz_hotspot_label.qwiz_hotspot"+s);t.off("mouseleave"),t.on("mouseleave",(function(){t.hide(),t.off("mouseleave")}))}}return}}qwizdata[t].on_hotspot_label=!1;const _=is_xy_hotspot(t,i,event.offsetX,event.offsetY);if(_!=a){if(_){1==qwizdata[t].user_question_number&&$("div#icon_qwiz"+t).hide();const e=qwizdata[t].hotspot_user_interaction[i];if(e&&"find_hotspots"==e){const e=qwizdata[t].hotspot_nos[i],a=hotspot_indexof(e,_);if(Math.abs(e[a])>1e3)return}}const s=qwizdata[t].$hotspot_image_stack[i],n=qwizdata[t].hotspot_user_interaction[i],r=function(){const a=qwizdata[t].show_hotspots[i];if(a&&"always"!=a&&-1==a.indexOf("hide")){var o=qwizdata[t].find_the_dot[i]?.hotspot_only_new_f;const e="qwiz_layer"+_;if(!o){var r=s.find("img."+e);o=0==r.length}if(o){const a=qwizdata[t].ctx[i],o=q.create_hotspot_image(t,i,_,s,a);s.append('<img class="'+e+' hotspot_image_layer hotspot_only_image" />'),(r=s.find("img."+e))[0].src=o}r.show()}if(n&&"info_only"==n){const a=qwizdata[t].hotspot_labels_stick[i];if(a&&-1!=a.indexOf("hover_show")){debug[0]&&console.log("[show_hotspot_on_hover2] (label) new_xy_hotspot_no:",_),-1!=a.indexOf("keep")&&e.find("div.qwiz_hotspot_label").css({opacity:.5});e.find("div.qwiz_hotspot_label.qwiz_hotspot"+_).css({display:"inline-block",opacity:1})}const s=qwizdata[t].hotspot_nos[i],o=hotspot_indexof(s,_);s[o]<1e3&&(qwizdata[t].n_labels_correct++,qwizdata[t].n_hotspots_to_do[i]--,q.display_diagram_progress(t,T("Visited")),s[o]+=1e3)}};qwizdata[t].current_xy_hotspot_no=_;var o="";if(a>0){debug[0]&&console.log("[show_hotspot_on_hover (hide previous)] prev_xy_hotspot_no:",a,", new_xy_hotspot_no:",_);const r=qwizdata[t].hotspot_labels_stick[i],d=s.find("img.qwiz_layer"+a).not("img.hotspot_keep");if(o="hide",0==_){const e=qwizdata[t].show_hotspots[i];n&&"info_only"==n&&e&&-1!=e.indexOf("keep")&&(o=""),o&&r&&-1!=r.indexOf("hover_show")&&n&&"info_only"==n&&(o="delay")}if(o&&(d.hide(),n&&"info_only"==n)){const s=qwizdata[t].hotspot_labels_stick[i];if(s&&-1!=s.indexOf("hover_show")&&-1==s.indexOf("keep")&&-1==s.indexOf("temporary")){const t=e.find("div.qwiz_hotspot_label.qwiz_hotspot"+a);if("delay"==o){const e=function(){t.hide()};clearTimeout(hotspot_label_hide_id),hotspot_label_hide_id=setTimeout(e,700),delay_hide_hotspot_no=a}else t.hide()}else e.find("div.qwiz_hotspot_label").css({opacity:1})}}if(_){const e=qwizdata[t].show_hotspots[i];e&&-1!=e.indexOf("long_hover_show")?(clearTimeout(hotspot_long_hover_id),hotspot_long_hover_id=setTimeout(r,700)):r()}}}function hide_hotspots(e){debug[0]&&console.log("[hide_hotspots] e:",e);const t=$(event.target).parents("div.qwizq")[0].id.match(/qwiz(\d+)/)[1],i=qwizdata[t].i_question;qwizdata[t].current_xy_hotspot_no=-1,clearTimeout(hotspot_long_hover_id);const a=qwizdata[t].show_hotspots[i],s=qwizdata[t].hotspot_user_interaction[i];var _=!1;if(s&&"info_only"==s){const e=qwizdata[t].hotspot_labels_stick[i];if((_=e&&-1!=e.indexOf("hover_show")&&-1==e.indexOf("keep"))&&qwizdata[t].on_hotspot_label)return}a&&-1==a.indexOf("hide")&&(-1!=a.indexOf("temporary")||-1!=a.indexOf("keep")?($(e.currentTarget).find("img.hotspot_only_image").not("img.hotspot_keep").hide(),_&&$(e.currentTarget).find("div.qwiz_hotspot_label").not("div.hotspot_temporary").not("div.hotspot_keep").hide()):($(e.currentTarget).find("img.hotspot_only_image").hide(),_&&$(e.currentTarget).find("div.qwiz_hotspot_label").hide()))}function add_sub_color_variant(e,t,i,a=4){var s=e;const _=t*i*a;return e+_<=255?s+=_:s-=_,s}function rgb_same(e,t){return Math.abs(e-t)<=3}function hotspot_indexof(e,t){var i=-1;const a=e.length;for(var s=0;s<a;s++)if(Math.abs(e[s]%1e3)==t){i=s;break}return i}function is_xy_hotspot(e,t,i,a){const s=qwizdata[e].hotspot_image_width[t],_=qwizdata[e].hotspot_image_height[t],o=qwizdata[e].spotmap[t],n=qwizdata[e].spotmap_width[t],r=qwizdata[e].spotmap_height[t],d=qwizdata[e].sparsemap[t],q=Math.floor(i/s*n),c=Math.floor(a/_*r);var l;return d?(l=0,o[q]&&o[q][c]&&(l=o[q][c])):l=o[c*n+q],debug[0]&&console.log("[is_xy_hotspot] ix:",i,", iy:",a,", hotspot_no:",l),l}function pick_random_hotspot(e,t){const i=qwizdata[e].hotspot_nos[t],a=qwizdata[e].n_hotspots[t];var s=Math.floor(Math.random()*a),_=0;const o=Math.random()<.5?-1:1;for(var n=0;n<a;n+=o){const e=Math.abs(i[s]);if(e<1e3){_=e;break}(s+=o)>=a?s=0:s<0&&(s=a-1)}return 0==_&&alert("Sorry, error: no hotspot"),debug[0]&&(console.log("[pick_random_hotspot] hotspot_nos:",i),console.log("[pick_random_hotspot] hotspot_no:",_)),_}function set_hotspot_label_query(e,t,i,a){var s="";if(!a){const i=qwizdata[e].current_query_hotspot_no[t];s=qwizdata[e].$hotspot_image_stack[t].find("div.qwiz_hotspot_label.qwiz_hotspot"+i).html()}i.find("div.hotspot_label_query").html(s)}function process_qwizzled(e,t,i,a,s){debug[0]&&console.log("[process_qwizzled] question_htm: ",i);var _="",o=s.match(/\[(<code><\/code>)*q([^\]]*)\]/m);if(o){var n=o[2];
13n&&(_=(_=get_attr(n=qqc.replace_smart_quotes(n),"labels")).toLowerCase(),debug[0]&&console.log("[process_qwizzled] labels_position:",_))}var r='<div id="qwiz'+e+"-q"+t+'" ';q.qwizard_b?i=qqc.shortcodes_to_video_elements(i):r+='onmouseover="'+qname+'.init_drag_and_drop (this)" ',r+='class="qwizq qwizzled"><table class="qwizzled_table"><tr class="qwizzled_table">'+i,debug[0]&&console.log("[process_qwizzled] new_htm: ",r);var d=r.indexOf('<div class="qwizzled_canvas');if(-1==d)return errmsgs.push(T('Did not find target "drop-zones" for labels. Please check that all labels and target "drop zones" were correctly processed and saved during the edit of this page')+". qwiz: "+(e+1)+", "+T("question")+" "+(t+1)),"";var c=qqc.find_matching_block(r.substr(d));if(!c)return errmsgs.push('Did not find end of image area. Please check that all labels and target "drop zones" were correctly processed and saved during the edit of this page.'),"";set_qwizard_data_b&&(qw.questions_cards[t].type="labeled_diagram",qw.questions_cards[t].question_text=c,qw.questions_cards[t].labels=[],qw.questions_cards[t].feedback_corrects=[],qw.questions_cards[t].feedback_incorrects=[]);var l=r.substr(d+c.length);r=r.substr(0,d+c.length);var w="qwizzled_canvas-qwiz"+e+"-q"+t,h='<td class="qwizzled_table"><div id="'+w+'"'+c.substring(4)+"</td>";if(h=h.replace('class="','class="'+w+" "),qwizdata[e].qrecord_id)if(qqc.isInteger(qwizdata[e].dataset_id[t])){var u=qqc.remove_tags_eols(i);qwizdata[e].q_and_a_text[t]=qqc.q_and_a_hash(u),qwizdata[e].q_and_a_crc32[t]=qwiz_crc32(i),debug[0]&&(console.log("[process_qwizzled] qwizdata[i_qwiz].q_and_a_text[i_question]:",qwizdata[e].q_and_a_text[t]),console.log("[process_qwizzled] qwizdata[i_qwiz].q_and_a_crc32[i_question]:",qwizdata[e].q_and_a_crc32[t]))}else qwizdata[e].q_and_a_text[t]=qwizdata[e].dataset_id[t],qwizdata[e].q_and_a_crc32[t]="dataset";var z="";"left"==_&&(z=' style="padding-right: 5px;"');var m="";"top"!=_&&"bottom"!=_&&(m=" qwizzled_labels_left_right");var p,g='<td class="qwizzled_table qwizzled_labels'+m+'"'+z+'><div class="qwizzled_labels_border">Q-LABELS-Q<div style="clear: both;"></div>\n</div></td>';p="top"==_?g+'</tr><tr class="qwizzled_table">'+h+"</tr>":"bottom"==_?h+'</tr><tr class="qwizzled_table">'+g+"</tr>":"left"==_?g+h+"</tr>":h+g+"</tr>",debug[0]&&console.log("[process_qwizzled] table_html.substr (0, 100):",p.substr(0,100)),p+='<tr class="qwizzled_table"><td class="qwizzled_table qwizzled_feedback" colspan="2">QWIZZLED-FEEDBACK-Q</td></tr></table>',r=(r=r.replace(c,p)).replace(/\[(<code><\/code>)*q[^\]]*\]/,""),debug[0]&&(console.log("[process_qwizzled] new_htm:",r),console.log("[process_qwizzled] remaining_htm:",l)),l=l.replace(/\[(<code><\/code>)*l\]/gm,"");for(var b=[],f=0;;){var v=l.search(/<div[^>]+class=".*?qwizzled_label/m);if(-1==v)break;var y=qqc.find_matching_block(l.substr(v));debug[0]&&console.log("[process_qwizzled] label_div:",y);var x='<li><div id="label-qwiz'+e+"-q"+t+"-a"+f+'"'+y.substr(4)+"</li>";b.push(x),set_qwizard_data_b&&qw.questions_cards[t].labels.push(y),l=l.replace(y,""),f++}debug[0]&&console.log("[process_qwizzled] label_divs:",b);var k;k="top"==_||"bottom"==_?'<ul class="qwizzled_labels qwizzled_labels_inline">':'<ul class="qwizzled_labels qwizzled_labels_std">',r=r.replace("Q-LABELS-Q",'<p class="qwizzled_label_head qwizzled_label_head_standard">Move each item to its correct <span class="qwizzled_target_border">place</span></p>\n<p class="qwizzled_label_head qwizzled_label_head_mobile">Click an item, then its correct <span class="qwizzled_target_border">place</span></p>\n<p class="qwizzled_label_head qwizzled_label_head_label_clicked">Click the correct <span class="qwizzled_target_border">place</span> for the label</p>'+k+b.join("\n")+"</ul>");for(var $=l,A=[],C=["[f*]","[fx]"],I=["[f*]","[fx]","[x]",'<div class="qwizzled_question_bottom_border_title"'],O=0;;){var j,S=qqc.parse_html_block($,C,I);if("NA"==S)break;$=$.replace(S,""),j=-1!=S.search(/\[f\*\]/)?"c":"x",S=S.replace(/\[f[\*x]\]/,""),debug[2]&&console.log("[process_qwizzled] feedback_item_html: ",S),A.push(create_feedback_div_html(e,t,parseInt(O/2,10),S,j)),set_qwizard_data_b&&("c"==j?qw.questions_cards[t].feedback_corrects.push(S):qw.questions_cards[t].feedback_incorrects.push(S)),O++}
13debug[0]&&(console.log("[process_qwizzled] feedback_divs:",A),console.log("[process_qwizzled] feedback_html:",$));var E=b.length,M=A.length;2*E!=M&&errmsgs.push(T("Number of feedback items")+" ("+M+") "+T("does not match number of labels")+" ("+E+"). qwiz: "+(1+e)+", question "+(1+t)+" labeled diagram\n("+T("There should be two feedback items -- correct and incorrect -- for each label")+")");var R='<div class="qwiz-feedback" id="qwiz'+e+"-q"+t+'-ff"></div>\n';return A.push(R),r=r.replace("QWIZZLED-FEEDBACK-Q",A.join("")),r+="</div>\n",set_qwizard_data_b&&(qw.questions_cards[t].n_labels=E),debug[2]&&console.log("[process_qwizzled] new_htm: ",r),r}function process_header(e,t,i,a){var s=["[q]","[q ",'<div class="qwizzled_question'];if(null!=a&&s.push("[i]"),"NA"!=(header_html=qqc.parse_html_block(e.substr(0,1e3),["[h]"],s,!0))&&""!=header_html){var _=e.substr(0,200);_=qqc.trim(_);var o=qqc.opening_tag_shortcode_pos("[h]",_);_=_.substr(o,5);var n=header_html.replace(/<br[^>]*>/g,"");_!=(n=qqc.trim(n).substr(0,5))&&errmsgs.push(T("Text before header")+" [h]. qwiz: "+(t+1)),e=e.replace(header_html,""),header_html=header_html.replace(/\[h\]/gi,""),header_html=(header_html=qqc.balance_closing_tag(header_html)).replace(/<(p|h[1-6])[^>]*><\/(p|h[1-6])>/g,""),header_html=qqc.decode_image_tags(header_html)}return e}function qwiz_times_histogram_class_everyone_html(e,t,i){var a;a=1!=document_qwiz_school_id?T("Your class"):T("Independent students");var s="",_="";qwizdata[e].leaderboard_class_everyone?s=" checked":_=" checked";var o="";i&&(o=' style="right: 5px; top: 12px;"');return'<div class="qwiz_times_histogram_class_everyone"'+o+'><label><input type="radio" name="qwiz_times_histogram_class_everyone" class="qwiz_radio_smaller_shift" onclick="'+qname+".qwiz_times_histogram_class_everyone (0, "+e+", "+t.summary+')"'+_+" />"+a+'</label><br /><label><input type="radio" name="qwiz_times_histogram_class_everyone" class="qwiz_radio_smaller_shift" onclick="'+qname+".qwiz_times_histogram_class_everyone (1, "+e+", "+t.summary+')"'+s+" />"+T("Everyone")+"</label></div>"}function pick_emoji(e,t){const i=$("input.qwiz_times_histogram_initials-qwiz"+t)[0];i.value=leaderboard_initials_ok(i.value+e.detail.unicode)}function leaderboard_initials_ok(e){if("fuk"==e.toLowerCase())return"";const t=Array.of(...e),i=t.length;for(var a=0,s="",_=0;_<i&&(""==t[_]||(s+=t[_],3!=++a));_++);return s}function qwiz_times_histogram_initials_html(e,t,i){t||(t=0);const a=qqc.get_qwiz_param("url","./");return'<div class="qwiz_times_histogram_initials"><input class="qwiz_times_histogram_initials qwiz_times_histogram_initials-qwiz'+e+'" oninput="'+qname+'.check_leaderboard_initials (this)" title="'+T("Identify yourself - initials, other characters, or emojis! (optional)")+'" value="'+i+'" /> <svg class="qwiz_times_histogram_initials" onclick="'+qname+".show_hide_emoji_picker ("+e+')" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><title>'+T("Show/hide emoji picker")+'</title><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"></path></svg> <button class="qwiz_times_histogram_initials" onclick="'+qname+".update_leaderboard_initials ('', this, "+e+", "+t+')">'+T("Save")+'</button><div class="emoji-picker emoji-picker-qwiz'+e+'"><emoji-picker></emoji-picker><img class="icon_emoji_picker_exit" onclick="jQuery (\'div.emoji-picker-qwiz'+e+'\').hide ()" src="'+a+'/images/icon_exit_bw.jpg" /></div></div></div>'}function stats(e){const t=[...e].sort((function(e,t){return t-e})),i=t.length,a=t[0],s=t[i-1];for(var _,o=0,n=0;n<i;n++)o+=t[n];if(i%2){_=t[(i-1)/2]}else{const e=i/2;_=.5*(t[e-1]+t[e])}return{min:s,max:a,median:_,mean:o/i,sorted:t}}function shuffle(e){for(var t=e.length-1;t>0;){const i=Math.floor(Math.random()*(t+1)),a=e[t];e[t]=e[i],e[i]=a,t--}debug[0]&&console.log("[shuffle] a:",e)}function check_qwiz_tag_pairs(e){var t="",i=e.match(/\[qwiz|\[\/qwiz\]/gm);if(i){var a=i.length,s=!1;if(a%2!=0)s=!0;else for(var _=0;_<a;_++)if(_%2==0){if("[qwiz"!=i[_]){s=!0;break}}else if("[/qwiz]"!=i[_]){s=!0;break}if(s){debug[0]&&console.log("[check_qwiz_tag_pairs] (error_b) htm.substr (0, 1000):",e.substr(0,1e3));const i=e.search(/<[pa] class="more-link|<div class="(search|blog)-entry-readmore/);if(-1!=i){const a=e.indexOf("[qwiz");t=-1!=a?e.substring(0,a)+e.substr(i):e}else if(-1!=e.indexOf('class="entry-summary')){const i=e.indexOf("[qwiz"),a=e.search(/\s*\[\u2026\]/);t=-1!=i&&-1!=a?e.substring(0,i)+e.substr(a):e}else errmsgs.push(T("Unmatched [qwiz] - [/qwiz] pairs.")),t="NA";debug[0]&&console.log("[check_qwiz_tag_pairs] (error_b) new_htm:",t)}}return t}function create_radio_button_html(e,t,i,a){var s="",_="",o=0;"[c*]"==a&&(_='data-q="1" ',o=1);var n="";return q.qwizard_b&&(n=' title="'+T("Click to see feedback for this answer choice")+'"'),s+='<input type="radio" id="radio-qwiz'+e+"-q"+t+"-a"+i+'" name="qwiz'+e+"-q"+t+'" '+_+' class="qwiz_choice_radio"'+n+" />\n",debug[1]&&console.log("[create_radio_button_html] htm: ",s),{correct:o,htm:s}}function process_choice_disable(e,t){"mobile"==e.substr(0,6)&&(e=e.substr(7),t=t.substr(7));var i=document.getElementById("radio-"+e);
13i&&(i.checked=!0,q.qwizard_b||q.preview||$("input[name="+t+"]").attr("disabled",!0),$(`#${t} .choices-${t}, #${t} .choices-${t} .qwiz-choice`).css({cursor:"auto",color:"black"}))}function show_generated_custom_feedback(e){debug[0]&&console.log("[show_generated_custom_feedback] data:",e);const t=e.i_qwiz,i=e.i_question;var a=e.custom_feedback;e.hint_f;$(`div.qwiz${t}-q${i}-spinner`).hide(),$(`#show_answer_got_it_or_not-qwiz${t}-q${i}`).css({opacity:1}),$(`#mobile_show_answer_got_it_or_not-qwiz${t}-q${i}`).css({opacity:1});const s=$(`div.qwiz${t}-q${i}-a0_gen`);var _=a.match(/\*\*[^\*]{4,}\*\*/m);if(_)a=marked.parse(a);else if(_=a.match(/<body[^>]*>/m)){const e=_.index+_[0].length,t=a.indexOf("</body>");a=t>0?a.substring(e,t):a.substr(e)}else{var o=a.indexOf("```html");if(-1!=o){const e=(a=qqc.trim(a)).length;a=a.substring(o+7,e-3),debug[0]&&console.log("[show_generated_custom_feedback] (removing ```html) custom_feedback:",a)}else-1!=(o=a.indexOf("html:"))&&(a=a.substr(o+5)),(_=a.match(/<p|<h|<li/))||(a=`<pre style="white-space: pre-wrap">${a}</pre>`)}s.css({"font-size":"10pt"}).html(a).show(),e.error_f&&$(`div#qwiz${t}-q${i} button.show_the_answer`).removeClass("qwiz_button_disabled").removeAttr("disabled")}function create_got_it_or_not(e,t,i,a){a||(a="");var s=[];if(s.push('<div id="'+e+"show_answer_got_it_or_not-qwiz"+t+"-q"+i+'" class="show_answer_got_it_or_not">\n'),a){const e=`${qname}.view_answer_guide (this, ${t}, ${i})`;s.push(`<button class="qwiz_button view_answer_guide" style="color: black; background: white; border: 1px solid gray;" onclick="${e}">`),s.push(T("View answer guide")),s.push("</button>")}return s.push(`<button class="qwiz_button" onclick="${qname}.process_choice (event, '${e}qwiz${t}-q${i}-a0', false, 1, '${a}')">`),s.push(T("Show me again later")),s.push("</button>"),s.push(" "),s.push(`<button class="qwiz_button ok_ive_got_it" onclick="${qname}.process_choice (event, '${e}qwiz${t}-q${i}-a0', true, 1, '${a}')">`),s.push(T("OK, I've got it!")),s.push("</button>"),s.push("</div>"),s.join("\n")}function update_topic_statistics(e,t,i){var a=qwizdata[e].question_topics[t];if(a)for(var s=0;s<a.length;s++){var _=a[s];i?qwizdata[e].topic_statistics[_].n_correct++:qwizdata[e].topic_statistics[_].n_incorrect++}}function update_progress_show_next(e){if(qwizdata[e].question_time_limit&&stop_timer(e,!0,!0),qwizdata[e].n_questions>1||qwizdata[e].use_dataset||qwizdata[e].combo){q.display_progress(e);var t=qwizdata[e].n_correct;if(qwizdata[e].repeat_incorrect_b||(t+=qwizdata[e].n_incorrect),t==qwizdata[e].n_questions_for_done&&!qwizdata[e].combo&&(qwizdata[e].summary_b?$("#next_button_text-qwiz"+e).html(T("View summary report")):$("#summary-qwiz"+e).show(),qwizdata[e].qwiz_timer&&qwizdata[e].n_qs&&(stop_timer(e),qwizdata[e].n_qs_done.size==qwizdata[e].n_qs&&(qwizdata[e].n_qs_done=new Set)),qwizdata[e].$question_timer&&qwizdata[e].$question_timer.hide(),qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b&&(qwizdata[e].use_dataset||qwizdata[e].repeat_incorrect_b||0==qwizdata[e].n_incorrect))){setTimeout((function(){record_response(e,qwizdata[e].qrecord_id,{type:"completed",confirm:"js"},!0)}),2e3)}(t<qwizdata[e].n_questions_for_done||qwizdata[e].summary_b)&&q.position_show_next_button(e),qwizdata[e].next_button_show_b=!0}if(1==qwizdata[e].n_questions&&($("#qwiz"+e+" div.single-question_exit").show(),qwizdata[e].question_timer_interval_id)){$("div#overlay-times-up-qwiz"+e).is(":visible")||stop_timer(e)}}function create_feedback_div_html(e,t,i,a,s,_){var o="";null!=s&&(o=s);var n=`<div id="qwiz${e}-q${t}-a${i}${o}" class="qwiz-feedback">\n`;o||(n+='<hr style="margin: 0px;" />\n');if(o)n+='<div class="'+("c"==o?"qwizzled-correct_feedback":"qwizzled-incorrect_feedback")+' qwiz_editable" data-i_choice="'+i+'">'+a+"</div>";else{q.qwizard_b&&(a=qqc.shortcodes_to_video_elements(a));n+=`<div class="qwiz-feedback-div qwiz_editable" data-i_choice="${i}"${""}>\n ${a=create_restart_button(e,a,!0)}\n </div>`}return n+='<div style="clear: both;"></div>\n',n+="</div>\n",_&&(n+=`<div class="qwiz${e}-q${t}-a${i}_gen qwiz-feedback"></div>\n`),debug[2]&&console.log("[create_feedback_div_html] htm: ",n),n}this.hotspot_color_from_no=function(e,t=!1){var i;const a=e-1;if(i=[[202,198,191],[143,131,102],[239,210,130],[106,80,0],[251,209,30],[0,210,255],[0,123,201],[0,86,234],[123,132,147],[218,227,243]][a%10],a>9){const e=[[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,1,0],[1,1,1]][t?Math.floor(a/10)%5:a%5],s=Math.floor(a/60)+1,_=t?5:4;i[0]=add_sub_color_variant(i[0],e[0],s,_),i[1]=add_sub_color_variant(i[1],e[1],s,_),i[2]=add_sub_color_variant(i[2],e[2],s,_)}return i.push(q.hotspot_alpha_value),i},this.init_drag_and_drop=function(e){debug[0]&&console.log("[init_drag_and_drop] qwizq_elm:",e);var t=$(e);t.removeAttr("onmouseover"),t.find("td.qwizzled_labels div.qwizzled_label").each((function(){(debug[0]||debug[8])&&(console.log("[init_drag_and_drop] $ (this):",$(this)),console.log("[init_drag_and_drop] 'td.qwizzled_labels div.qwizzled_label':",$(this)[0]));
13var e=$(this).offset();debug[8]&&console.log("[init_drag_and_drop] label_offset:",e),$(this).data("label_x",e.left).data("label_y",e.top),$(this).draggable({containment:$(this).parents("table.qwizzled_table"),start:function(e,t){var i=$(this).parents("div.qwiz");if(i.length){var a=i[0];a.qscale_fac&&(a.qstart_left=t.position.left,t.position.top?a.qstart_top=t.position.top:a.qstart_top=.1)}q.label_dragstart($(this))},drag:function(e,t){var i=$(this).parents("div.qwiz");if(i.length){var a=i[0];if(a.qscale_fac&&a.qstart_top){var s=a.qscale_fac;t.position.left=(t.position.left-a.qstart_left)/s+a.qstart_left,t.position.top=(t.position.top-a.qstart_top)/s+a.qstart_top}}}}).addClass("qwizzled_label_unplaced")})),t.find(".qwizzled_target").droppable({accept:".qwizzled_label",hoverClass:"qwizzled_target_hover",drop:function(e,t){q.label_dropped($(this),t.draggable)},tolerance:"pointer"})},this.display_summary_and_exit=function(e){if(q.qwizard_b||$(".bck-question-qwiz"+e).css({opacity:.5}).addClass("hover"),qwizdata[e].summary_b){var t,i=[],a=qwizdata[e].n_questions_for_done,s=qwizdata[e].n_correct,_=qwizdata[e].n_incorrect;if(qwizdata[e].repeat_incorrect_b){var o=qwizdata[e].use_dataset&&qwizdata[e].dataset_intro_f?"set":"quiz";i.push("<p><b>"+T("Congratulations, you're done!")+"</b></p>"),t=(t=T(0==_?"quiz"==o?"In this %s-question quiz you answered every question correctly on the first try!":"In this %s-question set you answered every question correctly on the first try!":"quiz"==o?1==_?"In finishing this %s-question quiz you entered one incorrect answer":"In finishing this %s-question quiz you entered %s incorrect answers":1==_?"In finishing this %s-question set you entered one incorrect answer":"In finishing this %s-question set you entered %s incorrect answers")).replace("%s",qqc.number_to_word(a)),_>1&&(t=t.replace("%s",qqc.number_to_word(_)))}else t=0==_?T("Congratulations, you answered all questions correctly"):(t=(t=T("Your score is %s out of %s questions")).replace("%",qqc.number_to_word(s))).replace("%",qqc.number_to_word(a));i.push("<p>"+t+"</p>");var n=0;if(qwizdata[e].topics&&(n=qwizdata[e].topics.length),1==n){const t=qwizdata[e].topics[0];if("Other"!=t){const e=t.replace(/^(\d\.\d+-*(\d\.*\d*)*[\., _]*)*/,"").replace(/_/g," ");var r;1==a?i.push("<p>The question was about topic “"+e+".”</p>"):(r=2==a?T("Both"):T("All")+" "+qqc.number_to_word(a),i.push("<p>"+r+" "+plural(T("question"),T("questions"),a)+" were about topic “"+e+".”</p>"))}}else if(n>1&&_>0){for(var d=[],c=0;c<n;c++){var l=qwizdata[e].topics[c];const t=l.replace(/^(\d\.\d+-*(\d\.*\d*)*[\., _]*)*/,"").replace(/_/g," ");qwizdata[e].topic_statistics[l].n_correct;var w=qwizdata[e].topic_statistics[l].n_incorrect;if(w>0){const e="<strong>"+t+"</strong>: "+qqc.number_to_word(w)+" "+T("incorrect");d.push(e)}}var h=d.length,u=[];if(h>1){u.push(T("These are the topics of questions that you answered incorrectly")),u.push("<ul>");for(var z=0;z<h;z++)u.push("<li>"),u.push(d[z]),u.push("</li>");u.push("</ul>")}else 1==_?u.push(T("The topic of the only question you answered incorrectly is")+"<br />"):u.push(T("The topic of the questions you answered incorrectly is")+"<br />"),u.push(d[0]);i.push(u.join("\n"))}if($("#summary_report-qwiz"+e).html(i.join("\n")),qwizdata[e].qwiz_timer&&!q.qwizard_b&&!q.preview){var m=!0;qwizdata[e].n_qs&&qwizdata[e].n_qs_done.size&&(m=!1,$("#summary_report-qwiz"+e).append("<br />("+T("The leaderboard will be available when you’ve finished all questions in this quiz")+")"));const t=$("div#summary-quiz_times_histogram-qwiz"+e).html("");if(m){const i=`<div style="text-align: center;">\n <img src="${qqc.get_qwiz_param("url","./")}images/spinner40x40.gif" />'\n </div>`;t.html(i);var p={full_quiz_f:1,summary:1};const a=qwizdata[e].qrecord_id;-1!=a.indexOf("finish_times_demo")&&(p.demo_taker_time=qwizdata[e].elapsed_time);var g=0;const s=function(){qwizdata[e].when_done_unix||g>5?qqc.qjax(qname,e,a,"get_quiz_times",p):(g++,setTimeout(s,250))};s()}else t.html("")}}var b=$("#summary-qwiz"+e);if(q.qwizard_b&&0==b.find("div[contenteditable]").length){const t=$(`div#qwiz_exit-qwiz${e} .qwiz_editable`)[0];qwizard.init_tinymce(t)}var f=b.find('input[name="qwiz_img"]');f.length&&f.changeElements("img"),qwizdata[e].cv_index&&b.find("button.qwiz_restart").remove(),b.show(),qwizdata[e].i_question=qwizdata[e].n_questions},this.draw_histogram=function(e){debug[0]&&console.log("[draw_histogram] data:",e);const t=e.i_qwiz,i=1==e.summary?"summary":"leaderboard",a=$("div#"+i+"-quiz_times_histogram-qwiz"+e.i_qwiz);if(qwizdata[t].qwiz_histogram_data=e,e.everyone){qwizdata[t].leaderboard_class_everyone=e.everyone;var s=T("Few or no results available for")+" ";1!=document_qwiz_school_id?s+=T("your class")+".":s+=T("independent students")+".",s+="\n"+T("Showing results for everyone")+".",alert(s)}if(e.errmsg)return alert("Sorry, unable to retrieve data for your classes"),!1;if(0==e.i_takers.length)return void a.html("(No data available for fastest-times graph)");if(1==e.i_takers.length){var _;if("summary"==i)_=1!=document_qwiz_school_id?T("You’re the first person in your class to take this quiz!"):T("You’re the first independent student to take this quiz!"),_+=" "+T("You can enter your initials")+":<br />"+qwiz_times_histogram_initials_html(t,qwizdata[t].quiz_elapsed_time_id,"")+"<br />"+T("Come back later (green down-triangle > “Fastest finish times”) to see more")+".",a.html(_),a.find("emoji-picker").on("emoji-click",(function(){pick_emoji(event,t)}));else _=1!=document_qwiz_school_id?T("Only one person in your class has taken this quiz."):T("Only one independent student has taken this quiz."),_+="<br />"+T("Come back later (green down-triangle > “Fastest finish times”) to see more")+"."+qwiz_times_histogram_class_everyone_html(t,e,!0),a.html(_);return}(_=[]).push('<div class="qwiz_times_histogram_title">'),_.push("</div>"),_.push('<div class="qwiz_times_histogram">');const o=document_qwiz_maker_privileges?' style="max-height: 200px; overflow: auto;"':"";_.push('<div class="qwiz_times_histogram_legend"'+o+">"),_.push('<div class="qwiz_times_histogram_legend_header">'),_.push("</div>"),_.push('<div class="qwiz_times_histogram_legend_content">'),_.push("</div>"),_.push("</div>"),_.push('<div class="qwiz_times_histogram_h_label">'),_.push("<b>"+T("Finish time (min:sec)")+" (<i>"+T("faster")+"</i></b> ➔<b>)</b>"),_.push("</div>"),_.push('<div class="qwiz_times_histogram_v_label qwiz_times_histogram_v_axis">'),_.push("<b>"+T("Number done")+"</b>"),_.push("</div>"),_.push("</div>"),a.html(_.join("\n"));const n=e.times,r=stats(n);debug[0]&&console.log("[draw_histogram] r:",r);const d=10*parseInt(3*r.median/10)+10;if(r.sorted[0]>d){for(var c=1;r.sorted[c]>d;)c++;r.max=r.sorted[c],debug[0]&&console.log("[draw_histogram] r.max:",r.max)}const w=n.length;var h=15;w<25?h=10:w>40&&(h=20);const u=r.max-r.min+.01,z=u/h,m=(z/u*100).toFixed(2),p=z/u*50;var g=new Array(h).fill(0),b=[],f=0;for(c=0;c<w;c++){if(n[c]<=r.max){g[Math.floor((n[c]-r.min)/z)]++,f++}b.push([n[c],c])}b.sort((function(e,t){return e[0]-t[0]}));var v,y=[],x=-1;for(c=0;c<w;c++){const e=b[c][0];e>x&&(x=e,v=c),y[b[c][1]]=v}debug[0]&&(console.log("[draw_histogram] bin_width:",z),console.log("[draw_histogram] bin_counts:",g),console.log("[draw_histogram] times_for_rank:",b),console.log("[draw_histogram] ranks:",y));for(var k=0,A=0;A<h;A++)k=Math.max(k,g[A]);const C=a.find("div.qwiz_times_histogram"),I=(e.quiz_header?e.quiz_header:T("times this quiz"),qqc.hhmmss_from_sec(d)),O=f==w?""
13:" "+T("within")+" "+I+" "+T("cutoff");var j;if(document_qwiz_user_logged_in_b){j=1!=document_qwiz_school_id?document_qwiz_maker_privileges?T("Quizzes done by your classes"):T("Quizzes done by your class"):T("Quizzes done most recently by independent students"),qwizdata[t].leaderboard_class_everyone&&(j=T("Quizzes done most recently"));const s=qwiz_times_histogram_class_everyone_html(t,e);"summary"==i?$("div#summary-qwiz"+t).append(s):a.append(s)}else j=T("Quizzes done most recently");const S=j+O+": "+f;$("div.qwiz_times_histogram_title").html(S),qwizdata[t].$qwiz_times_histogram=C;for(A=0;A<h;A++){if(g[A]){const e='<div class="qwiz_times_histogram_bar qwiz_times_histogram_bar'+A+'" style="right: '+((A+.5)/h*100-p).toFixed(2)+"%; width: calc("+m+"% + 1px); height: "+(g[A]/k*100).toFixed(2)+'%;"><div class="qwiz_times_histogram_bar_label">'+g[A]+"</div>";C.append(e);const t='<div class="qwiz_times_histogram_bin_label" style="right: '+((A+.5)/h*100).toFixed(2)+'%;">'+g[A]+"</div>";C.append(t)}const e='<div class="qwiz_times_histogram_bin_marker" style="right: '+(A/h*100).toFixed(2)+'%;"></div>';C.append(e)}const E=e.dates;var M=e.i_takers;const R=e.initialss,Y=e.quiz_elapsed_time_ids,B=stats(E);var N=-1;const F=qwizdata[t].when_done_unix;if("summary"==i)for(c=0;c<w;c++)M[c]==e.i_taker&&(E[c]==F?N=c:E[c]<0&&(N=c,E[c]=-E[c]));debug[0]&&console.log("[draw_histogram] i_takers:",JSON.parse(JSON.stringify(M)));if(-1==qwizdata[t].qrecord_id.indexOf("finish_times_demo")){var L=-1;for(c=0;c<w;c++)L=Math.max(L,M[c]);var W=[...Array(L+1).keys()];shuffle(W);for(c=0;c<w;c++){const e=M[c];M[c]=W[e]}e.i_taker=W[e.i_taker],e.i_takers=M,debug[0]&&console.log("[draw_histogram] i_takers:",JSON.parse(JSON.stringify(M)))}const G=(B.max-B.min+.01)/9;for(c=0;c<w;c++)if(n[c]<=r.max){const i=Math.floor((B.max-E[c])/G);var D,Q="qwiz_times_histogram_taker"+M[c];R[c]?(D=T("Student")+": "+R[c],e.i_taker==M[c]&&(D+=" ("+T("you")+")")):(D=T("Student")+": #"+(M[c]+1),e.i_taker==M[c]&&(Q+=" qwiz_times_histogram_taker_color",D=T("Student")+": "+T("you")));const a=((n[c]-r.min)/u*100).toFixed(2),s=qqc.hhmmss_from_sec(n[c]),_=DateFormat.format.date(1e3*E[c],"MMM dd h:ss a");var P=T("Finish time:")+" "+s+"\n"+T("Rank:")+" "+(y[c]+1)+"\n"+T("Done:")+" "+_+"\n"+D+"\n\n"+T("Click to highlight student");const o='<div class="qwiz_times_histogram_marker_target qwiz_times_histogram_marker_target'+y[c]+'" onclick="'+qname+".qwiz_times_histogram_show_student (this, "+t+", "+M[c]+", "+e.i_taker+')" style="right: '+a+'%;" title="'+P+'"><div class="qwiz_times_histogram_marker qwiz_times_histogram_marker'+i+" qwiz_times_histogram_marker_gray "+Q+'"></div></div>';C.append(o)}var U=[];const Z=qwizdata[t].leaderboard_graph_options,H="Graph options"==Z?" selected":"";U.push('<select class="qwiz-bold" onchange="'+qname+".qwiz_times_histogram_leaderboard_graph_change (this.value, "+t+", "+e.summary+')">'),U.push("<option>"),U.push("Leaderboard"),U.push("</option>"),U.push("<option"+H+">"),U.push("Graph options"),U.push("</option>"),U.push("</select>"),C.find("div.qwiz_times_histogram_legend_header").html(U.join("\n")),Z&&"Graph options"==Z?q.qwiz_times_histogram_graph_legend(C,t,e.i_taker):q.qwiz_times_histogram_leaderboard_legend(i,C,t,n,b,y,M,R,Y,N,e.i_taker);const V=u/10;var J;J=V<=5?5:V<=10?10:V<=20?20:V<=30?30:60*Math.floor(V/60+1),debug[0]&&console.log("[draw_histogram] interval_sec:",J);for(var X=J-r.min%J,K=r.min-r.min%J;X<=u;){const e=(X/u*100).toFixed(2),t='<div class="qwiz_times_histogram_h_tick" style="right: '+e+'%;"></div>';C.append(t),K+=J;const i='<div class="qwiz_times_histogram_h_tick_label" style="right: '+e+'%;">'+qqc.hhmmss_from_sec(K)+"</div>";C.append(i),X+=J}const ee=k/8;var te;te=ee<1.5?1:ee<3?2:ee<7.5?5:ee<15?10:20*Math.round(ee/20),debug[0]&&console.log("[draw_histogram] interval:",te);for(var ie=te;ie<=k;){const e=(ie/k*100).toFixed(2),t='<div class="qwiz_times_histogram_v_tick qwiz_times_histogram_v_axis" style="bottom: '+e+'%;"></div>';C.append(t);const i='<div class="qwiz_times_histogram_v_tick_label qwiz_times_histogram_v_axis" style="bottom: '+e+'%;">'+ie+"</div>";C.append(i),ie+=te}const ae=DateFormat.format.date(1e3*B.max,"MMM dd h:ss a"),se=DateFormat.format.date(1e3*B.min,"MMM dd h:ss a");l=[],l.push('<div class="qwiz_times_histogram_date_legend">'),l.push('<div class="qwiz_times_histogram_date_legend_top">'),l.push(ae),l.push("</div>");for(var _e=0;_e<9;_e++)l.push('<div class="qwiz_times_histogram_date_legend_rect qwiz_times_histogram_marker'+_e+'">'),l.push("</div>");if(l.push('<div class="qwiz_times_histogram_date_legend_bot">'),l.push(se),l.push("</div>"),l.push("</div>"),C.append(l.join("\n")),qwizdata[t].qwiz_times_histogram_color_by_date){C.find("div.qwiz_times_histogram_marker").removeClass("qwiz_times_histogram_marker_gray qwiz_times_histogram_taker_color qwiz_times_histogram_taker_color0 qwiz_times_histogram_taker_color1 qwiz_times_histogram_taker_color2 qwiz_times_histogram_taker_color3 qwiz_times_histogram_taker_color4 qwiz_times_histogram_taker_color5 qwiz_times_histogram_taker_color6 qwiz_times_histogram_taker_color7 qwiz_times_histogram_taker_color8"),C.find("div.qwiz_times_histogram_date_legend").show();const e=C.find("input.qwiz_times_histogram_color_by_date");e.length&&(e[0].checked=!0)}if(qwizdata[t].qwiz_times_histogram_show_bin_counts){qwizdata[t].qwiz_times_histogram_show_bars?C.find("div.qwiz_times_histogram_bar_label").show():C.find("div.qwiz_times_histogram_bin_label").show();const e=C.find("input.qwiz_times_histogram_show_bin_counts");e.length&&(e[0].checked=!0)}if(qwizdata[t].qwiz_times_histogram_show_bars){C.find("div.qwiz_times_histogram_bar").show(),C.find("div.qwiz_times_histogram_v_axis").show();const e=C.find("input.qwiz_times_histogram_show_bars");e.length&&(e[0].checked=!0)}},this.qwiz_times_histogram_class_everyone=function(e,t,i){var a={full_quiz_f:1,summary:i,everyone:e};qwizdata[t].leaderboard_class_everyone=e,qqc.qjax(qname,t,qwizdata[t].qrecord_id,"get_quiz_times",a)},this.qwiz_times_histogram_show_student=function(e,t,i,a){const s=qwizdata[t].$qwiz_times_histogram;s.find("div.qwiz_times_histogram_marker_target").removeClass("qwiz_times_histogram_taker_color qwiz_times_histogram_taker_color0 qwiz_times_histogram_taker_color1 qwiz_times_histogram_taker_color2 qwiz_times_histogram_taker_color3 qwiz_times_histogram_taker_color4 qwiz_times_histogram_taker_color5 qwiz_times_histogram_taker_color6 qwiz_times_histogram_taker_color7 qwiz_times_histogram_taker_color8");const _=i==a?"":i%9;s.find("div.qwiz_times_histogram_taker"+i).parent().addClass("qwiz_times_histogram_taker_color"+_);const o=i==a?"You":"Student #"+(i+1);s.find("span.qwiz_times_histogram_legend_student").html(o),s.find("div.qwiz_times_histogram_legend_color").attr("class","qwiz_times_histogram_legend_color qwiz_times_histogram_taker_color"+_),qwizdata[t].i_taker_shown=i},this.qwiz_times_histogram_leaderboard_graph_change=function(e,t,i){qwizdata[t].leaderboard_graph_options=e;var a={full_quiz_f:1,summary:i};-1!=qwizdata[t].qrecord_id.indexOf("finish_times_demo")&&(a.demo_taker_time=qwizdata[t].elapsed_time),qqc.qjax(qname,t,qwizdata[t].qrecord_id,"get_quiz_times",a)},this.qwiz_times_histogram_leaderboard_legend=function(e,t,i,a,s,_,o,n,r,d,c){const l=o.length;var w="";if("summary"==e)for(var h=0;h<l;h++)if(c==o[h]&&n[h]){w=n[h];const e=qqc.addSlashes(w);
13q.update_leaderboard_initials(e,"",i,qwizdata[i].quiz_elapsed_time_id);break}var u=!1,z=[];z.push("<table>"),z.push("<tr>"),document_qwiz_maker_privileges||(z.push("<td>"),z.push("<table>"));const m=qqc.get_qwiz_param("url","./"),p=document_qwiz_maker_privileges?o.length:Math.min(10,o.length);for(h=0;h<p;h++){const t=s[h][1];var g;5!=h||document_qwiz_maker_privileges||(z.push("</table>"),z.push("</td>"),z.push('<td style="border-left: 1px solid gray;">'),z.push("<table>")),document_qwiz_maker_privileges?(z.push('<tr class="quiz_elapsed_time_id'+r[t]+'">'),z.push('<td style="padding: 1px 0 0 0;">'),z.push('<img src="'+m+'/images/delete.png" class="qwiz_icon_smaller" onclick="'+qname+".delete_leaderboard_entry ("+i+", "+r[t]+')" title="'+T("Teachers only: delete this entry")+'" />'),z.push("</td>")):z.push("<tr>"),z.push('<td class="qwiz-bold qwiz-right">'),z.push(_[t]+1),z.push("</td>"),z.push('<td onmouseenter="'+qname+".qwiz_times_histogram_highlight_leader (1, this, "+i+", "+_[t]+')" onmouseleave="'+qname+".qwiz_times_histogram_highlight_leader (0, this, "+i+", "+_[t]+')">'),n[t]?(g=n[t],c==o[t]&&(g+=" (you)")):(g=T("Student")+" #"+(o[t]+1),c==o[t]&&("summary"==e&&t==d?(g=qwiz_times_histogram_initials_html(i,qwizdata[i].quiz_elapsed_time_id,w),u=!0):g=T("You"))),z.push(g),z.push("</td>"),z.push('<td class="qwiz-right">');const q=qqc.hhmmss_from_sec(a[t]);z.push(q),z.push("</td>"),z.push("</tr>")}if(document_qwiz_maker_privileges||(z.push("</table>"),z.push("</td>")),z.push("</tr>"),z.push("</table>"),t.find("div.qwiz_times_histogram_legend_content").html(z.join("\n")),u){t.find("div.qwiz_times_histogram_legend_content emoji-picker").on("emoji-click",(function(){pick_emoji(event,i)}));const e=t.find("input.qwiz_times_histogram_initials");w?e.css({background:"white"}):e.focus()}},this.delete_leaderboard_entry=function(e,t){data={quiz_elapsed_time_id:t},qqc.jjax(qname,e,"","delete_quiz_elapsed_time",data)},this.delete_leaderboard_entry_callback=function(e){debug[0]&&console.log("[delete_leaderboard_entry_callback] data:",e),e.errmsg?alert(e.errmsg):$("div#qwiz"+e.i_qwiz+" div.qwiz_times_histogram_legend_content tr.quiz_elapsed_time_id"+e.quiz_elapsed_time_id).remove()},this.show_hide_emoji_picker=function(e){$("div.emoji-picker-qwiz"+e).toggle()},this.check_leaderboard_initials=function(e){e.value=leaderboard_initials_ok(e.value)},this.update_leaderboard_initials=function(e,t,i,a){if(!e){const a=$(t).prevAll("input.qwiz_times_histogram_initials");if(e=a.val()){const t=qwizdata[i].qwiz_histogram_data,_=t.i_takers.length;for(var s=0;s<_;s++)if(e==t.initialss[s]&&t.i_takers[s]!=t.i_taker)return alert(T("These initials have already been used by someone else")),void a.focus()}a.css({background:"white"})}if($("div.emoji-picker-qwiz"+i).hide(),a){const t='<img src="'+qqc.get_qwiz_param("url","./")+'images/spinner16x16.gif" />';$("div#summary-quiz_times_histogram-qwiz"+i).find("button.qwiz_times_histogram_initials").html(t);const s={quiz_elapsed_time_id:a,initials:e,callback:"update_quiz_elapsed_time_callback"};qqc.qjax(qname,i,qwizdata[i].qrecord_id,"update_quiz_elapsed_time",s)}},this.update_quiz_elapsed_time_callback=function(e,t){$("div#summary-quiz_times_histogram-qwiz"+e).find("button.qwiz_times_histogram_initials").html(T("Save")),t&&alert(t)},this.qwiz_times_histogram_highlight_leader=function(e,t,i,a){const s=$(t),_=qwizdata[i].$qwiz_times_histogram.find("div.qwiz_times_histogram_marker_target"+a);1==e?(s.addClass("qwiz_times_histogram_highlight"),_.addClass("qwiz_times_histogram_highlight")):(s.removeClass("qwiz_times_histogram_highlight"),_.removeClass("qwiz_times_histogram_highlight"))},this.qwiz_times_histogram_graph_legend=function(e,t,i){var a=[];const s=i>-1?" qwiz_times_histogram_taker_color":"";a.push('<div class="qwiz_times_histogram_legend_color'+s+'">'),a.push("</div>"),a.push('<span class="qwiz_times_histogram_legend_student">'),a.push("You"),a.push("</span>"),a.push("<br />"),a.push("<label>"),a.push('<input type="checkbox" class="qwiz_times_histogram_color_by_date" onchange="'+qname+".qwiz_times_histogram_legend_change (this.className, this.checked, "+t+", "+i+')" style="margin-right: 3px; margin-left: 0;" />'+T("When done")),a.push("</label>"),a.push(" "),a.push("<label>"),a.push('<input type="checkbox" class="qwiz_times_histogram_show_bin_counts" onchange="'+qname+".qwiz_times_histogram_legend_change (this.className, this.checked, "+t+", "+i+')" style="margin-right: 3px;" />#/'+T("bin")),a.push("</label>"),a.push(" "),a.push("<label>"),a.push('<input type="checkbox" class="qwiz_times_histogram_show_bars" onchange="'+qname+".qwiz_times_histogram_legend_change (this.className, this.checked, "+t+", "+i+')" style="margin-right: 3px;" />'+T("Bars")),a.push("</label>"),e.find("div.qwiz_times_histogram_legend_content").html(a.join("\n")),qwizdata[t].i_taker_shown=i},this.qwiz_times_histogram_legend_change=function(e,t,i,a){if($qwiz_times_histogram=qwizdata[i].$qwiz_times_histogram,"qwiz_times_histogram_color_by_date"==e){if(t)$qwiz_times_histogram.find("div.qwiz_times_histogram_marker").removeClass("qwiz_times_histogram_marker_gray qwiz_times_histogram_taker_color qwiz_times_histogram_taker_color0 qwiz_times_histogram_taker_color1 qwiz_times_histogram_taker_color2 qwiz_times_histogram_taker_color3 qwiz_times_histogram_taker_color4 qwiz_times_histogram_taker_color5 qwiz_times_histogram_taker_color6 qwiz_times_histogram_taker_color7 qwiz_times_histogram_taker_color8"),$qwiz_times_histogram.find("div.qwiz_times_histogram_date_legend").show();else{const e=qwizdata[i].i_taker_shown;$qwiz_times_histogram.find("div.qwiz_times_histogram_marker").addClass("qwiz_times_histogram_marker_gray"),$qwiz_times_histogram.find("div.qwiz_times_histogram_taker"+e).addClass("qwiz_times_histogram_taker");const t=e==a?"You":"Student #"+(e+1);$qwiz_times_histogram.find("span.qwiz_times_histogram_legend_student").html(t);const s=e==a?"":e%9;$qwiz_times_histogram.find("div.qwiz_times_histogram_legend_color").attr("class","qwiz_times_histogram_legend_color qwiz_times_histogram_taker_color"+s),$qwiz_times_histogram.find("div.qwiz_times_histogram_date_legend").hide()}qwizdata[i].qwiz_times_histogram_color_by_date=t}else"qwiz_times_histogram_show_bin_counts"==e?(t?qwizdata[i].qwiz_times_histogram_show_bars?$qwiz_times_histogram.find("div.qwiz_times_histogram_bar_label").show():($qwiz_times_histogram.find("div.qwiz_times_histogram_bin_label").show(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_marker").show()):($qwiz_times_histogram.find("div.qwiz_times_histogram_bar_label").hide(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_label").hide(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_marker").hide()),qwizdata[i].qwiz_times_histogram_show_bin_counts=t):"qwiz_times_histogram_show_bars"==e&&(t?($qwiz_times_histogram.find("div.qwiz_times_histogram_bar").show(),$qwiz_times_histogram.find("div.qwiz_times_histogram_v_axis").show(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_marker").hide(),qwizdata[i].qwiz_times_histogram_show_bin_counts?($qwiz_times_histogram.find("div.qwiz_times_histogram_bar_label").show(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_label").hide()):($qwiz_times_histogram.find("div.qwiz_times_histogram_bar_label").hide(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_label").hide())):($qwiz_times_histogram.find("div.qwiz_times_histogram_bar").hide(),$qwiz_times_histogram.find("div.qwiz_times_histogram_v_axis").hide(),qwizdata[i].qwiz_times_histogram_show_bin_counts&&($qwiz_times_histogram.find("div.qwiz_times_histogram_bin_marker").show(),$qwiz_times_histogram.find("div.qwiz_times_histogram_bin_label").show())),qwizdata[i].qwiz_times_histogram_show_bars=t)},this.process_choice=function(e,t,i,a,s){s||(s=""),e&&e.stopPropagation();a=a?1:0;var _=t.match(/(.*)-/)[1],o=t.match(/(qwiz.*?)-/)[1];i_qwiz=parseInt(o.substr(4),10);var n=t.match(/-q([0-9]+)-/)[1];debug[0]&&console.log("[process_choice] feedback_id: ",t,", qwizq_id: ",_,", i_qwiz: ",i_qwiz);var r=10;if(!q.preview&&qwizdata[i_qwiz].record_start_b&&document_qwiz_user_logged_in_b){r=500,qwizdata[i_qwiz].record_start_b=!1;record_response(i_qwiz,qwizdata[i_qwiz].qrecord_id,{type:"start",confirm:"js"},!0)}if(q.qwizard_b){var d=t.match(/-a([0-9]+)$/)[1],c="span.choice-qwiz"+i_qwiz+"-q"+n+"-a"+d,l=$(c+" span.qwiz-choice.qwiz_editable");l.css({position:"unset"});var w=l[0];qw.answer_choice_focus(w)}var h=qwizdata[i_qwiz].qrecord_id&&qwizdata[i_qwiz].use_dataset&&!qqc.isInteger(qwizdata[i_qwiz].dataset_id[n]);const u="mobile_"==t.substr(0,7)?"mobile_":"",z=u?t.substr(7):t;var m;document.getElementById("radio-"+z)&&(i=!!$("#radio-"+z).data("q"));const p=i?"qwiz_correct_choice":"qwiz_incorrect_choice",g=u?"#":".";if(u){$("#"+_+" li.mobile_choice").hide(),$("#"+_+" .qwiz-feedback").hide(),h||($("#"+t).show(),q.qwizard_b||$(g+"choice-"+t).addClass(p));$("#choice-"+t).show(),m=""}else m=$("input[name="+_+"]").attr("disabled");if("disabled"!=m){if(u&&(t=t.substr(7),_=_.substr(7)),$("#"+_+" .qwiz-feedback").hide(),process_choice_disable(t,_),h||s||($("#"+t).show(),q.qwizard_b||$(g+"choice-"+t).addClass(p)),1!=qwizdata[i_qwiz].user_question_number||!q.no_intro_b[i_qwiz]&&1!=qwizdata[i_qwiz].n_questions||($("div#icon_qwiz"+i_qwiz).hide(),alert_not_logged_in(i_qwiz),qwizdata[i_qwiz].qwiz_timer&&start_timers(i_qwiz)),h||qwizdata[i_qwiz].qrecord_id&&document_qwiz_user_logged_in_b){d=t.match(/-a([0-9]+)$/)[1];var b=$("#"+_+" .choice-"+t).html();b=b?qqc.remove_tags_eols(b):"stuck"==s?"I’m stuck – show me the answer":"generative"==s?btoa(encodeURIComponent($(`textarea#check_my_answer-${_}`).val())):qqc.remove_tags_eols($(`#${_} button.qwiz_button`).first().html())+"\t"+qqc.remove_tags_eols($("#"+t).html());setTimeout((function(){var e={q_and_a_text:btoa(encodeURIComponent(qwizdata[i_qwiz].q_and_a_text[n])),q_and_a_crc32:qwizdata[i_qwiz].q_and_a_crc32[n],i_question:qwizdata[i_qwiz].dataset_id[n],unit:qwizdata[i_qwiz].unit[n],level:qwizdata[i_qwiz].level[n],type:"multiple_choice",response:b,i_choice:d,correct_b:i?1:"",feedback_id:u+t,got_it_more_practice_f:a,confirm:"js"};h&&(e.secure_f=1),q.preview_i_qwiz_plus1&&(e.preview_no_record=1),qwizdata[i_qwiz].cv_index&&(e.cv_index=qwizdata[i_qwiz].cv_index),"generative"==s&&(e.generative_feedback=btoa(encodeURIComponent($(`div.${_}-a0_gen`).html()))),record_response(i_qwiz,qwizdata[i_qwiz].qrecord_id,e)}),r)}h||q.process_choice2(u+t,a,i,-1)}},this.process_choice2=function(e,t,i,a,s,_,o,n){const r=e.match(/qwiz([0-9]+)-/)[1],d=e.match(/-q([0-9]+)-/)[1];debug[0]&&(console.log("[process_choice2] correct_f:",i,", feedback_html:",a),console.log("[process_choice2] i_question:",d));const c="mobile"==e.substr(0,6),l=i?"qwiz_correct_choice":"qwiz_incorrect_choice",w=c?"#":".";if(-1!=a){if("show_answers"!=preview_mode&&($("#"+e).html(a).show(),$(w+"choice-"+e).addClass(l)),c){const t=e.substr(7);$("#"+t).html(a).show(),$(w+"choice-"+t).addClass(l)}if(i){update_progress_meter(r,s,atob(_),o,n)}}q.qwizard_b||q.preview||(qwizdata[r].answered_correctly[d]=i?1:-1,i?(qwizdata[r].n_correct++,qwizdata[r].n_qs_done&&qwizdata[r].n_qs_done.add(qwizdata[r].dataset_id[d])):qwizdata[r].n_incorrect++,update_topic_statistics(r,d,i)),1==t?($("#show_answer_got_it_or_not-qwiz"+r+"-q"+d).hide(),$("#mobile_show_answer_got_it_or_not-qwiz"+r+"-q"+d).hide(),q.qwizard_b||q.display_progress(r),q.next_question(r)):($(`div#qwiz${r}-q${d} button.show_the_answer`).addClass("qwiz_button_disabled").attr("disabled",!0),$(`div#mobile_qwiz${r}-q${d} li.mobile_choice`).hide(),update_progress_show_next(r))},this.generate_custom_feedback=function(e,t,i,a){var s="";qwizdata[e].prompt_intro&&void 0!==qwizdata[e].prompt_intro[t]?s=qwizdata[e].prompt_intro[t]:qwizdata[e].default_prompt_intro&&(s=qwizdata[e].default_prompt_intro);var _="";qwizdata[e].prompt_intro_add&&void 0!==qwizdata[e].prompt_intro_add[t]?_=qwizdata[e].prompt_intro_add[t]:qwizdata[e].default_prompt_intro_add&&(_=qwizdata[e].default_prompt_intro_add);var o="";qwizdata[e].prompt_for_question&&void 0!==qwizdata[e].prompt_for_question[t]?o=qwizdata[e].prompt_for_question[t]:qwizdata[e].default_prompt_for_question&&(o=qwizdata[e].default_prompt_for_question);var n="";qwizdata[e].prompt_for_response&&void 0!==qwizdata[e].prompt_for_response[t]?n=qwizdata[e].prompt_for_response[t]:qwizdata[e].default_prompt_for_response&&(n=qwizdata[e].default_prompt_for_response);var r=20;qwizdata[e].response_min_chars&&void 0!==qwizdata[e].response_min_chars[t]?r=qwizdata[e].response_min_chars[t]:qwizdata[e].default_response_min_chars&&(r=qwizdata[e].default_response_min_chars);var d="";qwizdata[e].prompt_for_feedback&&void 0!==qwizdata[e].prompt_for_feedback[t]?d=qwizdata[e].prompt_for_feedback[t]:qwizdata[e].default_prompt_for_feedback&&(d=qwizdata[e].default_prompt_for_feedback);var c,l="";qwizdata[e].temperature&&void 0!==qwizdata[e].temperature[t]?l=qwizdata[e].temperature[t]:qwizdata[e].default_temperature&&(l=qwizdata[e].default_temperature),1==qwizdata[e].user_question_number&&($("div#icon_qwiz"+e).hide(),alert_not_logged_in(e),qwizdata[e].qwiz_timer&&start_timers(e)),c=qwizcards_page_f?qqc.get_qwiz_param("server_loc","http://qwizcards.net/admin")+"/qwizard_textentry_suggestions.php":qqc.get_qwiz_param("ajaxurl",""),debug[0]&&(c+="?qwiz_debug=0");const w=$(`#${document_qwiz_mobile}qwiz${e}-q${t}-a0 .qwiz-feedback-div`);var h,u=$(`#${document_qwiz_mobile}qwiz${e}-q${t} div.qwizq`).html();if(u=qqc.remove_tags_eols(u),u=qqc.decodeHtmlEntities(u),a){const i=$(`input.${document_qwiz_mobile}qwiz${e}-q${t}-generative_hint`);if(h=i.val(),!/\S/.test(h)){return setTimeout((function(){alert("Please enter a hint topic")}),100),void i.focus()}var z="";qwizdata[e].default_hint_prompt_intro&&(z=qwizdata[e].default_hint_prompt_intro);qwizdata[e].default_hint_prompt_for_response&&(n=qwizdata[e].default_hint_prompt_for_response),s=z,n=""}else{h=$(`#${document_qwiz_mobile}qwiz${e}-q${t} textarea`).val();const i=document_qwiz_mobile?"":"mobile_";if($(`#${i}qwiz${e}-q${t} textarea`).val(h).trigger("input"),$(`#${document_qwiz_mobile}qwiz${e}-q${t} button.view_answer_guide`).html(T("View answer guide")),(h=qqc.remove_tags_eols(h)).length<r){return $(`div.qwiz${e}-q${t}-a0_gen`).html(T("Please enter a longer response!")).show(),void(qwizdata[e].generative_response_error=!0)}$(`div#qwiz${e}-q${t} button.show_the_answer`).addClass("qwiz_button_disabled").attr("disabled",!0),$(`div#mobile_qwiz${e}-q${t} li.mobile_choice`).hide()}debug[0]&&(console.log("[generate_custom_feedback] prompt_intro:",s),console.log("[generate_custom_feedback] prompt_for_question:",o),console.log("[generate_custom_feedback] prompt_for_response:",n),console.log("[generate_custom_feedback] prompt_for_feedback:",d),console.log("[generate_custom_feedback] temperature:",l)),$(`div.qwiz${e}-q${t}-a0_gen`).html(""),$(`div.qwiz${e}-q${t}
13-spinner`).show();var m=w.html();m=qqc.remove_tags_eols(m);var p={action:"generate_custom_feedback",i_qwiz:e,i_question:t,prompt_intro:s,prompt_intro_add:_,prompt_for_question:o,question:u,prompt_for_response:n,response:h,prompt_for_feedback:d,feedback:m=qqc.decodeHtmlEntities(m),temperature:l,hint_f:a?1:0};debug[0]&&console.log("[generate_custom_feedback] data:",p),$.ajax({type:"POST",url:c,data:p,dataType:"json",error:function(e,t){debug[0]&&console.log("[generate_custom_feedback] error desc:",t)},success:show_generated_custom_feedback}),a||q.preview||qwizdata[e].bck_f||($(`#show_answer_got_it_or_not-qwiz${e}-q${t}`).css({opacity:.2}).show(),$(`#mobile_show_answer_got_it_or_not-qwiz${e}-q${t}`).css({opacity:.2}).show(),$(`#show_answer_got_it_or_not-qwiz${e}-q${t} .ok_ive_got_it`).removeAttr("disabled").removeClass("qwiz_button_disabled"),$(`#mobile_show_answer_got_it_or_not-qwiz${e}-q${t} .ok_ive_got_it`).removeAttr("disabled").removeClass("qwiz_button_disabled"))},this.hide_check_my_answer_feedback=function(e,t){qwizdata[e].generative_response_error&&(qwizdata[e].generative_response_error=!1,$(`div.qwiz${e}-q${t}-a0_gen`).hide())},this.show_answer_got_it_or_not=function(e,t,i){1==qwizdata[e].user_question_number&&($("div#icon_qwiz"+e).hide(),alert_not_logged_in(e),qwizdata[e].qwiz_timer&&start_timers(e)),q.qwizard_b||(i.style.display="none"),$(`#qwiz${e}-q${t}-a0`).show(),$(`#mobile_qwiz${e}-q${t}-a0`).show(),q.preview||qwizdata[e].bck_f||($(`#show_answer_got_it_or_not-qwiz${e}-q${t}`).css({opacity:1}).show(),$(`#mobile_show_answer_got_it_or_not-qwiz${e}-q${t}`).css({opacity:1}).show(),$(`#show_answer_got_it_or_not-qwiz${e}-q${t} .ok_ive_got_it`).removeAttr("disabled").removeClass("qwiz_button_disabled"),$(`#mobile_show_answer_got_it_or_not-qwiz${e}-q${t} .ok_ive_got_it`).removeAttr("disabled").removeClass("qwiz_button_disabled"))},this.view_answer_guide=function(e,t,i){const a=$(`#${document_qwiz_mobile}qwiz${t}-q${i}-a0`);if(a.is(":visible"))a.hide(),e.innerHTML=T("View answer guide");else{if(0==a.find(".answer_guide_header").length){const e='<p class="answer_guide_header" style="font-weight: bold; color: blue;">Answer Guide</p>';a.prepend(e).css({border:"2px solid blue",padding:"5px"})}a.show(),$("html, body").animate({scrollTop:a.offset().top},500),e.innerHTML=T("Hide answer guide")}},this.display_progress=function(e,t){if(debug[0]&&console.log("[display_progress] qwizdata[i_qwiz].i_question:",qwizdata[e].i_question,", came_from_start_b:",t),!qwizdata[e].hide_progress_b){var i,a=qwizdata[e].n_correct+qwizdata[e].n_incorrect,s=qwizdata[e].n_correct;if(qwizdata[e].repeat_incorrect_b||(s+=qwizdata[e].n_incorrect),q.qwizard_b)if(-1!=qwizdata[e].i_question||t){var _=qwizdata[e].i_question+1;t&&_++,i="Question "+_+" of "+qwizdata[e].n_questions}else i=T("Questions in this quiz:")+" "+qwizdata[e].n_questions;else{const t=qwizdata[e].n_questions_for_done,_=t-s;if(0==a){const a=qwizdata[e].n_qs;i=T(a&&t<a?"Questions in this set:":"Questions in this quiz:"),i+=" "+_}else{var o,n;document_qwiz_mobile||qwizdata[e].qwiz_timer?(o=T("Qs"),n=T("not")):(o=T("questions"),n=T("incorrect")),i=t+" "+o+", "+a+" "+plural(T("response"),T("responses"),a)+", "+qwizdata[e].n_correct+" "+T("correct")+", "+qwizdata[e].n_incorrect+" "+n+", "+_+" "+T("to go")}}$("#progress-qwiz"+e).html(i).show()}},this.display_diagram_progress=function(e,t="Correctly labeled",i=-1){if(!qwizdata[e].hide_progress_b){var a,s,_=qwizdata[e].user_question_number,o=qwizdata[e].n_questions_for_done,n="";(o>1||qwizdata[e].combo)&&(n="Q #"+_+"/"+o+"; "),-1==i?(a=qwizdata[e].n_labels_correct,s=qwizdata[e].n_label_targets):(a=i,s=i),"Correctly labeled"==t&&(t=T("Correctly labeled")),n+=t+" "+a+" "+T("out of")+" "+s+" "+T("items"),$("#progress-qwiz"+e).html(n).show()}},this.canned_feedback=function(e){var t;if(e){var i=Math.floor(Math.random()*correct.length);t=correct[i]}else{i=Math.floor(Math.random()*incorrect.length);t=incorrect[i]}return t="<p><strong>"+t+"</strong></p>",debug[0]&&console.log("[canned_feedback] response:",t),t};var find_matching_terms=function(e,t){1==qwizdata[textentry_i_qwiz].user_question_number&&($("div#icon_qwiz"+textentry_i_qwiz).hide(),alert_not_logged_in(textentry_i_qwiz),qwizdata[textentry_i_qwiz].qwiz_timer&&start_timers(textentry_i_qwiz));var i=e.term.toLowerCase(),a=qqc.metaphone(i);debug[6]&&console.log("[find_matching_terms] entry_metaphone; ",a);for(var s=100,_=100,o=qwizdata[textentry_i_qwiz].i_question,n=qwizdata[textentry_i_qwiz].textentry[o].textentry_minlength,r=0;r<textentry_answer_metaphones[textentry_i_qwiz].length;r++)i[0]==textentry_answers[textentry_i_qwiz][r][0].toLowerCase()&&(s=Math.min(s,textentry_answers[textentry_i_qwiz][r].length),debug[6]&&console.log("[find_matching_terms] entry[0]:",i[0],", textentry_answers[textentry_i_qwiz][i][0]:",textentry_answers[textentry_i_qwiz][r][0])),a[0]==textentry_answer_metaphones[textentry_i_qwiz][r][0]&&(_=Math.min(_,textentry_answer_metaphones[textentry_i_qwiz][r].length),debug[6]&&console.log("[find_matching_terms] textentry_answer_metaphones[textentry_i_qwiz][i]:",textentry_answer_metaphones[textentry_i_qwiz][r],", required_metaphone_length:",_));
13100==s?s=n:(s-=2,s=Math.min(n,s)),100!=_&&(--_<2?_=2:_>4&&(_=4)),debug[6]&&console.log("[find_matching_terms] required_entry_length:",s,", required_metaphone_length:",_);var d=i.replace(/(.)\1{2,}/gi,"$1");if(d.length<s&&a.length<_)textentry_matches[textentry_i_qwiz]=[],lc_textentry_matches[textentry_i_qwiz]=[],find_matching_terms2(t,d);else if(debug[6]&&console.log("[find_matching_terms] request.term:",e.term,", entry_metaphone:",a,", entry_metaphone.length:",a.length),textentry_matches[textentry_i_qwiz]=$.map(current_question_textentry_terms_metaphones[textentry_i_qwiz],(function(e){if(""==a?""==e[1]||0===e[0].toLowerCase().indexOf(i):0===e[1].indexOf(a)||0===e[0].toLowerCase().indexOf(i))return debug[6]&&console.log("[find_matching_terms] term_i:",e),e[0]})),debug[6]&&console.log("[find_matching_terms] textentry_matches[textentry_i_qwiz]:",textentry_matches[textentry_i_qwiz]),qwizdata[textentry_i_qwiz].textentry[o].use_dict_b){var q,c=qwizdata[textentry_i_qwiz].textentry[o].textentry_plural_b?1:0,l={action:"textentry_suggestions",entry:encodeURIComponent(i),entry_metaphone:encodeURIComponent(a),n_hints:qwizdata[textentry_i_qwiz].textentry_n_hints,terms:textentry_matches[textentry_i_qwiz],plural_f:c};q=qwizcards_page_f?qqc.get_qwiz_param("server_loc","http://qwizcards.net/admin")+"/qwizard_textentry_suggestions.php":qqc.get_qwiz_param("ajaxurl",""),$.ajax({type:"POST",url:q,data:l,dataType:"json",error:function(e,t){debug[0]&&console.log("[find_matching_terms] error desc:",t)},success:function(e){textentry_matches[textentry_i_qwiz]=e,find_matching_terms2(t,d)}})}else find_matching_terms2(t,d)};function find_matching_terms2(e,t){textentry_matches[textentry_i_qwiz].length&&(lc_textentry_matches[textentry_i_qwiz]=textentry_matches[textentry_i_qwiz].map((function(e){return e.toLowerCase()})),debug[6]&&console.log("[find_matching_terms2] textentry_matches[textentry_i_qwiz]:",textentry_matches[textentry_i_qwiz])),debug[6]&&console.log("[find_matching_terms2] deduped_entry.length: ",t.length,", textentry_matches[textentry_i_qwiz].length: ",textentry_matches[textentry_i_qwiz].length,", qwizdata[textentry_i_qwiz].textentry_n_hints: ",qwizdata[textentry_i_qwiz].textentry_n_hints);var i=qwizdata[textentry_i_qwiz].i_question,a=qwizdata[textentry_i_qwiz].textentry[i].textentry_minlength;if(t.length>=a&&qwizdata[textentry_i_qwiz].textentry_n_hints<5){var s=qwizdata[textentry_i_qwiz].textentry[i].first_correct_answer.toLowerCase();void 0!==lc_textentry_matches[textentry_i_qwiz]&&-1!=lc_textentry_matches[textentry_i_qwiz].indexOf(s)||($("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+i+" button.qwiz_textentry_hint").removeAttr("disabled").removeClass("qwiz_button_disabled").css({display:"inline-block"}),q.qwizard_b&&$("#qwiz"+textentry_i_qwiz+"-q"+i+" .qwiz-feedback").hide())}e(textentry_matches[textentry_i_qwiz])}function menu_closed(e){var t=e.target.value.toLowerCase(),i=qwizdata[textentry_i_qwiz].i_question,a=qwizdata[textentry_i_qwiz].textentry_n_hints;if(t.length<a){var s=qwizdata[textentry_i_qwiz].textentry[i].first_correct_answer.substr(0,a);e.target.value=s}(qwizdata[textentry_i_qwiz].check_answer_disabled_b||(debug[6]&&console.log("[menu_closed] textentry_matches[textentry_i_qwiz]: ",textentry_matches[textentry_i_qwiz]),void 0!==lc_textentry_matches[textentry_i_qwiz]&&-1!=lc_textentry_matches[textentry_i_qwiz].indexOf(t)||($("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+i+" button.textentry_check_answer").addClass("qwiz_button_disabled").html(qwizdata[textentry_i_qwiz].check_answer),qwizdata[textentry_i_qwiz].check_answer_disabled_b=!0,q.qwizard_b&&$("#qwiz"+textentry_i_qwiz+"-q"+i+" .qwiz-feedback").hide())),show_hint_timeout[textentry_i_qwiz])&&($("#textentry-qwiz"+textentry_i_qwiz+"-q"+i).val().length>=qwizdata[textentry_i_qwiz].textentry[i].textentry_minlength&&(clearTimeout(show_hint_timeout[textentry_i_qwiz]),show_hint_timeout[textentry_i_qwiz]=0))}function menu_shown(e){if(qwizdata[textentry_i_qwiz].record_start_b&&document_qwiz_user_logged_in_b){qwizdata[textentry_i_qwiz].record_start_b=!1;record_response(textentry_i_qwiz,qwizdata[textentry_i_qwiz].qrecord_id,{type:"start",confirm:"js"},!0)}var t=e.target.value.toLowerCase(),i=qwizdata[textentry_i_qwiz].i_question,a=qwizdata[textentry_i_qwiz].textentry[i].first_correct_answer.toLowerCase();-1!=lc_textentry_matches[textentry_i_qwiz].indexOf(a)&&$("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+i+" button.qwiz_textentry_hint").attr("disabled",!0).addClass("qwiz_button_disabled"),-1!=lc_textentry_matches[textentry_i_qwiz].indexOf(t)?($("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+i+" button.textentry_check_answer").removeClass("qwiz_button_disabled").html(T("Check answer")),qwizdata[textentry_i_qwiz].check_answer_disabled_b=!1):($("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+i+" button.textentry_check_answer").addClass("qwiz_button_disabled").html(qwizdata[textentry_i_qwiz].check_answer),qwizdata[textentry_i_qwiz].check_answer_disabled_b=!0)}function alert_not_logged_in(e){if(q.no_intro_b[e]&&qwizdata[e].qrecord_id&&$.cookie("qwiz_user_login")){"undefined"!=typeof document_qwiz_user_logged_in_b&&document_qwiz_user_logged_in_b&&"undefined"!=typeof document_qwiz_username||document_qwiz_declined_login_b||document_qwiz_not_logged_in_alerted||q.qwizard_b||-1==qwizdata[e].qrecord_id.indexOf("finish_times_demo")&&(alert("Note: you are not logged in. You must be logged in to receive credit."),document_qwiz_not_logged_in_alerted=!0)}}function redisplay_current_question(e,t){if(t<qwizdata[e].n_questions)if(document_qwiz_mobile){var i=$("#mobile_qwiz"+e+"-q"+t);i.length?i.show():$("#qwiz"+e+"-q"+t).show()}else $("#qwiz"+e+"-q"+t).show();else $("#summary-qwiz"+e).show();$(".bbfe-qwiz"+e).css({visibility:"visible"}),$("span.question-number-qwiz"+e).css({visibility:"visible"})}function get_attr(e,t,i){var a=qqc.get_attr(e,t);return i&&!a&&(a=qqc.get_attr(e,t+"s")),a}function S(e){return qqc.T(e)}function T(e){return qqc.T(e)}function plural(e,t,i){return qqc.plural(e,t,i)}function inarray0(e,t){for(var i=e.length,a=0;a<i;a++)if(e[a][0]==t)return!0;return!1}this.textentry_check_answer=function(e,t,i){var a=qwizdata[e].i_question,s=$("#textentry-qwiz"+e+"-q"+a);if(debug[6]&&(n=s.val(),console.log("[textentry_check_answer] $textentry.val ():",s.val())),!qwizdata[e].textentry[a].textentry_suggest_b){if(qwizdata[e].record_start_b&&document_qwiz_user_logged_in_b){qwizdata[e].record_start_b=!1;var _={type:"start",confirm:"js"};record_response(e,qwizdata[e].qrecord_id,_,!0)}if(""==(n=s.val()))return!1}if(!t&&!q.qwizard_b&&!q.preview){if(qwizdata[e].check_answer_disabled_b)return alert(Tcheck_answer_message),void $("#textentry_check_answer_div-qwiz"+e+"-q"+a+" button.qwiz_textentry_hint").removeAttr("disabled").removeClass("qwiz_button_disabled").css({display:"inline-block"});$("#textentry_check_answer_div-qwiz"+e+"-q"+a).hide()}s.blur(),q.qwizard_b||q.preview||s.attr("disabled",!0);for(var o,n=s.val().toLowerCase(),r=-1,d=!1,c=qwizdata[e].textentry[a].choices.length,l=0;l<c;l++){var w=qwizdata[e].textentry[a].choices[l];if("*"==w[0])o=l;else{var h=!1;if(q.qwizard_b&&void 0!==i&&"Enter word"==w&&l==i&&(h=!0),!h)h=-1!=w.map((function(e){return e.toLowerCase()})).indexOf(n);if(h){d=qwizdata[e].textentry[a].choices_correct[l],r=l;break}}}if(-1==r&&(r=o),"questions_active"==preview_mode&&$("#qwiz"+e+"-q"+a+" .qwiz-feedback").hide(),$("#qwiz"+e+"-q"+a+"-a"+r).show(),!q.qwizard_b){if(qwizdata[e].answered_correctly[a]=d?1:-1,d?(qwizdata[e].n_correct++,qwizdata[e].n_qs_done&&qwizdata[e].n_qs_done.add(qwizdata[e].dataset_id[a])):qwizdata[e].n_incorrect++,qwizdata[e].qrecord_id&&document_qwiz_user_logged_in_b){_={q_and_a_text:btoa(encodeURIComponent(qwizdata[e].q_and_a_text[a])),q_and_a_crc32:qwizdata[e].q_and_a_crc32[a],i_question:qwizdata[e].dataset_id[a],unit:qwizdata[e].unit[a],level:qwizdata[e].level[a],type:"textentry",response:n,i_choice:-1,correct_b:d?1:"",confirm:"js"};record_response(e,qwizdata[e].qrecord_id,_)}update_topic_statistics(e,a,d)}update_progress_show_next(e)},this.textentry_hint=function(e){clearTimeout(show_hint_timeout[e]),show_hint_timeout[e]=0,qwizdata[e].textentry_n_hints++;var t=qwizdata[e].i_question,i=qwizdata[e].textentry[t].first_correct_answer.substr(0,qwizdata[e].textentry_n_hints);$("#textentry-qwiz"+e+"-q"+t).val(i).focus().trigger("keydown"),$("#textentry_check_answer_div-qwiz"+e+"-q"+t+" button.qwiz_textentry_hint").attr("disabled",!0).addClass("qwiz_button_disabled").html("Another hint");var a=$("#textentry_check_answer_div-qwiz"+e+"-q"+t);hint_timeout_sec>=0&&(show_hint_timeout[e]=setTimeout((function(){a.find("button.qwiz_textentry_hint").removeAttr("disabled").removeClass("qwiz_button_disabled")}),1e3*hint_timeout_sec))},this.set_textentry_i_qwiz=function(e,t){var i=t.id;if(textentry_i_qwiz=i.match(/[0-9]+/)[0],debug[6]&&console.log("[set_textentry_i_qwiz] textentry_i_qwiz: ",textentry_i_qwiz),e.stopPropagation(),q.qwizard_b){var a=i.match(/qwiz.*/)[0];$("#"+a+" .qwiz-feedback").hide()}},this.item_selected=function(){var e=qwizdata[textentry_i_qwiz].i_question;$("#textentry_check_answer_div-qwiz"+textentry_i_qwiz+"-q"+e+" button.textentry_check_answer").removeClass("qwiz_button_disabled").html(T("Check answer")),qwizdata[textentry_i_qwiz].check_answer_disabled_b=!1},this.keep_next_button_active=function(){next_button_active_b=!0,qqc.next_button_active_b=!0,$(".next_button").show()},this.position_show_next_button=function(e){$("#next_button-qwiz"+e).show()},this.hide_menu_and_display_login=function(e,t,i,a,s,_){var o=$("div.qwiz_icon_and_menu_container.qwiz"+e+" div.qwiz_icon_trigger_and_menu");o.removeClass("qwiz-hover"),q.display_login(e,t,i,a,s,_);setTimeout((function(){o.addClass("qwiz-hover")}),500)},this.display_login=function(e,t,i,a,s,_){i||(i=""),t||i||$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce");var o=qwizdata[e].i_question;if(-1==o?($(".intro-qwiz"+e).hide(),q.no_intro_b[e]||$("div#icon_qwiz"+e).hide()):o>=qwizdata[e].n_questions?$("#summary-qwiz"+e).hide():($textentry_check_answer_div=$("#textentry_check_answer_div-qwiz"+e+"-q"+o),$textentry_check_answer_div.is(":visible")?($textentry_check_answer_div.hide(),qwizdata[e].textentry_check_answer_show_b=!0):qwizdata[e].textentry_check_answer_show_b=!1,hide_current_question(e,qwizdata[e].i_user_question),$(".bbfe-qwiz"+e).css({visibility:"hidden"}),$("span.question-number-qwiz"+e).css({visibility:"hidden"})),$("#next_button-qwiz"+e).hide(),"progress_bars"==i||"leaderboard"==i){const t=qwizdata[e].display_pay_screen;"register"==t||"open_register"==t||"subscribe"==t||"free_trial"==t?$(".intro-qwiz"+e).show():(qwizdata[e].leaderboard_class_everyone=0,qqc.create_progress_bars(qname,qwizdata,e,i))}else"feedback"==i?qqc.create_provide_feedback_screen(qname,e,qwizdata[e].i_question):"use_dataset_options"==i?qqc.create_use_dataset_options(qname,qwizdata,e):"pay"==i?qqc.create_pay_screen(qname,qwizdata,e,a,_):"maker_pay"==i?qqc.create_maker_pay_screen(qname,qwizdata,e,a):"enroll"==i?qqc.create_enroll_screen(qname,e):"register"==i?qqc.create_register_taker_screen(qname,e,s,a,i):"open_register"==i?qqc.create_register_taker_screen(qname,e,!1,a,i):"free_trial"==i?qqc.create_register_taker_screen(qname,e,!0,a,i):"paypal_subscription"==i?qqc.create_paypal_subscription_screen(qname,e):"special_offer"==i?qqc.create_paypal_subscription_screen(qname,e,!0):document_qwiz_wp_user_session_id?qqc.create_refresh_page_notice(qname,e):($("#qwiz_login-qwiz"+e).html(get_login_html(e,t,a,s)).show(),qqc.init_hide_show_password("#qwiz_password-qwiz"+e),qwizdata[e].display_pay_screen||$("#qwiz_username-qwiz"+e).focus());qwizdata[e].login_show_b=!0},this.login=function(e,t,i){t=t?1:0,i=i?1:0,$.removeCookie("qwiz_declined_login",{path:"/"}),document_qwiz_declined_login_b=!1;var a=$("#qwiz_username-qwiz"+e),s=a.val();if(!s)return alert(T("Please enter Login name")),a.focus(),!1;if(t&&-1!=document_qwiz_username.split("; ").indexOf(s))return alert("User "+s+" is already on your team."),!1;var _=$("#qwiz_password-qwiz"+e),o=_.val();if(!o)return alert(T("Please enter Password")),_.focus(),!1;_.blur();var n,r=CryptoJS.SHA3(o).toString();t?n=document_qwiz_remember_f:(n=$("#qwiz_login-qwiz"+e+' input[type="checkbox"]').prop("checked")?1:0,document_qwiz_remember_f=n);var d={username:s,sha3_password:r,remember_f:n,add_team_member_f:t};return t&&(d.previous_username=document_qwiz_username),i&&(d.proceed_to_pay_f="1"),qqc.jjax(qname,e,qwizdata[e].qrecord_id,"login",d),!1},this.login_ok=function(e,t,i,a){var s={path:"/"};1==i&&(s.expires=1),$.cookie("qwiz_session_id",document_qwiz_session_id,s),s.expires=30,$.cookie("qwiz_user_login",1,s),qqc.check_session_id(e),document_qwiz_user_logged_in_b=!0;var _=qqc.get_qwiz_param("login_timeout_min",40);if(s.expires=_/1440,$.cookie("qwiz_current_login_lt_nmin_ago",1,s),qqc.set_user_menus_and_icons(),qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(),$("#qwiz_login-qwiz"+e).hide(),qwizdata[e].login_show_b=!1,q.qrecord_b)for(var o=0;o<n_qwizzes;o++)qwizdata[o].qrecord_id&&(qwizdata[o].record_start_b=!0);return"special_offer"==qwizdata[e].display_pay_screen?(document.location=document.location,!1):(a&&"paid"==qwizdata[e].pay_quiz_ok&&(a=!1),a?q.display_login(e,!1,"pay"):qwizdata[e].display_pay_screen?($(`.intro-qwiz${e}`).show(),$(`#qwiz${e}-q0`).hide()):q.login_ok_start_quiz(e),!1)},this.login_ok_start_quiz=function(e){var t=qwizdata[e].i_user_question;if(-1==t)q.next_question(e);else{redisplay_current_question(e,t),qwizdata[e].record_start_b=!1;record_response(e,qwizdata[e].qrecord_id,{type:"start",confirm:"js"},!0),qwizdata[e].next_button_show_b&&q.position_show_next_button(e),qwizdata[e].textentry_check_answer_show_b&&$("#textentry_check_answer_div-qwiz"+e+"-q"+t).css({display:"inline-block"})}},this.login_not_ok=function(e,t){t||(t=T("Login incorrect. Please try again")),$("#qwiz_login-qwiz"+e+" p.login_error").html(t).show(),debug[0]&&console.log("[login_not_ok] $ ('#qwiz_login-qwiz"+e+" p.login_error'):",$("#qwiz_login-qwiz"+e+" p.login_error"))},this.no_login=function(e,t,i){t||i||($("#qwiz_login-qwiz"+e+' input[type="checkbox"]').prop("checked")&&($.cookie("qwiz_declined_login",1,{path:"/"}),document_qwiz_declined_login_b=!0),$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce")),$("#qwiz_login-qwiz"+e).hide(),qwizdata[e].login_show_b=!1;var a=qwizdata[e].i_user_question;return-1==a?i?($(".intro-qwiz"+e).show(),$("#next_button-qwiz"+e).show()):q.next_question(e,!0):(redisplay_current_question(e,a),qwizdata[e].next_button_show_b&&q.position_show_next_button(e),qwizdata[e].textentry_check_answer_show_b&&$("#textentry_check_answer_div-qwiz"+e+"-q"+a).show()),!1},this.icon_no_login=function(e,t){$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce"),t||$("#usermenu-qwiz"+e+' input[type="checkbox"]').prop("checked")&&($.cookie("qwiz_declined_login",1,{path:"/"}),document_qwiz_declined_login_b=!0)},this.get_qwizdata=function(e,t){return void 0===qwizdata[e][t]?"":qwizdata[e][t]},this.set_qwizdata=function(i_qwiz,variable,value){if(-1==i_qwiz){var s=variable+" = "+value;eval(s)}else qwizdata[i_qwiz][variable]=value}};qwizf.call(qwiz_); 14; 15window.console||(window.console={log:function(){}}),qcard_={};
15var qcardf=function(){var qname="qcard_",debug=[];debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1),debug.push(!1);var $=jQuery;this.no_intro_b=[],this.qwizard_b=!1,this.qrecord_b=!1,this.dataset_b=!1,this.ruled_lines="img:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAf4AAAE2CAIAAAAPtmerAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEnklEQVR4nO3YMW1AMRQEwTgyf3ix9Mm8sLCLnUFw1Ra3ZuYHgJLf1wMAuE36AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIEf6AXKkHyBH+gFypB8gR/oBcqQfIGf//P293gDAVWtmXm8A4CqHD0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+Ts883rDQBctWakH6DF4QOQI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA5+3zzegMAV60Z6QdocfgA5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9Azj7fvN4AwFVrRvoBWhw+ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkLPPN683AHDVmpF+gBaHD0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+Ts883rDQBctWakH6DF4QOQI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA5+3zzegMAV60Z6QdocfgA5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9Azj7fvN4AwFVrRvoBWhw+ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkLPPN683AHDVmpF+gBaHD0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+RIP0CO9APkSD9AjvQD5Eg/QI70A+Ts883rDQBctWakH6DF4QOQI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA50g+QI/0AOdIPkCP9ADnSD5Aj/QA5/8mNPTHI1j+2AAAAAElFTkSuQmCC",this.preview=!1,this.any_pay_deck_f=!1,this.n_textentry_hangman=1;var q=this,qqc;q.processing_complete_b=!1;var regular_page_f=!0,content="body",default_use_dict="true",default_use_terms="true",hint_timeout_sec=20,default_hangman_max_hints=2,errmsgs=[],n_decks=0,qwizcards_page_f=!1,deck_id,deckdata=[],next_button_active_b=!1,textentry_i_deck,loaded_metaphone_js_b=!1,default_textentry_terms_metaphones,current_card_textentry_terms_metaphones={},textentry_answers={},textentry_answer_metaphones={},textentry_matches={},lc_textentry_matches={},Tcheck_answer_message,show_hint_timeout={},suppress_hangman_hint_b=!1,q_and_a_text="",panel_exit_mobile_open_b=!1,panel_exit_mobile_just_closed_b,non_mobile_scrollLeft,non_mobile_scrollTop,mobile_i_deck,qw,set_qwizard_data_b=!1,chromebook_b=-1!=navigator.appVersion.indexOf("CrOS"),mp3_jplayer_warning_f;function set_flip(){$("div.qcard_card").flip({front:"div.qcard-front",back:"div.qcard-back",autoSize:!1,speed:700,trigger:"manual"})}function dialog_no_credit_html(){htm=[],htm.push('<div id="qwizcards_dialog_no_credit" title="'+T("Flashcard deck not assigned in your class")+'">'),htm.push('<div class="has_not_been_assigned">'),htm.push('<p style="margin-bottom: 1em;">'),htm.push(T("Note: this flashcard deck has not been assigned as work you need to do.")),htm.push(T("Your work will be recorded, but it may not count for your class.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("You can send a request message to your teacher asking them to include this quiz in your class.")),htm.push("<br />"),htm.push("<br />"),htm.push('<button id="qcard_request_assign_to_class" class="qwiz_button" onclick="qwiz_qcards_common.request_assign_to_class (0)">'),htm.push(T("Send request")),htm.push("</button>"),htm.push("</p>"),htm.push("<br />"),htm.push('<div id="qcard_request_assign_to_class_feedback">'),htm.push("</div>"),htm.push("</div>"),htm.push('<div class="not_in_a_class" style="display: none;">'),htm.push("<p>"),htm.push(T("You are not enrolled in any current class.")),htm.push(T("Your work will be recorded, but your teacher will not see it.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("To add yourself to a class:")),htm.push("</p>"),htm.push("<p>");const e=qqc.get_qwiz_param("server_name")+"/register";return htm.push(T("Go to")+' <a style="text-decoration: underline;
15 color: blue;" href="https://'+e+'">'+e+"</a>"),htm.push("</p>"),htm.push("<p>"),htm.push(T("Enter the registration code given to you by your teacher and enter your login name and password.")),htm.push("</p>"),htm.push("<p>"),htm.push(T("Or you can ask your teacher to add you to their class.")),htm.push("</p>"),htm.push("</div>"),htm.push("<p>"),htm.push("<label>"),htm.push('<input type="checkbox" onclick="qwiz_qcards_common.do_not_show_assign_to_class (this)" />'),htm.push(T("Don’t show me this again for quizzes and flashcard decks on this page")),htm.push("</label>"),htm.push("</p>"),htm.push("</div>"),htm.join("\n")}function init_preview(e){deckdata[e].no_flip_b=!1;for(var t=deckdata[e].n_cards,a=0;a<t;a++)deckdata[e].i_card=a,q.set_card_front_and_back(e,a,!0);if(!q.no_intro_b[e]){var d=q.get_card_front(e,-1,!1,!0);d.html(qqc.decode_image_tags(deckdata[e].intro_html)),d.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this,!0)})),d.find("button").attr("disabled",!0)}t>1&&q.done(e);setTimeout((function(){for(var a=0,d=q.no_intro_b[e]?0:-1;d<t;d++){a+=$("div.card-container.preview-qdeck"+e+".preview-qcard"+d).outerHeight()}t>1&&(a+=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t).outerHeight());deckdata[e].$qcard_window.height(a)}),300),$("div.card-container").on("mouseenter",q.set_i_deck_i_card),$("button.qcard_flip").removeAttr("disabled").removeClass("qwiz_button_disabled"),deckdata[e].check_answer_disabled_b=!1,$("figure").css({position:"relative","z-index":2}),$("div.card-container").css({"margin-top":"10px"})}function button_flip_selector(e){var t="button.flip-qdeck"+e;return q.preview&&(t+="-qcard"+deckdata[e].i_card),t}function get_card_back(e,t,a,d){if(!d&&"back"==deckdata[e].showing_first)return q.get_card_front(e,t,a,!0);void 0===t&&(t=deckdata[e].i_user_card);var c=q.qwizard_b&&deckdata[e].use_dataset_card_ids[t];return a&&(c=!c),q.preview?$(c?"div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+t+" div.qcard-back div.qcard_content_size_alt":"div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+t+" div.qcard-back div.qcard_content_size"):c?deckdata[e].$qcard_card_back_alt:deckdata[e].$qcard_card_back}function process_html(){$('p:contains("[!]"), :header:contains("[!]")').each((function(){0==$(this).html().search(/\s*(<.+?>)*\s*\[!+\][^]*?\[\/!+\]\s*(<.+?>)*\s*$/m)&&$(this).remove()})),$('p:contains("qdeck"), :header:contains("qdeck")').each((function(){var e=$
15(this).html();0==e.search(/\s*\[\/{0,1}qdeck[^\]]*\]\s*/m)&&$(this).replaceWith(e)}));var e="",t=$("div.qdeck_wrapper"),a=$("div.qdeck_wrapper_fallback");if(t.length)e="div.qdeck_wrapper",a.css({display:"none"});else{if(0==a.length){$("head").append('<style type="text/css">\n.qdeck_wrapper_fallback_visible {\nvisibility: visible;\n}\n</style>\n')}e=content}n_decks=0;var d=0;$(e).each((function(){var e=$(this).html();if(e){if(-1!=(e.indexOf("[qdeck")||e.indexOf("[/qdeck"))){var a=q.process_html2(e,d);if(e=a.htm,d=a.i_deck,q.qdeckdemos)for(var c=q.qdeckdemos.length,r=0;r<c;r++){var i=q.qdeckdemos[r],n=i.length;i=i.substring(11,n-12),e=e.replace("<qdeckdemo></qdeckdemo>",i)}if(a.replace_body){const t=q.preview_i_deck_plus1-1;var _='<div class="preview_header"><h2 style="margin-bottom: 10px;">Preview deck</h2><a href="javascript: void (0)" style="float: right; margin-right: 50px;" onclick="'+qname+".reset_preview ("+t+')">Reload preview</a>';$("body").html(_+e),$("div.qcard_window").css({margin:"auto"})}else $(this).html(e);$(this).find("div.qcard_window").on("mouseenter",(function(e){if(void 0!==e.target.className.toLowerCase&&"qcard_window"==e.target.className.toLowerCase())document_active_qwiz_qdeck=e.target;else{var t=$(e.target).parents("div.qcard_window");t.length&&(document_active_qwiz_qdeck=t[0])}debug[7]&&(console.log("[qcard_window mouseenter] e.target:",e.target),console.log("[qcard_window mouseenter] document_active_qwiz_qdeck:",document_active_qwiz_qdeck))}))}if(t.length){const e=$(this);e.hasClass("qwiz_display_none")&&e.find("div.qcard_window").css({display:"none"}),e.contents().unwrap()}}else;n_decks=d,q.n_decks=d})),$("div.qdeck_wrapper").removeClass("qwiz_shortcodes_hidden");for(d=0;d<n_decks;d++){const e=deckdata[d].qrecord_id;if(e&&"no_check"!=e){var c={qwiz_qdeck:"qdeck",n_questions_cards:deckdata[d].n_cards};qqc.jjax(qname,d,e,"check_registered",c)}}n_decks&&!q.qwizard_b&&qqc.init_enter_intercept(),q.qrecord_b&&qqc.set_user_menus_and_icons(!1,!1,"doing_decks"),q.processing_complete_b=!0,document_qwiz_qdeck_html_completed_f=!0}function create_qwiz_icon_div(e){var t=[];t.push('<div id="icon_qdeck'+e+'" class="icon_qdeck">');var a=qqc.get_qwiz_param("icon_qwiz");if("Not displayed"!=a){var d=T("Want to use this flashcard deck in your own class?");"Icon only"!=a&&t.push('<a href="mailto:[email protected]" style="border: none; box-shadow: none;" target="_blank">');d=T("Questions, comments, suggestions?")+" [email protected]";t.push(' <img class="icon_qdeck" style="border: none;" title="'+d+'" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAIAAAALACogAAAABnRSTlMA/wD/AP83WBt9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABP0lEQVR4nGP8//8/AymAiSTV5GhgwSZ4rcRrxRooW3futlBnJDlGND/cXzXVccFLVP0oepiwqtZJyH2wrenBtogQBgYGhsv9q15j9cO1qTDVW8JEGRgYGBi0PJ0YGBgYrjzCpuH+qv1rGBgYGHQLoaoZGBgYlOTEGRgYGB68uY+h4fXuQy8ZGBgYnLSRvXjv0UsGBgYGBRFFdA1Prm+6x8DAwBBio4XsyO37GBgYGHTkEHaixYO4mszrWTl1CjmH7iMcKe5nhdAAi4cnL6/A3HbrHgMDw56pJ0QYIOHr5JgmgzASZoOFdggDAwPDy03HRCEhs6YJEne6c0uQHYkUcXt76pL3oTqQQbxqVjay8Sh+cC5pmuuEpkFMWQZNBCNpwMDrWTmT2+5hCCu54EqtomkVLjqYwgoiuGzACWifgQDhK2rq5bcX2gAAAABJRU5ErkJggg==" />'),"Icon only"!=a&&t.push("</a>")}return t.push("</div>"),t.join("")}function process_card_input(e,t,a){var d={got_it:!1},c=a;debug[1]&&console.log("[process_card_input] card_front_and_back_html: ",c);var r=qqc.opening_tag_shortcode_pos("[a]",c),i=c.substr(0,r);if(deckdata[e].qrecord_id)if(qqc.isInteger(deckdata[e].dataset_id[t])){var n=qqc.remove_tags_eols(c);deckdata[e].q_and_a_text[t]=qqc.q_and_a_hash(n)}else deckdata[e].q_and_a_text[t]=deckdata[e].dataset_id[t];set_qwizard_data_b&&(qw.questions_cards[t].type="simple_card",qw.questions_cards[t].question_text=i);var _=!1;-1!=i.indexOf("[textentry")&&(i=card_front_textentry_html(i,e),_=!0,set_qwizard_data_b&&(qw.questions_cards[t].type="optional_textentry")),d.card_front=i;var s=c.substr(r);debug[0]&&console.log("[process_card_input] card_back_html: ",s);var o="";if(s){var l=s.indexOf("[a]");o=s.substr(0,l),s=s.substr(l+3),qqc.is_only_tags_and_whitespace(s)&&errmsgs.push(T("Did not enter answer text -- card back")+". qdeck: "+(e+1)+", "+T("card")+" "+(t+1)+"\n"+a)}else if(!deckdata[e].use_dataset_card_ids[t]){var k=a.length>150?" ...":"";
15errmsgs.push(T('Did not find answer ("[a]" -- card back)')+". qdeck: "+(e+1)+", "+T("card")+" "+(t+1)+"\n"+a.substr(0,150)+k),s=""}q.qwizard_b&&-1!=s.indexOf('<span class="qwizard_placeholder">')&&errmsgs.push(T("Did not enter answer text -- card back")+". qdeck: "+(e+1)+", "+T("card")+" "+(t+1)+"\n"+a),set_qwizard_data_b&&(qw.questions_cards[t].answer_text=o+s);var h=s.split(/\[a\]/);if(1!=h.length&&errmsgs.push(T('Got more than one answer ("[a]") -- card back')+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)+"\n"+a),deckdata[e].qrecord_id&&qqc.isInteger(deckdata[e].dataset_id[t])){n=qqc.q_and_a_hash(qqc.remove_tags_eols(h[0]));deckdata[e].q_and_a_text[t]+="\n"+n}return d.card_back=create_card_back_html(e,t,h[0],o,_),d}function process_textentry(e,t,a){var d={got_it:!1},c="",r=qqc.opening_tag_shortcode_pos("([c]|[c*])",a);r==a.length?errmsgs.push(T("No answer-word given")+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)):c=a.substr(0,r),set_qwizard_data_b&&(qw.questions_cards[t].question_text=c,qw.questions_cards[t].choices=[],qw.questions_cards[t].correct_choice_fs=[],qw.questions_cards[t].feedbacks=[]);var i,n=!1,_=3,s="true"==default_use_dict,o="true"==default_use_terms,l=!1,q=c.match(/\[textentry([^\]]*)\]/m);if(q){var k=q[1];if(k){n="true"==get_attr(k=qqc.replace_smart_quotes(k),"plural");var h=get_attr(k,"minlength");""!=h&&(_=h);var u=get_attr(k,"use_terms");u&&(o="false"!=u);var p=get_attr(k,"use_dict");p&&(s="false"!=p),l="true"==get_attr(k,"single_char")}}else errmsgs.push(T("Free-form input choices [c] or [c*] card does not have [textentry]")+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t));set_qwizard_data_b&&(qw.questions_cards[t].type=l?"one_letter_answer":"textentry",qw.questions_cards[t].textentry_attributes=k);var m="";l?(i="qcard_single_char_entry",m='style="width: 2em;" '):i="qcard_textentry";var g='<div class="'+i+'">\n<input type="text" class="textentry-qdeck'+e+' autocomplete="off" '+i+'" '+m+'onfocus="'+qname+'.set_textentry_i_deck (this)" />\n<button id="textentry_hint-qdeck'+e+'" class="qwiz_button textentry_hint" onclick="'+qname+".textentry_hint ("+e+')" disabled>'+T("Hint")+"</button>\n</div>\x3c!-- END --\x3e\n";a=a.replace(/\[textentry([^\]]*)\]/,g),debug[0]&&console.log("[process_textentry] htm:",a);var b=["[c]","[c*]"],f=["[c]","[c*]","[x]"],v=qqc.opening_tag_shortcode_pos("([c]|[c*])",a),w=a.substr(v);if(a=a.substr(0,v),d.card_front=a,d.textentry_required_b=!0,deckdata[e].qrecord_id)if(qqc.isInteger(deckdata[e].dataset_id[t])){var y=a.replace(/<button[^]*Hint.[^]?<\/button>/,"");y=qqc.remove_tags_eols(y+w),deckdata[e].q_and_a_text[t]=qqc.q_and_a_hash(y)}else deckdata[e].q_and_a_text[t]=deckdata[e].dataset_id[t];d.choices=[],d.textentry_plural_b=n,d.textentry_minlength=_,d.use_terms_b=o,d.use_dict_b=s,d.single_char_b=l,d.feedback_htmls=[],d.all_choices=[],d.card_back="";set_qwizard_data_b&&(qw.questions_cards[t].textentry_plural_b=n);for(var x=0,z=!1;;){var A=qqc.parse_html_block(w,b,f);if("NA"==A)break;w=w.substr(A.length);var $=process_feedback_item(A);if(A=$.choice_html,$.feedback_html)!0,d.feedback_htmls.push($.feedback_html),process_feedback_item(A).feedback_html&&errmsgs.push(T("More than one answer or feedback shortcode [a] or [f] given with [textentry] choice")+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)+", "+T("choice")+" "+(1+x));else errmsgs.push(T("Did not get answer/feedback [a] or [f] for [textentry] choice")+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)+", "+T("choice")+" "+(1+x)),d.feedback_htmls.push("");set_qwizard_data_b&&(qw.questions_cards[t].feedbacks[x]=$.feedback_html),-1==(A=(A=A.replace(/.*\[c\*{0,1}\]/m,"")).replace(/<[^>]+>|\n| /g,"")).replace(";","").search(/\S/)&&errmsgs.push(T("No text given for [textentry] choice")+". qdeck: "+(e+1)+", "+T("card")+" "+(1+t)+", "+T("choice")+" "+(1+x));for(var C=A.split(/\s*;\s*/),I=[],O=0;O<C.length;O++)-1!=C[O].search(/\S/)&&I.push(qqc.trim(C[O]));"*"==I[0]&&(z=!0,""==d.feedback_htmls[x]&&errmsgs.push(T('For [textentry] card, wildcard choice ("*", for any other user entry) must be accompanied by answer/feedback "[a] or [f]"')+". qdeck: "+(e+1)+", "+T("card")+" "+(1+t)+", "+T("choice")+" "+(1+x))),d.choices.push(I),set_qwizard_data_b&&qw.questions_cards[t].choices.push(I.join(";"));var D=I.length;for(O=0;O<D;O++)-1!=d.all_choices.indexOf(I[O])&&errmsgs.push(T("Entry given in more than one [textentry] choice")+": "+I[O]+". qdeck: "+(e+1)+", "+T("card")+" "+(1+t)+", "+T("choice")+" "+(1+x));
15d.all_choices=d.all_choices.concat(I),x++}return set_qwizard_data_b&&(qw.questions_cards[t].n_choices=x),d.card_back="",z&&1==d.choices.length&&errmsgs.push(T('Need to define acceptable entries for [textentry] card in addition to "other entry" choice ([c] *)')+". qdeck: "+(e+1)+", "+T("card")+" "+(1+t)),debug[6]&&(console.log("[process_textentry] card.choices:",d.choices),console.log("[process_textentry] card.feedback_htmls:",d.feedback_htmls)),d}function process_hangman(e,t,a){var d=-1!=a.indexOf("hangman_img_wrapper"),c=d?"hangman_labeled_diagram":"hangman",r={got_it:!1};r.type=c;var i=a;if(i=i.replace(/(<[^\/][^>]*>\s*)*?\[a\][^]*/m,""),debug[0]&&console.log("[process_hangman] card_front_html: ",i),deckdata[e].qrecord_id)if(qqc.isInteger(deckdata[e].dataset_id[t])){var n=i.replace(/\[hangman[^\]]*\]/g,"_________");deckdata[e].q_and_a_text[t]=qqc.q_and_a_hash(qqc.remove_tags_eols(n))}else deckdata[e].q_and_a_text[t]=deckdata[e].dataset_id[t];var _,s=default_hangman_max_hints,o=!0;if(u=a.match(/\[hangman([^\]]*)\]/m)){var l=u[1];if(l){var k=get_attr(l=qqc.replace_smart_quotes(l),"hints");k&&(-1==k.search(/[^0-9]/)?s=parseInt(k):errmsgs.push(T('"hints" for [hangman] should be a number')+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t))),o=!("false"==get_attr(l,"type_letters"))}}var h=i.search(/(<[^\/][^>]*>\s*)*?\[c\*{0,1}\]/m);-1==h?(errmsgs.push(T("Did not get [c] or [c*] (hangman answer) with [hangman]")+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)),h=0,_=i):_=i.substr(0,h),set_qwizard_data_b&&(qw.questions_cards[t].type=c,qw.questions_cards[t].hangman_attributes=l,qw.questions_cards[t].question_text=_,qw.questions_cards[t].choices=[],qw.questions_cards[t].feedbacks=[]),debug[9]&&console.log("[process_hangman] question_htm:",_);for(var u,p=(u=_.match(/\[hangman/g)).length,m=i.substr(h),g=["[c]","[c*]"],b=["[c]","[c*]","[x]"],f=0;;){var v="",w=0,y=qqc.parse_html_block(m,g,b);if("NA"==y)break;m=m.substr(y.length);var x=y.match(/\[c\*{0,1}\]([^\[]*)/m);x&&(v=(v=x[1]).replace(/<[^>]+>|\n| /g,""),w=(v=qqc.trim(v)).length,debug[9]&&console.log("[process_hangman] hangman_answer:",v)),void 0===deckdata[e].hangman[t]&&(deckdata[e].hangman[t]={}),deckdata[e].hangman[t].hangman_answer||(deckdata[e].hangman[t].hangman_answer=[],deckdata[e].hangman[t].hangman_final_entry=[],deckdata[e].hangman[t].hangman_current_entry=[],deckdata[e].hangman[t].hangman_incorrect_chars=[],deckdata[e].hangman[t].hangman_n_hints=[]),0==f&&(deckdata[e].hangman[t].n_hangman_done=0,deckdata[e].hangman[t].hangman_max_hints=s,deckdata[e].hangman[t].hangman_type_letters=o,deckdata[e].hangman[t].n_hangman=p,deckdata[e].hangman[t].n_hangman_correct=0),deckdata[e].hangman[t].hangman_answer[f]=v,set_qwizard_data_b&&(qw.questions_cards[t].choices[f]=v),deckdata[e].hangman[t].hangman_n_hints[f]=0;var z=qqc.create_hangman_entry(v);deckdata[e].hangman[t].hangman_final_entry[f]=z;var A=new Array(w).join(" "),$=q.qwizard_b?' onfocus="qwizard.update_hangman_options_menu_choice (this, '+f+')"':"",C='<span class="qdeck_hangman qdeck_hangman_c'+f+'" onkeyup="'+qname+'.hangman_show (this, true)" onmouseenter="'+qname+'.hangman_show (this)" onmouseleave="'+qname+'.hangman_hide (this)"><span class="hangman_current_entry hangman_entry"></span><input type="text" oninput="'+qname+".hangman_keyup (this, event,' "+A+"', "+e+", "+t+", "+f+')" onblur="'+qname+'.hangman_hide (this.parentElement)"'+$+" />";if(s){s<v.replace(/[a-z0-9]/i,"").length&&' title="'+T("You can get")+" "+qqc.number_to_word(s)+" "+T("hint")+" "+plural(T("letter"),T("letters"),s)+'"',C+='<button id="hangman_hint-qdeck'+e+'" class="qwiz_button hangman_hint" onmouseenter="'+qname+'.hangman_show (this.parentElement)" onclick="'+qname+".hangman_hint ("+e+", "+t+", "+f+')" title="'+T("You can get two hint letters")+'">'+T("Hint")+"</button>\n"}o&&!q.qwizard_b&&(!d||d&&0==f)&&(C+='<span class="hangman_type_letters"></span>'),C+='<span class="hangman_status"></span></span>\x3c!-- END --\x3e',_=_.replace(/\[hangman[^\]]*\]/,C),f++}f!=p&&errmsgs.push("Number of [hangman] shortcodes does not match number of hangman words [c]. qdeck: "+(1+e)+", "+T("card")+" "+(1+t)),set_qwizard_data_b&&(qw.questions_cards[t].n_choices=f),r.card_front=_;var I=qqc.opening_tag_shortcode_pos("[a]",a),O=a.substr(I);debug[0]&&console.log("[process_hangman] card_back_html: ",O);var D="";if(O){var P=O.indexOf("[a]");D=O.substr(0,P),O=O.substr(P+3)}
15else errmsgs.push(T('Did not find answer ("[a]") -- card back -- for')+" qdeck "+(e+1)+", "+T("card")+" "+(t+1)+"\n"+a),O="";var Q=O.split(/\[a\]/);if(1!=Q.length&&errmsgs.push(T('Got more than one answer ("[a]" -- card back)')+". qdeck: "+(1+e)+", "+T("card")+" "+(1+t)+"\n"+a),deckdata[e].qrecord_id&&qqc.isInteger(deckdata[e].dataset_id[t])){n=qqc.remove_tags_eols(Q[0]);deckdata[e].q_and_a_text[t]+="\n"+qqc.q_and_a_hash(n)}return r.card_back=create_card_back_html(e,t,Q[0],D,!1),set_qwizard_data_b&&(qw.questions_cards[t].answer_text=D+Q[0]),r}function update_hangman_input(e,t,a,d,c,r,i,n){for(var _=!1,s=!1,o=-1,l=new RegExp("u>"+e+"</u","i");;){var k=a.substr(o+1).match(l);if(!k)break;o+=k.index+2,t=qqc.setCharAt(t,o+1,k[0][2]),s=!0}debug[9]&&console.log("[update_hangman_input] keychar:",e,", good_char_b:",s);var h=deckdata[d].hangman[c],u=h.hangman_incorrect_chars[r],p=(_=!1,!1);if(s){h.hangman_current_entry[r]=t;var m=t.replace(/\t/g," ");if($(i).siblings("span.hangman_current_entry").html(m),_=-1==t.indexOf("<u>\t</u>")){var g=h.n_hangman;h.n_hangman_done++,p=h.n_hangman_done==g}}else e=e.toLowerCase(),-1==u.indexOf(e)&&(u+=e).length>6&&(_=!0,h.n_hangman_done++,p=h.n_hangman_done==h.n_hangman),h.hangman_incorrect_chars[r]=u,debug[9]&&console.log("[hangman_keyup] hangman_incorrect_chars:",u);if(_){if($(i).on("mousedown",(function(e){e.preventDefault()})),i.parentElement.done_f=!0,u.length<=6&&0==h.hangman_n_hints[r]&&h.n_hangman_correct++,p)q.qwizard_b||(deckdata[d].answered_correctly[c]=g==h.n_hangman_correct),$(button_flip_selector(d)).removeAttr("disabled").removeClass("qwiz_button_disabled").html(T("Check answer")),deckdata[d].check_answer_disabled_b=!1,n||(h.n_hangman_correct<h.n_hangman&&(deckdata[d].hangman_incorrect_chars_f=!0),q.qdeck_flip(d,event,void 0,void 0,!0));else{var b=!0;for(r=0;r<g;r++)if(h.hangman_current_entry[r]!=h.hangman_final_entry[r]&&h.hangman_incorrect_chars[r].length<=6){var f=q.get_card_front(d).find("span.qdeck_hangman.qdeck_hangman_c"+r);b?(f.find("input").focus(),b=!1):f.find("span.hangman_type_letters").show()}}_=!0}return _}function single_char_textentry_keyup(e){var t=e.target;if(debug[6]&&console.log("[single_char_textentry_keyup] input_el:",t),-1==t.value.search(/[a-z0-9]/i))return t.value="",!1;var a=t.className.match(/textentry-qdeck([0-9]+)/)[1];q.qdeck_flip(a,event,void 0,void 0,!0)}function process_feedback_item(e){var t=qqc.parse_html_block(e,["[a]","[f]"],["[a]","[f]","[x]"]);return"NA"!=t?(e=e.replace(t,""),t=t.replace(/\[[af]\]/,""),debug[2]&&console.log("[process_feedback_item] feedback_html: ",t)):t="",debug[2]&&(console.log("[process_feedback_item] feedback_html:",t),console.log("[process_feedback_item] choice_html:",e)),{feedback_html:t,choice_html:e}}function create_card_back_html(e,t,a,d,c){var r=d+a;if(-1!=a.search(/\[.*textentry.*/))c||errmsgs.push(T("[textentry] on back of card, but not on front")+". qdeck: "+(e+1)+", "+T("card")+" "+(t+1)),r=card_back_textentry_html(r,e);else if(c){var i="";q.preview&&(i=" preview-qcard"+deckdata[e].i_card),r='<p class="back_textentry_p-qdeck'+e+" back_textentry_p"+i+'">'+T("You wrote")+' “<span class="back_qcard_textentry back_textentry-qdeck'+e+i+'">     </span>”</p>'+r}return debug[2]&&console.log("[create_card_back_html] new_html:",r),r}function process_header(e,t,a){var d=["[q]","[q "];null!=a&&d.push("[i]");var c=qqc.parse_html_block(e.substr(0,1e3),["[h]"],d,!0);if("NA"==c&&(c=""),c){var r=e.substr(0,200);r=qqc.trim(r);var i=qqc.opening_tag_shortcode_pos("[h]",r);r=r.substr(i,5);var n=c.replace(/<br[^>]*>/g,"");r!=(n=qqc.trim(n).substr(0,5))&&errmsgs.push(T("Text before header")+" [h]. qdeck: "+(t+1)),e=e.replace(c,""),c=c.replace(/\[h\]/gi,""),c=(c=qqc.balance_closing_tag(c)).replace(/<(p|h[1-6])[^>]*><\/(p|h[1-6])>/g,""),c=qqc.decode_image_tags(c)}return deckdata[t].header_html=c,e}function create_qdeck_divs(e,t){debug[0]&&console.log("[create_qdeck_divs] i_deck:",e);var a=t.match(/\[qdeck([^\]]*)\]/m),d=a[1];if(deckdata[e].scroll_b||document_qwiz_mobile||(deckdata[e].card_width_setting="500px",deckdata[e].card_height_setting="300px"),d){var c;if(-1!=(d=qqc.replace_smart_quotes(d)).search(/style\s*?=/m))-1!=d.search(/["\s;]width/)&&(c=new RegExp('width\\s*:\\s*([^;\\s"]*)[;\\s"]'),(a=d.match(c))&&(deckdata[e].card_width_setting=a[1],d=d.replace(c,""),'"'==a[0].slice(-1)&&(d+='"'))),-1!=d.search("height")&&(c=new RegExp('(min-)*height\\s*:\\s*([^;\\s]*)[;\\s"]'),(a=d.match(c))&&(deckdata[e].card_height_setting=a[2],d=d.replace(c,""),'"'==a[0].slice(-1)&&(d+='"')));deckdata[e].random_b="true"==get_attr(d,"random"),debug[0]&&console.log("[create_qdeck_divs] random_b:",deckdata[e].random_b)}d=d.replace(/align\s*=\s*"[^"]*"/,""),debug[0]&&console.log("[create_qdeck_divs] attributes: ",d);const r=qqc.get_qwiz_param("url","./");var i=[],n="";document_qwiz_mobile||(n="width: "+deckdata[e].card_width_setting+"; height: "+deckdata[e].card_height_setting+"; "),n+="z-index: "+Math.max(99-e,1)+";";var _=deckdata[e].align;if("center"==_?n+=" margin: auto;":"right"==_?n+=" margin-left: auto;
15":"tiled"==_&&(n+=" float: left;"),deckdata[e].spacing&&(n+=" margin-right: "+deckdata[e].spacing+"px !important; margin-top: 0 !important;"),i.push('<div id="qcard_window-qdeck'+e+'" class="qcard_window visibilityhidden" style="'+n+'">'),i.push('<div id="overlay-exit-mobile-qdeck'+e+'" class="overlay-exit-mobile-qwiz" onclick="'+qname+'.close_panel_exit_mobile(this)">'),i.push('<div id="panel-exit-mobile-qdeck'+e+'" class="panel-exit-mobile-qwiz">'),i.push('<button onclick="'+qname+".exit_mobile ("+e+')">'),i.push(T("Back to page view")),i.push("</button>"),i.push("<br />"),i.push("<span>"),i.push("("),i.push(T("To return to this full-screen view, tap")),i.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAk0lEQVR4nI3QMQ6EIBAF0BG2YLiGtjRcgt7EcBfDhShtbLwBHIgCJrPFbrGJqPvrl/k/MzAzPOUFAMYYRCSiaZpijGckAAARSynM3BVf1FpTSkkpQwiXaBzHnLNzbtu2Lhr+GS4exSUyxqzrCgDLssDnBefM87zv+3EcRHS3yVpba0XElFK/znsvhNBal1LuLv3mDbu1OYLB67+mAAAAAElFTkSuQmCC" />'),i.push(")"),i.push("</span>"),i.push('<div class="panel-icon-exit-mobile-qwiz" style="margin-left: -5px;"></div>'),i.push("</div>"),i.push("</div>"),i.push('<div id="icon-exit-mobile-qdeck'+e+'" class="icon-exit-mobile-qwiz" onclick="'+qname+".open_panel_exit_mobile ("+e+')"></div>'),i.push(' <div id="qcard_progress-qdeck'+e+'" class="qcard_progress">'),!q.qwizard_b){const t=T("Full-screen view");i.push('<div class="go-mobile-qdeck go-mobile-qdeck'+e+'" onclick="'+qname+".go_mobile ("+e+')" title="'+t+'">'),i.push("</div>"),i.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAKwmlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU9kWhs+96Y2WEAEpofcuXUroAZReRSUkgYQSY0JQsSviCCqKiAiWoQxVwUEpMhbEgm1QbNgnyKCiPgcLNlTeBYYw89567633r3XW/e6+++y9z1nnrLUvABQ8WyTKgJUAyBRmiSMCvBlx8QkM3O8AAligChSAHpsjETHDwkIAounn3/XhDuKN6KblRKx///5fpczlSTgAQGEIJ3MlnEyEjyHjNUckzgIAVY3Y9ZdliSb4IsI0MVIgwg8nOHWKRyY4eZLR6EmfqAgfhNUAwJPZbHEqAGQDxM7I5qQicci+CNsIuQIhwsg78ODw2VyEkbzAIjNzyQTLEDZJ/kuc1L/FTJbHZLNT5Ty1lknhfQUSUQZ7xf+5Hf9bmRnS6RxGyCDzxYERyJOO7Nnd9CXBchYmzw+dZgF30n+S+dLA6GnmSHwSppnL9g2Wz82YHzLNKQJ/ljxOFitqmnkSv8hpFi+JkOdKEfswp5ktnskrTY+W2/k8ljx+Dj8qdpqzBTHzp1mSHhk84+Mjt4ulEfL6ecIA75m8/vK1Z0r+sl4BSz43ix8VKF87e6Z+npA5E1MSJ6+Ny/P1m/GJlvuLsrzluUQZYXJ/XkaA3C7JjpTPzUIO5MzcMPkeprGDwqYZhIAAwADRIANkATFgIxwIkJOaxVs+cUaBzxLRCrEglZ/FYCK3jMdgCTlWFgw7GzsbACbu7NSReHd38i5CdPyMTYJ4uG5DjKIZ20IaAMf4AChwZmxGRch1JAFwNoEjFWdP2SauE8AAIlAENKAOtIE+MAGWwA44AjfgBfxAEAgFUSAeLAIcwAeZSOXLwCqwHuSBArAD7AZl4CCoAnXgMGgB7eAEOAMugCvgOrgNHgAZGAIvwQj4AMYgCMJBFIgKqUM6kCFkDtlBzpAH5AeFQBFQPJQEpUJCSAqtgjZCBVARVAZVQPXQz9Bx6Ax0CeqD7kED0DD0FvoCo2AyTIO1YCPYGnaGmXAwHAUvhFPhpXAOnAtvh0vhSvgQ3Aafga/At2EZ/BIeRQEUCUVH6aIsUc4oH1QoKgGVghKj1qDyUSWoSlQTqhPVg7qJkqFeoT6jsWgqmoG2RLuhA9HRaA56KXoNeiu6DF2HbkOfQ99ED6BH0N8xFIwmxhzjimFh4jCpmGWYPEwJpgbTijmPuY0ZwnzAYrF0rDHWCRuIjcemYVdit2L3Y5uxXdg+7CB2FIfDqePMce64UBwbl4XLw+3FHcKdxt3ADeE+4Ul4Hbwd3h+fgBfiN+BL8A34U/gb+Gf4MYISwZDgSgglcAkrCIWEakIn4RphiDBGVCYaE92JUcQ04npiKbGJeJ74kPiORCLpkVxI4SQBaR2plHSEdJE0QPpMViGbkX3IiWQpeTu5ltxFvkd+R6FQjChelARKFmU7pZ5ylvKY8kmBqmClwFLgKqxVKFdoU7ih8FqRoGioyFRcpJijWKJ4VPGa4islgpKRko8SW2mNUrnScaV+pVFlqrKtcqhypvJW5QblS8rPVXAqRip+KlyVXJUqlbMqg1QUVZ/qQ+VQN1KrqeepQzQszZjGoqXRCmiHab20EVUV1TmqMarLVctVT6rK6Ci6EZ1Fz6AX0lvod+hfZmnNYs7izdoyq2nWjVkf1Wareanx1PLVmtVuq31RZ6j7qaer71RvV3+kgdYw0wjXWKZxQOO8xqvZtNluszmz82e3zL6vCWuaaUZortSs0ryqOaqlrRWgJdLaq3VW65U2XdtLO027WPuU9rAOVcdDR6BTrHNa5wVDlcFkZDBKGecYI7qauoG6Ut0K3V7dMT1jvWi9DXrNeo/0ifrO+in6xfrd+iMGOgbzDFYZNBrcNyQYOhvyDfcY9hh+NDI2ijXabNRu9NxYzZhlnGPcaPzQhGLiabLUpNLklinW1Nk03XS/6XUz2MzBjG9WbnbNHDZ3NBeY7zfvs8BYuFgILSot+i3JlkzLbMtGywErulWI1QardqvX1gbWCdY7rXusv9s42GTYVNs8sFWxDbLdYNtp+9bOzI5jV253y55i72+/1r7D/s0c8zm8OQfm3HWgOsxz2OzQ7fDN0clR7NjkOOxk4JTktM+p35nmHOa81fmiC8bF22WtywmXz66OrlmuLa5/uFm6pbs1uD2fazyXN7d67qC7njvbvcJd5sHwSPL40UPmqevJ9qz0fOKl78X1qvF6xjRlpjEPMV9723iLvVu9P/q4+qz26fJF+Qb45vv2+qn4RfuV+T321/NP9W/0HwlwCFgZ0BWICQwO3BnYz9JicVj1rJEgp6DVQeeCycGRwWXBT0LMQsQhnfPgeUHzds17ON9wvnB+eygIZYXuCn0UZhy2NOyXcGx4WHh5+NMI24hVET2R1MjFkQ2RH6K8owqjHkSbREuju2MUYxJj6mM+xvrGFsXK4qzjVsddideIF8R3JOASYhJqEkYX+C3YvWAo0SExL/HOQuOFyxdeWqSxKGPRycWKi9mLjyZhkmKTGpK+skPZlezRZFbyvuQRjg9nD+cl14tbzB3mufOKeM9S3FOKUp6nuqfuSh3me/JL+K8EPoIywZu0wLSDaR/TQ9Nr08czYjOaM/GZSZnHhSrCdOG5JdpLli/pE
155mL8kSypa5Ldy8dEQeLaySQZKGkI4uGNEdXpSbSTdKBbI/s8uxPy2KWHV2uvFy4/OoKsxVbVjzL8c/5aSV6JWdl9yrdVetXDaxmrq5YA61JXtO9Vn9t7tqhdQHr6tYT16ev/3WDzYaiDe83xm7szNXKXZc7uClgU2OeQp44r3+z2+aDP6B/EPzQu8V+y94t3/O5+ZcLbApKCr5u5Wy9vM12W+m28e0p23sLHQsP7MDuEO64s9NzZ12RclFO0eCuebvaihnF+cXvdy/efalkTsnBPcQ90j2y0pDSjr0Ge3fs/VrGL7td7l3evE9z35Z9H/dz99844HWg6aDWwYKDX34U/Hi3IqCirdKosqQKW5Vd9bQ6prrnJ+ef6ms0agpqvtUKa2V1EXXn6p3q6xs0Gwob4UZp4/ChxEPXD/se7miybKpopjcXHAFHpEde/Jz0852W4Jbuo85Hm44ZHtvXSm3Nb4PaVrSNtPPbZR3xHX3Hg453d7p1tv5i9UvtCd0T5SdVTxaeIp7KPTV+Ouf0aJeo69WZ1DOD3Yu7H5yNO3vrXPi53vPB5y9e8L9wtofZc/qi+8UTl1wvHb/sfLn9iuOVtqsOV1t/dfi1tdext+2a07WO6y7XO/vm9p264XnjzE3fmxdusW5duT3/dt+d6Dt3+xP7ZXe5d5/fy7j35n72/bEH6x5iHuY/UnpU8ljzceVvpr81yxxlJwd8B64+iXzyYJAz+PJ3ye9fh3KfUp6WPNN5Vv/c7vmJYf/h6y8WvBh6KXo59irvH8r/2Pfa5PWxP7z+uDoSNzL0Rvxm/O3Wd+rvat/Ped89Gjb6+EPmh7GP+Z/UP9V9dv7c8yX2y7OxZV9xX0u/mX7r/B78/eF45vi4iC1mT7YCKGTAKSkAvK0FgBIPAPU6AMQFUz31pKCp/4BJAv+Jp/ruSTkCgIQC0V0ATLRoVX+2tIrIe5gXAFFeALa3l48/JUmxt5uKRWpHWpOS8fF3SP+IMwXgW//4+Fj7+Pi3GqTY+wB0fZjq5SekjfxXLMADqHzTrZYB8K/6J1bAD27htQDfAAAACXBIWXMAABYlAAAWJQFJUiTwAAACBGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NDY4PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjQ2NjwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrdRrnkAAADWklEQVRIDZ1VW08TQRT+uvRqCBoI5ckCD3JRjEALCfFNMJHfIH9B0V+BkIj6omgiEilPBiFyT+TRAAX1wQj0JpBIFYQaa6Db7WWcc8rWBKl2nWR2Z3bOfOf2nbMmfzAk1tfWYLfbkclkABN4KIqCpJZEs7sZ5eVOpFIpmExHh1mRwp53+/uFlMw7P3xcFRkhxGEiIVQtaXiaHQ4HW+LxtCAS2UZxcTHS6TS2IxG8np/HhfP1SEhPFJNSmMXHpJRMhowHYrEfUkEEaiKBcDgMr3cEl9vaEFcTx64Y2yp6zK1WG5wVFUglk4wwNPQMgVAYp+y2bG6M4eakFY6+3MbVOHZ3dqCqKmpqazE5MQGPTHAw/ImVUNj+ZyhWq5XvlZWVoae3F9FoFAG/Hw0NF/EzFkODzIHuicy1cR29fX3MIN/yirwvxIvRUd47nRVCesJrm80mAqGQSMvzQ9UYm/D23Xux6FtmcKIhUXJ0bIyBJf/FpcZGXkvTxe7evkhLgYO4WjBdQVYRaDyh5awjbS/Hxhn4rMvF74ePBvg8kUyxbKE1gd/AGltFIaBv
15NMZfTTD4wOMnIiWt0FLpHDjJHar/9sRElhzPHLWMoqIiULsIh0JwVVbCYrEgKSlM36ltyLzI4oOsG43ljmPo+xMV0KF0gGXsVgtkWHhPCgncIWvj294+Dg8OUFXpoijkVZK3/qmx0ZShYHBaUy1Q4UWj39F98waqqyqxHgjCYbPyWbalZY2jKLCRhSaLYk55iHzdEde7ujg35CjN1XU/pYzZRXKESSMpKYdCFRA1aSwsLjHouZoa0djUlFOkKyEiEOb07Kz4HPlSuAK6ROwiWk9OzzBwSUmJqD0qRt0TovzTwUE+f7OwaFyB7v7k1DSDyPYu6urreX2lvV303OnlNSn0rawYU6B7odfJ1JEnBFZXV5cDdrvdvF5c8om8LJKXThzEJhkFyh06O69hZm6O5YLBIFwuF6qqq+W/JZa9K+vEsAK6SfVANKR/VUfHVXTfus001TQNmxsboLeuwXy0MvQiD8xmM4N6h5/jwf17aGltRTwex+kzZ1BaWoqtra0sJsXV6KQcEFuGvSO5uEu0P9bEoryt4m8ukQfUkwKBALY2N7kv8R9Pxlwf0gK4PR78Ak4cQYObEn/YAAAAAElFTkSuQmCC" class="go-mobile-qdeck go-mobile-qdeck'+e+'" />')}var s=T("Exit full-screen view");i.push('<div class="exit-mobile-qdeck exit-mobile-qdeck'+e+'" onclick="'+qname+".exit_mobile ("+e+')" title="'+s+'">'),i.push("</div>"),i.push('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAoVJREFUSA2lVj2PEkEY3plZV5I9Q3KBqzFHQkFJaCx0sTCxo6EnsfMPWPjBctqoueqMNf/CwtODxo7ySCxMaAjhgiRGiXjsh8+zzl5WKoZ7k+GdnZ33ed6PeWdRtVrtxnQ6jWxbvrUs8SCO449cq1Qqst1uWxBVr9fFaDSKW62WouaikTiO0xVCxBy2bXdpXC6Xb5ZKpZzv+xKkIp/PH3JuBMzN9FyD/4Fea5IjvmMk1FLKExAfc24sMH6tCQgeYgSa5BXB4MAz/ewbg6cG8M4niAZPotDPZ1ozdZ10v5GuVqsODTIkJGIkkQZn6q5qYwSOzbJYLEYsaBAEvlLqpQYQWq+h07leMlPS87wI4IIFhX4B8zMNGkAnRTaD/H+37Pf7PO+Xw+FwzYLidQPjUm9jBCSiRP+U4S+bJ44twaOoc570w+YcNUIjmkuSXzbRcrl8DPOfGOzUbEPR8z0QfFitVp8xNxNGsG2Hpo1nxmC4e1sSOo0DZO90BHO53H2cuIfw7RfGZjqJeWt/331/cfHjG+bmwoJvHoLss1LyHS9Ipl+ZwyeX3x0AeLD9re15EEIM9KrqhGH4BIQSV7vMhqf3bqVSOxu702bkldNH6o5Yp16v57CJd42ggQjuAZCec5CIchvpsyeTyWmhUFCLxcK6LgHTklyW0OwfAeK74JDz+fzUdd2UGK8MBACdTFGvrnSs8apPvyddQl4nAg8FfR5F0SOmhZ4DL4kCOsRzA9fPHkmMBXjHOIonNEwbD2tdHRWjSL4hIHhjDM4OPTjIH8JDwTn/GPB7QiCQpF9GfqB8ru2SInV+/vX7YDCwx+OxaDabAU8LCzqbzT7BaxcRfEEvPGV0fwEIA/zW345reQAAAABJRU5ErkJggg==" class="exit-mobile-qdeck exit-mobile-qdeck'+e+'" />');n="";(deckdata[e].n_cards>1||deckdata[e].use_dataset||deckdata[e].combo||deckdata[e].use_dataset_card_html)&&!q.preview&&(deckdata[e].hide_forward_back_b&&(n=' style="visibility: hidden;"'),s=deckdata[e].use_dataset&&deckdata[e].dataset_intro_f?T("Go to “Choose cards”"):T("Go to first card"),i.push('<span class="bbfe bbfe-qdeck'+e+" bck-card-qdeck"+e+'"'+n+' onclick="'+qname+".bck_card ("+e+', true )" title="'+s+'">'),i.push('<img class="icon-beg-end-qwiz" src="'+r+'/images/icon_beg.svg">'),i.push("</span>"),i.push('<span class="bbfe bbfe-qdeck'+e+" bck-card-qdeck"+e+'"'+n+' onclick="'+qname+".bck_card ("+e+', false)" title="'+T("Go to previous card")+'">'),i.push('<img class="icon-bck-fwd-qwiz" src="'+r+'/images/icon_bck.svg">'),i.push("</span>"),i.push('<span class="card-number-qdeck card-number-qdeck'+e+'"'+n+">"),i.push("</span>"),i.push('<span class="bbfe bbfe-qdeck'+e+" fwd-card-qdeck"+e+'"'+n+' onclick="'+qname+".fwd_card ("+e+', false)" title="'+T("Go to next card")+'">'),i.push('<img class="icon-bck-fwd-qwiz" src="'+r+'/images/icon_fwd.svg">'),i.push("</span>"),i.push('<span class="bbfe bbfe-qdeck'+e+" fwd-card-qdeck"+e+'"'+n+' onclick="'+qname+".fwd_card ("+e+', true )" title="'+T("Go to most-recent card")+'">'),i.push('<img class="icon-beg-end-qwiz" src="'+r+'/images/icon_end.svg">'),i.push("</span>"));var o="";if(deckdata[e].deck_timer&&!q.preview&&(o="0:00"),i.push('<span id="qdeck'+e+'-deck_timer" class="deck-timer">'+o+"</span>"),deckdata[e].qrecord_id){i.push(" "),i.push('<span class="response_recorded_wrapper response_recorded_wrapper-qdeck'+e+'">'),i.push('<span class="response_recorded response_recorded-qdeck'+e+'">'),i.push(`<img src="${r}/images/recording.svg" class="response_recording" >`),i.push("</span>"),i.push("</span>"),i.push('<div class="qwiz_icon_and_menu_container lock_unlock qdeck'+e+'">'),i.push('<div id="locked-deck'+e+'" class="qwiz-locked qwiz_menu_icon">'),i.push(`<img src="${r}/images/icon_locked.png" />`),i.push("</div>"),i.push('<div id="unlocked-deck'+e+'" class="qwiz-unlocked qwiz_menu_icon">'),i.push(`<img src="${r}/images/icon_unlocked.png" />`),i.push("</div>"),i.push('<div class="qwiz_icon_trigger_and_menu qwiz-hover">'),i.push('<div class="qwiz_icon_trigger">'),i.push("</div>"),i.push('<div id="pay_unlock_menu-qdeck'+e+'" class="qdeck-pay_unlock_menu qwiz_menu">'),i.push("</div>"),i.push("</div>"),i.push("</div>");var l="";(q.no_intro_b[e]||1==deckdata[e].n_cards)&&(l=" qwiz-usermenu_icon_no_intro"),i.push('<div class="qwiz_icon_and_menu_container qdeck'+e+'">'),i.push('<div class="qwiz-usermenu_icon qwiz_menu_icon'+l+'">'),i.push("▼"),i.push("</div>"),i.push('<div class="qwiz_icon_trigger_and_menu qwiz-hover">'),i.push('<div class="qwiz_icon_trigger" style="left: -12px; top: -4px;">'),i.push("</div>"),i.push('<div id="usermenu-qdeck'+e+'" class="qdeck-usermenu qwiz_menu">'),i.push("</div>"),i.push("</div>"),i.push("</div>")}if(n="",deckdata[e].hide_progress_b&&(n=' style="display: none;"'),i.push('<span class="progress_text"'+n+">"),i.push("</span>"),i.push("</div>"),i.push(`<div class="qcard-progress_meter-qdeck${e} qcard-progress_meter">`),i.push("</div>"),i.push(`<div id="qcard_header-qdeck${e}" class="qcard_header qcard_editable">`),i.push("</div>"),q.preview){if(q.no_intro_b[e]||(i=i.concat(card_container_divs(e,d,-1))),deckdata[e].use_dataset)i.push('<div class="preview-dataset-placeholder qwiz_display_none"></div>'),deckdata[e].attributes=d;else for(var k=deckdata[e].n_cards,h=0;h<k;h++)i=i.concat(card_container_divs(e,d,h));k>1&&(i=i.concat(card_container_divs(e,d,k)))}else i=i.concat(card_container_divs(e,d));return q.preview||(i.push('<div id="qcard_next_buttons-qdeck'+e+'" class="qcard_next_buttons">'),i.push("</div>")),i.push(' <div class="qdeck-focusable">'),i.push(' <input type="text" />'),i.push(" </div>"),i.push("</div>"),i.join("\n")}function card_container_divs(e,t,a){debug[0]&&console.log("[card_container_divs] i_card:",a);var d,c=[],r="",i="";void 0!==a&&(r=" preview-qdeck"+e+" preview-qcard"+a,i=", "+a),d=-1==t.indexOf("border")?" qcard-border-important":" qcard-border";var n="";!q.qwizard_b&&deckdata[e].click_flip_b&&(n=' onclick="'+qname+".qdeck_flip ("+e+", event "+i+')"');var _="";chromebook_b&&(_=' style="backface-visibility: visible;"');const s=q.qwizard_b?" qwizard_line_height":"",o=deckdata[e].font_weight_normal?" qcard_content-normal":"";c.push('<div class="card-container'+r+'"> '),c.push('<div class="qcard_card-qdeck'+e+' qcard_card"'+_+">"),c.push('<div class="qcard-front qcard-front-back'+d+'" '+t+n+">"),c.push('<div class="qcard_content'+o+s+'">'),c.push('<div class="qcard_content_size">'),q.qwizard_b&&(c.push('<div id="qcard_front-part0-qdeck'+e+'" class="qcard-part0" style="display: none;">'),c.push("</div>"),c.push('<div id="qcard_front-part1-qdeck'+e+'" class="qcard_front-parts qcard-part1 qcard-inline qcard_editable" data-i_part="1">'),c.push("</div>"),c.push('<div id="qcard_front-input1-qdeck'+e+'" class="qcard_front-inputs qcard-inline">'),c.push("</div>"),c.push('<div id="qcard_front-part2-qdeck'+e+'" class="qcard_front-parts qcard-part2 qcard-inline qcard_editable" data-i_part="2">'),c.push("</div>"),c.push("</div>"),c.push('<div class="qcard_content_size_alt">')),c.push("</div>"),c.push("</div>"),c.push("</div>"),c.push('<div class="qcard-back qcard-front-back'+d+'" '+t+n+">"),c.push('<div class="qcard_content'+o+s+'">'),c.push('<div class="qcard_content_size">'),q.qwizard_b&&(c.push('<div id="qcard_back-echo-qdeck'+e+'" class="qcard-inline">'),c.push("</div>"),c.push('<div id="qcard_back-part1-qdeck'+e+'" class="qcard-part1 qcard-inline qcard_editable">'),c.push("</div>"),c.push("</div>"),c.push('<div class="qcard_content_size_alt">')),c.push("</div>"),c.push("</div>"),c.push("</div>"),c.push("</div>");var l="";
15return deckdata[e].card_time_limit&&!q.preview&&(l=qqc.hhmmss_from_sec(deckdata[e].card_time_limit)),c.push('<div id="qdeck'+e+'-card_timer" class="card-timer">'+l+"</div>"),c.push("</div>"),q.preview&&a>=0&&a<deckdata[e].n_cards&&c.push('<button class="qwiz_button qcard_flip flip-qdeck'+e+"-qcard"+a+'" onclick="'+qname+".qdeck_flip ("+e+", event, "+a+')" title="'+T("Show the other side")+'">'+T("Check answer")+"</button>"),debug[0]&&console.log("[card_container_divs] divs:",c),c}function record_qcard(e,t,a,d){if(!q.preview&&!q.qwizard_b&&!d){const t=DateFormat.format.date((new Date).getTime(),"h:mm:ss");$("span.response_recorded_wrapper-qdeck"+e).css({display:"inline-block"}).attr("title",T("Recording your response at")+" "+t+" - "+T("not complete"));$(`span.response_recorded-qdeck${e} img.response_recording`).addClass("response_recording_spin").removeAttr("title")}if(document_qwiz_maker_privileges||document_qwiz_mobile||$.cookie(document_qwiz_username+"do_not_show_assign_to_class")||"start"!=a.type||!deckdata[e].qrecord_id_not_ok||("not in a class"==deckdata[e].qrecord_id_not_ok?($(".has_not_been_assigned").hide(),$(".not_in_a_class").show(),$("div#qwizcards_dialog_no_credit").parent().find(".ui-dialog-title").html(T("You are not in a class"))):(qcard_.assign_to_class_i_deck=e,qcard_.assign_to_class_qrecord_id=t,$(".has_not_been_assigned").show(),$(".not_in_a_class").hide(),$("div#qwizcards_dialog_no_credit").parent().find(".ui-dialog-title").html(T("Flashcard deck not assigned in your class"))),qcard_.$dialog_no_credit.dialog("open").dialog("moveToTop")),a.got_it_f){update_progress_meter(e,t,decodeURIComponent(atob(a.q_and_a_text)))}qqc.qjax(qname,e,t,"record_qcard_v3",a)}function update_progress_meter(e,t,a){let d=a+"||not_set||flashcard";if(qqc.question_card_ids_by_qrecord_id[t]){if(-1==qqc.question_card_ids_by_qrecord_id[t].indexOf(d)){qqc.question_card_ids_by_qrecord_id[t].push(d);const a=qqc.question_card_ids_by_qrecord_id[t].length;$(`div.qcard-progress_meter-qdeck${e}`).css({"--m":a})}}else qqc.question_card_ids_by_qrecord_id[t]=[d],$(`div.qcard-progress_meter-qdeck${e}`).css({"--m":1})}function check_qdeck_tag_pairs(e){var t="",a=e.match(/\[qdeck|\[\/qdeck\]/gm);if(a){var d=a.length,c=!1;if(d%2!=0)c=!0;else for(var r=0;r<d;r++)if(r%2==0){if("[qdeck"!=a[r]){c=!0;break}}else if("[/qdeck]"!=a[r]){c=!0;break}if(c){const a=e.search(/<[pa] class="more-link|<div class="(search|blog)-entry-readmore/);if(-1!=a){const d=e.indexOf("[qdeck");t=-1!=d?e.substring(0,d)+e.substr(a):e}else if(-1!=e.indexOf('class="entry-summary')){const a=e.indexOf("[qdeck"),d=e.search(/\s*\[\u2026\]/);t=-1!=a&&-1!=d?e.substring(0,a)+e.substr(d):e}else errmsgs.push(T("Unmatched [qdeck] - [/qdeck] pairs.")),t="NA"}}return t}function card_front_textentry_html(e,t){var a='<div class="qcard_textentry"><input id="qdeck-textentry" type="text" class="textentry-qdeck'+t+' qcard_textentry" /></div>\x3c!-- END --\x3e';return e=e.replace(/\[textentry[^\]]*\]/,a),debug[0]&&console.log("[card_front_textentry_html] htm: ",e),e}function card_back_textentry_html(e,t){var a="";return q.preview&&(a=" preview-qcard"+deckdata[t].i_card),e=(e=-1!=e.indexOf('class="back_textentry"')?e.replace("back_textentry","back_textentry-qdeck"+t+a):e.replace("textentry",'<span class="back_textentry-qdeck'+t+a+' back_qdeck_textentry"></span>')).replace(/\[([^[]*textentry.*?)\]/,'<p class="back_textentry_p-qdeck'+t+a+' back_textentry_p">$1</p>'),debug[0]&&console.log("[card_back_textentry_html] htm:",e),e}function init_element_pointers(e){deckdata[e].$qcard_window=$("div#qcard_window-qdeck"+e),deckdata[e].$qcard_container=$("div#qcard_window-qdeck"+e+" div.card-container"),deckdata[e].$progress=$("div#qcard_progress-qdeck"+e),deckdata[e].$progress_text=$("div#qcard_progress-qdeck"+e+" span.progress_text"),deckdata[e].$header=$("div#qcard_header-qdeck"+e),deckdata[e].$qcard_card=$("div.qcard_card-qdeck"+e),deckdata[e].$qcard_card_front_back=$("div.qcard_card-qdeck"+e+" div.qcard-front-back"),deckdata[e].$qcard_card_front=$("div.qcard_card-qdeck"+e+" div.qcard-front div.qcard_content_size"),deckdata[e].$qcard_card_front_alt=$("div.qcard_card-qdeck"+e+" div.qcard-front div.qcard_content_size_alt"),deckdata[e].$qcard_card_back=$("div.qcard_card-qdeck"+e+" div.qcard-back div.qcard_content_size"),deckdata[e].$qcard_card_back_alt=$("div.qcard_card-qdeck"+e+" div.qcard-back div.qcard_content_size_alt"),deckdata[e].$next_buttons=$("div#qcard_next_buttons-qdeck"+e),q.qwizard_b&&(deckdata[e].$qcard_front_part1=$("#qcard_front-part1-qdeck"+e),deckdata[e].$qcard_back_part1=$("#qcard_back-part1-qdeck"+e)),debug[5]&&console.log("[init_element_pointers] $next_buttons:",deckdata[e].$next_buttons)}function get_login_html(e,t,a,d){t=t?1:0,d=d?1:0;var c="onfocus=\"jQuery ('#qdeck_login-qdeck"+e+" p.login_error').css ('display', 'none')\"",r='<div id="qdeck_login-qdeck'+e+'" class="qdeck-login">\n<p>';r+=a?"<strong>"+a+"</strong>":t?"<strong>"+T("Add team member")+"</strong>":"<strong>"+T("Record score/credit?")+"</strong>",r+="</p>",r+='<form action="nada" onSubmit="return qcard_.login ('+e+", "+t+", "+d+')">\n<table><tr><td><label for="qdeck_username-qdeck'+e+'"><nobr>'+T("Login name")+'</nobr></label></td><td><input type="text" id="qdeck_username-qdeck'+e+'" '+c+' /></td></tr><tr><td><label for="qdeck_password-qdeck'+e+'">'+T("Password")+'</label></td><td><input type="password" id="qdeck_password-qdeck'+e+'" /></td></tr><tr><td style="text-align: right;"><span class="qdeck-remember" title="'+T("Save preference (do not use on shared computer)")+'"><label><span class="qdeck-remember"><input type="checkbox" /> '+T("Remember")+'</span></label></span></td><td><button class="qwiz_button">'+T("Student login")+"</button> ",t||(r+='<button type="button" class="qwiz_button" onclick="qwiz_qcards_common.create_register_taker_screen (\''+qname+"', "+e+", "+d+')">'+T("New student - register")+"</button> "),r+='<button type="button" class="qwiz_button" onclick="'+qname+".no_login ("+e+","+t+')">',r+=T(t?"Cancel":"No thanks"),r+="</button></td></tr>",t||(r+='<tr><td></td><td class="qdeck-smaller"><a href="'+qqc.get_qwiz_param("server_loc","//qwizcards.com/admin")+'/password_reset_request" target="_blank">'+T("Forgot password?")+"</a></td></tr>");var i="new_account";return-1!=window.location.href.indexOf("learn-biology.com")&&(i="new_account_smv"),r+='<tr><td colspan="2"><hr style="margin: 5px;"></td></tr><tr><td colspan="2" class="qdeck-center"><b>
15'+T("Teachers: track your students’ progress on quizzes and flashcards")+'. <a href="'+qqc.get_qwiz_param("secure_server_loc","https://qwizcards.com/admin")+"/"+i+'" target="_blank"><nobr>'+T("Create teacher administrative account")+'</nobr></a></b></td></tr></table>\n</form><p class="login_error">'+T("Login incorrect. Please try again")+"</p>\n</div>\n"}function alert_not_logged_in(e){q.no_intro_b[e]&&deckdata[e].qrecord_id&&$.cookie("qwiz_user_login")&&("undefined"!=typeof document_qwiz_user_logged_in_b&&document_qwiz_user_logged_in_b&&"undefined"!=typeof document_qwiz_username||document_qwiz_declined_login_b||document_qwiz_not_logged_in_alerted||q.qwizard_b||(alert("Note: you are not logged in. You must be logged in to receive credit."),document_qwiz_not_logged_in_alerted=!0))}function showing_front(e){var t=!0;if(q.preview)if(deckdata[e].showing_front_bs){var a=deckdata[e].i_card;void 0!==deckdata[e].showing_front_bs[a]&&(t=deckdata[e].showing_front_bs[a])}else deckdata[e].showing_front_bs=[];else t=deckdata[e].showing_front_b;return t}function toggle_showing_front(e){if(q.preview){var t=deckdata[e].i_card;deckdata[e].showing_front_bs?void 0!==deckdata[e].showing_front_bs[t]?deckdata[e].showing_front_bs[t]=!deckdata[e].showing_front_bs[t]:deckdata[e].showing_front_bs[t]=!1:(deckdata[e].showing_front_bs=[],deckdata[e].showing_front_bs[t]=!1)}else deckdata[e].showing_front_b=!deckdata[e].showing_front_b}function set_header(e,t,a){if(null!=a){var d=deckdata[e].header_html;d?deckdata[e].$header.html(d):deckdata[e].$header.hide()}var c=$("div.qcard_card-qdeck"+e+" div."+t).outerWidth();if(debug[0]&&console.log("[set_header] qcard_width: ",c),deckdata[e].card_width_setting){var r=deckdata[e].card_width_setting.replace("px","");c<r&&(c=r)}return"center"!=deckdata[e].align&&"right"!=deckdata[e].align||document_qwiz_mobile||deckdata[e].$qcard_window.width(c),c}function init_code_highlight(e){if("undefined"!=typeof Prism||"undefined"!=typeof hljs){-1!=e.html().indexOf("<code")&&("undefined"!=typeof Prism?Prism.highlightAllUnder(e[0]):e.find("code").each((function(e,t){hljs.highlightBlock(t),this.style.display="inline-block"})))}}function delay_mp3_player_reset(){$("span.wrap_inline_mp3j, span.play-mjp").off("click"),MP3_JPLAYER.vars.play_f&&(mp3_jplayer_warning_f||(mp3_jplayer_warning_f=!0,alert('In order for MP3jPlayer to work with flashcards, the "Encode URLs" setting must be turned off.\nPlease go to WordPress Dashboard > MP3jPlayer > Settings > Advanced.\nUnder "Misc File Settings" unclick the checkbox and then click "Save All Changes"')));setTimeout((function(){debug[0]&&console.log("[delay_mp3_player_reset > MP3_JPLAYER.init ()]"),MP3_JPLAYER.init()}),1500)}function start_timers(e){if(debug[0]&&console.log("[start_timers] i_deck:",e),!q.preview){if(deckdata[e].card_time_limit&&!deckdata[e].card_timer_interval_id){$("span#got-it_unavailable-qdeck"+e).hide();const t=deckdata[e].card_time_limit,a=qqc.hhmmss_from_sec(t),d=$("#qdeck"+e+"-card_timer");deckdata[e].$card_timer=d,d.css({display:"inline-block"}).html(a),q.qwizard_b||(deckdata[e].card_timer_interval_id=setInterval(update_timer,1e3,e,!0),deckdata[e].times_up_msec=(new Date).getTime()+1e3*t+500)}if(deckdata[e].deck_timer&&!deckdata[e].deck_timer_interval_id){const t=$("#qdeck"+e+"-deck_timer");deckdata[e].$deck_timer=t,t.css({display:"inline-block"}).html("0:00"),q.qwizard_b||(deckdata[e].deck_timer_interval_id=setInterval(update_timer,1e3,e),deckdata[e].timer_start_msec=(new Date).getTime())}}}function stop_timer(e,t){t?deckdata[e].card_timer_interval_id&&(clearInterval(deckdata[e].card_timer_interval_id),deckdata[e].card_timer_interval_id=""):deckdata[e].deck_timer_interval_id&&(clearInterval(deckdata[e].deck_timer_interval_id),deckdata[e].deck_timer_interval_id="")}function update_timer(e,t){var a;if(t){(a=parseInt((deckdata[e].times_up_msec-(new Date).getTime())/1e3))<=0&&(times_up(e),a=0);const t=qqc.hhmmss_from_sec(a);deckdata[e].$card_timer.html(t)}else{a=parseInt(((new Date).getTime()-deckdata[e].timer_start_msec)/1e3);const t=qqc.hhmmss_from_sec(a);deckdata[e].$deck_timer.html(t)}
15}function times_up(e){stop_timer(e,!0),deckdata[e].times_up=!0}function hangman_focus(e,t){var a=q.get_card_front(e).find("span.qdeck_hangman.qdeck_hangman_c"+t+" input");debug[0]&&console.log("[hangman_focus] $hangman_input[0]:",a[0]),suppress_hangman_hint_b=!0,a.focus()}function add_editable_parts(e,t){for(var a=$("div.qcard_front-inputs").length;a<t;a++){let t=a+1;var d='<div id="qcard_front-input'+t+"-qdeck"+e+'" class="qcard_front-inputs qcard-inline"></div>';let r=a+2;var c='<div id="qcard_front-part'+r+"-qdeck"+e+'" class="qcard_front-parts qcard-part'+t+' qcard-inline qcard_editable" data-i_part="'+t+'"></div>';$("div.qcard-front div.qcard_content_size").append(d+c),qwizard.init_tinymce_onclick($("div#qcard_front-part"+r+"-qdeck"+e)[0])}q.n_textentry_hangman=t}function delete_unmatched_p(e){var t=e.indexOf("<p");return-1!=t&&-1==e.substr(t).indexOf("</p")&&(e=e.replace(/<p[^>]*>/,"")),-1==e.replace(/<[^>]+>/gm,"").search(/\S/)&&(e+="  "),e}function set_editable_parts_back(e,t,a,d){setTimeout((function(){debug[0]&&console.log("[set_editable_parts_back > delay_set] i_choice:",a),t=qqc.shortcodes_to_video_elements(t);var c=deckdata[e].$qcard_back_part1;if(void 0!==a){var r=t.indexOf('<div id="qcard_back-part1'),i=t.substr(0,r),n=t.substr(r).replace(/<div[^>]*>/,"").replace(/<\/div>$/,"");if($("#qcard_back-echo-qdeck"+e).html(i).show(),c.html(n).show(),d){var _="#qcard_back-part1-qdeck"+e;qwizard.init_remove_placeholder(_),qqc.select_placeholder($(_))}c.data("choice",a)}else if(-1!=t.indexOf("back_textentry_p")){var s=t.match(/([^]*?<p class="back_textentry_p[^]*?<\/p>)([^]*)/);$("#qcard_back-echo-qdeck"+e).html(s[1]).show(),c.html(s[2]).show(),c.removeData("choice")}else $("#qcard_back-echo-qdeck"+e).html("").hide(),c.html(t).show(),c.removeData("choice");qwizard.init_tinymce_onclick($("div#qcard_back-part1-qdeck"+e)[0])}),100)}function mobile_center_vertical(e){$qcard_card_front=q.get_card_front(e),$qcard_card_back=get_card_back(e),center_vertical($qcard_card_front),center_vertical($qcard_card_back)}function center_vertical(e,t){(document_qwiz_mobile?e.outerHeight()<e.parents("div.card-container").height():e.outerHeight()<t)?e.parent().css({top:"50%",transform:"translateY(-50%)","-webkit-transform":"translateY(-50%)"}):e.parent().css({top:"",transform:"","-webkit-transform":""})}$(document).ready((function(){(qqc=qwiz_qcards_common).qdebug(debug);var e=$.cookie("deck_preview");void 0!==e&&(q.preview_i_deck_plus1=parseInt(e,10)+1,document_qwiz_username=$.cookie("qwiz_preview_username"),$.removeCookie("deck_preview",{path:"/"}));var t=document.location.href;qwizcards_page_f=-1!=t.indexOf("qwizcards.com/u/")||-1!=t.indexOf("qwizcards.com/admin/")||-1!=t.indexOf("qwizcards.net/u/")||-1!=t.indexOf("qwizcards.net/admin/")||-1!=t.indexOf("localhost/u/")||-1!=t.indexOf("localhost/admin/")||-1!=t.indexOf("192.168.1.120/u/")||-1!=t.indexOf("192.168.1.120/admin/"),"undefined"==typeof document_qwizard_user_page&&-1==window.location.href.indexOf("action=edit")&&-1==window.location.href.indexOf("post-new")?q.qdeck_init():regular_page_f=!1})),this.qdeck_init=function(e,t){content=qqc.get_qwiz_param("content","body"),default_use_dict=qqc.get_qwiz_param("use_dict","true"),default_use_terms=qqc.get_qwiz_param("use_terms","true"),default_hangman_max_hints=parseInt(qqc.get_qwiz_param("hangman_hints",2)),hint_timeout_sec=qqc.get_qwiz_param("hint_timeout_sec",20),document_qwiz_mobile_enabled=qqc.get_qwiz_param("mobile_enabled","Always"),"Enabled"==document_qwiz_mobile_enabled&&(document_qwiz_mobile_enabled="Always"),Tcheck_answer_message=T('Need help? Try the "hint" button'),q.n_textentry_hangman=1,t||(qqc.set_force_mobile(),process_html(),errmsgs.length&&!e&&(q.qwizard_b||(qqc.get_qwiz_param("regular_page_error_check")?alert(plural(T("Error found"),T("Errors found"),errmsgs.length)+":\n\n"+errmsgs.join("\n")):console.log("Errors found:\n",errmsgs.join("\n")))),n_decks&&(q.$dialog_no_credit||($("body").append(dialog_no_credit_html()),q.$dialog_no_credit=$("#qwizcards_dialog_no_credit").dialog({height:400,width:550,modal:!0,autoOpen:!1,open:function(){$("div#qcard_request_assign_to_class_feedback").html(""),$("button#qcard_request_assign_to_class").removeClass("qwiz_button_disabled").prop("disabled",!1)},buttons:{Close:function(){q.$dialog_no_credit.dialog("close")}}})),q.qdeck_init2(n_decks)))},this.qdeck_init2=function(e,t,a){for(var d=0;d<e;d++){if(void 0===deckdata[d].cards)continue;const e=deckdata[d].mobile_enabled;("Always"==e||"Small screens only"==e&&qqc.is_mobile(e))&&$(".go-mobile-qdeck"+d).show(),init_element_pointers(d),q.init_card_order(d),deckdata[d].i_card=-1,deckdata[d].i_user_card=-1,deckdata[d].ii_card=0,deckdata[d].qrecord_id&&(deckdata[d].record_start_b=!0),set_header(d,"qcard-front",!0);var c=deckdata[d].$header.outerHeight();deckdata[d].qcard_window_margin=60+c,deckdata[d].header_height=c,deckdata[d].$qcard_window.css({"margin-bottom":deckdata[d].qcard_window_margin+"px"});var r=deckdata[d].use_dataset_card_html;if(r&&!a){var i=get_attr(r=qqc.replace_smart_quotes(r),"use_dataset_card"),n=i.indexOf("|"),_=i.substr(0,n);qqc.get_dataset_questions(_,qname,d,deckdata[d].qrecord_id,[],[],1e4,deckdata[d].dataset_questions_to_do,!1,r)}else if(t||deckdata[d].use_dataset||!q.no_intro_b[d]&&1!=deckdata[d].n_cards){if(deckdata[d].no_flip_b=deckdata[d].click_flip_b,q.qwizard_b)t||q.set_editable_parts_front(d,-1,deckdata[d].intro_html);else{var s=q.get_card_front(d,-1,!1,!0);s.html(qqc.decode_image_tags(deckdata[d].intro_html)),s.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this,!0)})),deckdata[d].first_display_f=!1;var o=deckdata[d].card_height_setting;center_vertical(s,o=o?o.replace("px",""):deckdata[d].$qcard_container.outerHeight())}if(!q.preview){if(!deckdata[d].hide_qwizcards_icon_b){var l=create_qwiz_icon_div(d);deckdata[d].$qcard_card.append(l)}q.qwiz_icon_stop_propagation(d)}if(q.set_container_width_height(d),deckdata[d].scroll_b||document_qwiz_mobile)deckdata[d].$qcard_card.find("div.qcard-front, div.qcard-back").css({overflow:"auto"})}else q.start_deck2(d);if(q.qwizard_b){debug[0]&&console.log("[qdeck_init2] $ ('div#qcard_front-part1-qdeck' + i_deck):",$("div#qcard_front-part1-qdeck"+d));const e=$("div#qcard_header-qdeck"+d);e.length&&qwizard.init_tinymce_onclick(e[0])}}if(document_qwiz_force_mobile_f&&q.go_mobile(0),q.preview_i_deck_plus1){const e=q.preview_i_deck_plus1-1;deckdata[e].use_dataset||init_preview(e)}else q.preview&&!q.qwizard_b&&init_preview(0);set_flip()},this.process_reg_code=function(e){if(debug[0]&&console.log("[process_reg_code] reg_code:",e),""!=e){var t={reg_code:e};
15qqc.jjax(qname,0,0,"reg_code_add_to_class",t)}},this.hide_reg_code_error=function(){$("div.qcard_reg_code_errmsg").html("").hide()},this.set_i_deck_i_card=function(){debug[0]&&console.log("[set_i_deck_i_card] this:",this);var e=this.className,t=e.match("preview-qdeck([0-9]+)")[1],a=e.match("preview-qcard([-0-9]+)")[1];deckdata[t].i_card=a},this.get_card_front=function(e,t,a,d){if(!d&&"back"==deckdata[e].showing_first)return get_card_back(e,t,a,!0);void 0===t&&(t=deckdata[e].i_user_card);var c=q.qwizard_b&&deckdata[e].use_dataset_card_ids[t];return a&&(c=!c),q.preview?$(c?"div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+t+" div.qcard-front div.qcard_content_size_alt":"div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+t+" div.qcard-front div.qcard_content_size"):c?deckdata[e].$qcard_card_front_alt:deckdata[e].$qcard_card_front},this.process_html2=function(e,t,a,d){var c=new RegExp("\\[qdeckdemo\\][\\s\\S]*?\\[\\/qdeckdemo\\]","gm");q.qdeckdemos=e.match(c),q.qdeckdemos&&(e=e.replace(c,"<qdeckdemo></qdeckdemo>"),debug[0]&&console.log("[process_html2] q.qdeckdemos.length: ",q.qdeckdemos.length));var r=0,i=check_qdeck_tag_pairs(e=(e=e.replace(/<!--[^]*?-->/gm,"")).replace(/\[!+\][^]*?\[\/!+\]/gm,""));if(i)e=i,"undefined"!=typeof qwizard&&(qwizard.errmsgs=errmsgs);else{var n=e.match(/\[qdeck[^]*?\[\/qdeck\]/gm);if(n){r=n.length;debug[0]&&(console.log("[process_html2] local_n_decks: ",r),console.log(" qdeck_matches[0]: ",n[0])),q.preview_i_deck_plus1&&(q.preview=!0);var _=!0,s=!1;q.decks_cards=[];for(var o=0;o<r;o++){if(q.preview_i_deck_plus1&&(q.preview_i_deck_plus1==t+1?(s=!0,_=!0):_=!1),_){var l=q.process_qdeck_pair(n[o],t,a,d,d);d&&(qwizard.questions_cards&&qwizard.questions_cards.length&&(qwizard.questions_cards[0].dataset_b=qwizard.questions_cards_dataset_b,q.decks_cards[t]=JSON.parse(JSON.stringify(qwizard.questions_cards))),debug[0]&&(console.log("[process_html2] i_deck:",t,", qwizard.questions_cards:",qwizard.questions_cards),qwizard.questions_cards&&(console.log("[process_html2] JSON.stringify (qwizard.questions_cards):",JSON.stringify(qwizard.questions_cards)),console.log("[process_html2] qwizard.questions_cards.length:",qwizard.questions_cards.length)))),e=e.replace(/(<[ph][^>]*>\s*)*?\[qdeck[^]*?\[\/qdeck\]/m,l)}else deckdata[t]={};t++}if(debug[0]&&q.decks_cards.length)for(var k=q.decks_cards.length,h=0;h<k;h++)console.log("[process_html2] q.decks_cards["+h+"]:",q.decks_cards[h]);debug[3]&&console.log("[process_html2] htm:",e)}}return{htm:e,i_deck:t,replace_body:s}},this.reset_preview=function(e){$.cookie("deck_preview",e,{path:"/"}),window.location=window.location.href},this.init_textentry_autocomplete=function(e,t){debug[0]&&console.log("[init_textentry_autocomplete] i_card:",t);var a=deckdata[e].cards[t],d=a.textentry_minlength;a.all_choices[0].length<d&&(d=a.all_choices[0].length);var c=q.get_card_front(e);if(a.single_char_b)c.find("input.qcard_single_char_entry").keyup(single_char_textentry_keyup);else{var r=c.find("input.textentry-qdeck"+e);r.autocomplete({minLength:d,source:find_matching_terms,close:menu_closed,open:menu_shown,select:q.item_selected}),r.keyup(menu_closed)}const i=deckdata[e].showing_first;if(a.single_char_b)"front"==i&&($(button_flip_selector(e)).addClass("qwiz_button_disabled").attr("disabled",!0),deckdata[e].check_answer_disabled_b=!0),a.check_answer="Check answer";else{if(deckdata[e].terms)deckdata[e].textentry_terms_metaphones||(deckdata[e].textentry_terms_metaphones=qqc.process_textentry_terms(deckdata[e].terms));else if(!default_textentry_terms_metaphones){var n=qqc.get_qwiz_param("url","./"),_="";"body"==content&&"./"==n?"undefined"!=typeof document_qwiz_terms&&(_=document_qwiz_terms):_=qqc.get_textentry_terms(n+"terms.txt",deckdata),default_textentry_terms_metaphones=qqc.process_textentry_terms(_)}var s;if(deckdata[e].add_terms&&(deckdata[e].add_textentry_terms_metaphones||(deckdata[e].add_textentry_terms_metaphones=qqc.process_textentry_terms(deckdata[e].add_terms))),a.use_terms_b)s=a.textentry_plural_b?"plural":"singular",deckdata[e].terms?current_card_textentry_terms_metaphones[e]=deckdata[e].textentry_terms_metaphones[s]:current_card_textentry_terms_metaphones[e]=default_textentry_terms_metaphones[s],deckdata[e].add_terms&&(current_card_textentry_terms_metaphones[e]=current_card_textentry_terms_metaphones[e].concat(deckdata[e].add_textentry_terms_metaphones[s]));else current_card_textentry_terms_metaphones[e]=[];textentry_answers[e]=a.all_choices,textentry_answer_metaphones[e]=textentry_answers[e].map((function(e){return e=e.replace(/\s*(\S+)\s.*/,"$1"),qqc.metaphone(e)}));var o,l,k=textentry_answers[e].map((function(e){return[e,qqc.metaphone(e)]}));if(debug[6]&&console.log("[init_textentry_autocomplete] textentry_answers_metaphones: ",k),current_card_textentry_terms_metaphones[e]=current_card_textentry_terms_metaphones[e].concat(k),current_card_textentry_terms_metaphones[e]=qqc.sort_dedupe_terms_metaphones(current_card_textentry_terms_metaphones[e]),debug[6]){console.log("[init_textentry_autocomplete] current_card_textentry_terms_metaphones[i_deck].length: ",current_card_textentry_terms_metaphones[e].length),console.log("[init_textentry_autocomplete] current_card_textentry_terms_metaphones[i_deck].slice (0, 10): ",current_card_textentry_terms_metaphones[e].slice(0,10));var h=current_card_textentry_terms_metaphones[e].length-10;h>0&&console.log("[init_textentry_autocomplete] current_card_textentry_terms_metaphones[i_deck].slice ("+h+"): ",current_card_textentry_terms_metaphones[e].slice(h))}if(!deckdata[e].bck_f)if(t==deckdata[e].i_card&&!deckdata[e].card_reviewed_b)if(!a.saved_textentry_ok)d<=1?(o=T("Type a letter/number"),l=T("Type a letter")):(d=Math.max(d,3),o=(o=T("Type %s+ letters/numbers")).replace("%s",d),l=(l=T("Type %s+ letters")).replace("%s",d)),r.attr("placeholder",o),"front"==i&&$(button_flip_selector(e)).html(l),a.save_check_answer=l,a.check_answer=l,a.textentry_minlength=d,"front"==i&&($(button_flip_selector(e)).addClass("qwiz_button_disabled").prop("title",Tcheck_answer_message),deckdata[e].check_answer_disabled_b=!0);deckdata[e].textentry_n_hints=0,0!=deckdata[e].n_reviewed||!q.no_intro_b[e]&&1!=deckdata[e].n_cards?q.start_hint_timeout(e):deckdata[e].$qcard_window.attr("onmouseenter",qname+".start_hint_timeout ("+e+")")}deckdata[e].click_flip_b&&$("#textentry_hint-qdeck"+e).click((function(e){e.stopPropagation(),debug[0]&&console.log("[init_textentry_autocomplete] click event:",e)}))},this.start_hint_timeout=function(e){debug[0]&&console.log("[start_hint_timeout] i_deck:",e),deckdata[e].$qcard_window.removeAttr("onmouseenter");$("#textentry_hint-qdeck"+e).html("Hint").hide(),hint_timeout_sec>=0&&(show_hint_timeout[e]=setTimeout((function(){$("#textentry_hint-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled").show()}),1e3*hint_timeout_sec))},this.process_qdeck_pair=function(e,t,a,d,c){debug[0]&&(console.log("[process_qdeck_pair] htm:",e),console.log("[process_qdeck_pair] i_deck:",t)),q.qwizard_b=a,"undefined"!=typeof qwizard&&(qw=qwizard),d&&(n_decks=1,set_qwizard_data_b=!0,q.no_intro_b=[]),deckdata.push({}),deckdata[t].cards=[],deckdata[t].first_display_f=!0,deckdata[t].answered_correctly={},deckdata[t].showing_front_b=!0,deckdata[t].i_card=0,deckdata[t].n_reviewed=0,deckdata[t].n_got_it=0,deckdata[t].exit_html="",deckdata[t].align="",deckdata[t].hangman={},deckdata[t].use_dataset="",deckdata[t].dataset_id={},deckdata[t].use_dataset_card_ids={},deckdata[t].qrecord_id="",deckdata[t].unit=[],deckdata[t].level=[],deckdata[t].default_card_back_background="",deckdata[t].card_back_background=[],deckdata[t].click_flip_b=!0;var r=(C=e.match(/(<[^\/][^>]*>\s*)*?\[qdeck([^\]]*)\]/m))[0],i=C[2];r=qqc.replace_smart_quotes(r),i=qqc.replace_smart_quotes(i),debug[0]&&(console.log("[process_qdeck_pair] qdeck_tag: ",r),console.log("[process_qdeck_pair] attributes: ",i)),set_qwizard_data_b&&qw.set_qwizard_data("qwiz_deck_attributes",i);var n=!1;deckdata[t].summary_b="false"!=get_attr(r,"summary");var _=get_attr(r,"use_dataset");if(!_){const e=get_attr(r,"dataset");e&&(regular_page_f?_=e:deckdata[t].dataset=e)}if(_){deckdata[t].use_dataset=_;var s=get_attr(r,"dataset_intro");
15s&&"true"!=s?"false"==s&&(s=!1):s=!0,deckdata[t].dataset_intro_f=s;var o="false"!=get_attr(r,"spaced_repetition");deckdata[t].dataset_questions_to_do=o?"spaced_repetition":"all";const e="true"==get_attr(r,"random");if(deckdata[t].random_b=e,q.qwizard_b&&(deckdata[t].attr_random_b=e),C=r.match(/\sstyle\s*=\s*"[^"]+"/gm))for(var l=C.length,k=0;k<l;k++){var h=encodeURIComponent(C[k]);r=r.replace(C[k],h)}var u=get_attr(r,"display_name");if(u){deckdata[t].use_dataset_options_display_name=decodeURIComponent(u);r=r.replace(/\sdisplay_name\s*=\s*"[^"]*?"/,"")}r=decodeURIComponent(r)}const p=get_attr(r,"reshow_after");p&&(deckdata[t].reshow_after=p);var m=get_attr(r,"show_first");m||(m="front"),deckdata[t].show_first=m;const g=parseInt(get_attr(r,"cards_to_show"));qqc.isInteger(g)&&g>0&&(deckdata[t].cards_to_show=g);var b=get_attr(i,"align");"center"!=b&&"right"!=b&&"tiled"!=b||(deckdata[t].align=b,"tiled"==b&&(deckdata[t].spacing=20));var f=parseInt(get_attr(i,"spacing"));qqc.isInteger(f)&&(deckdata[t].spacing=f),deckdata[t].q_and_a_text={};var v=get_attr(i,"qrecord_id");if(v&&(deckdata[t].qrecord_id=v,q.qrecord_b||(q.qrecord_b=!0,"undefined"!=typeof document_qwiz_user_logged_in_b&&"not ready"!=document_qwiz_user_logged_in_b||qqc.check_session_id(t))),q.qwizard_b||set_qwizard_data_b){const e=!!get_attr(i,"dataset");q.dataset_b=e,set_qwizard_data_b&&(qw.questions_cards_dataset_b=e)}const w=get_attr(i,"card_time_limit");w&&(deckdata[t].card_time_limit=parseInt(w));const y="true"==get_attr(i,"deck_timer");y&&(deckdata[t].deck_timer=y);var x=get_attr(i,"unit");if(x?(deckdata[t].default_unit=x,set_qwizard_data_b&&qw.set_qwizard_data("default_unit",x)):deckdata[t].default_unit="null",q.qwizard_b)deckdata[t].click_flip_b=!1;else{const e=get_attr(i,"click_flip");e&&(deckdata[t].click_flip_b=!("false"==e))}deckdata[t].font_weight_normal="false"==get_attr(i,"bold_text");var z=get_attr(i,"card_back");z?deckdata[t].default_card_back_background=z:(z=get_attr(i,"card_back_image"),deckdata[t].default_card_back_background=z?"img:"+z:""),deckdata[t].scroll_b="true"==get_attr(i,"scroll"),deckdata[t].hide_forward_back_b="true"==get_attr(i,"hide_forward_back"),deckdata[t].hide_progress_b="true"==get_attr(i,"hide_progress"),deckdata[t].hide_qwizcards_icon_b="true"==get_attr(i,"hide_qwizcards_icon");var A=get_attr(i,"mobile_enabled");A||(A=document_qwiz_mobile_enabled),deckdata[t].mobile_enabled=A,deckdata[t].hide_flip_b="true"==get_attr(i,"hide_flip"),deckdata[t].hide_gotit_b="true"==get_attr(i,"hide_gotit"),deckdata[t].gotit_active="true"==get_attr(i,"gotit_active"),deckdata[t].hide_shuffle_b="true"==get_attr(i,"hide_shuffle");var $=get_attr(i,"flip_direction");$=""==$||"random"==$?"":"up_down"==$?"x":"y",deckdata[t].flip_axis=$;var C,I="",O=!1;(C=e.match(/\[qdeck[^\]]*\]((<\/[^>]+>\s*)*)/m,""))&&(I+=C[1]);e=(e=e.replace(/\[qdeck[^\]]*\]((<\/[^>]+>\s*)*)/m,"")).replace(/(<(p|h[1-6]|span)[^>]*>)*\[\/qdeck\]$/,""),e=qqc.trim(e);var D=qqc.check_pairs("[no_click_flip]","[/no_click_flip]",e);D&&("ok"==D?e=(e=e.replace(/\[no_click_flip\]/g,'<div class="qwiz_no_click_flip">')).replace(/\[\/no_click_flip\]/g,"</div>"):errmsgs.push(D+". qdeck: "+(t+1)));var P=-1;_||-1!=e.search(/\[q([^\]]*)\]/m)||(errmsgs.push(T('Did not find question tags ("[q]")')+". qdeck: "+(t+1)),P=0),e=qqc.process_inline_textentry_terms(e,"terms",deckdata,t),errmsgs=errmsgs.concat(deckdata.additional_errmsgs),e=qqc.process_inline_textentry_terms(e,"add_terms",deckdata,t),errmsgs=errmsgs.concat(deckdata.additional_errmsgs);var Q=qqc.parse_html_block(e.substr(0,2e3),["^"],["[h]","[i]","[q]","[q "],"return whitespace");Q&&(e=e.replace(Q,"")),e=process_header(e,t,!0),set_qwizard_data_b&&deckdata[t].header_html&&qw.set_qwizard_data("header_text",deckdata[t].header_html);var E=qqc.parse_html_block(e.substr(0,2e3),["[i]"],["[q]","[q ","[x]"],!0);if("NA"==E)""==(E=qqc.parse_html_block(e.substr(0,2e3),["^"],["[q]","[q ","[x]"],!0))&&(_?E="<br /><br /><br />":O=!0);else{var j=e.substr(0,200);j=qqc.trim(j);var S=qqc.opening_tag_shortcode_pos("[i]",j);j=j.substr(S,5);var R=E.replace(/<br[^>]*>/g,"");j!=(R=qqc.trim(R).substr(0,5))&&errmsgs.push(T("Text before intro")+' ("[i]"). qdeck: '+(t+1)),E=E.replace(/\[i\]/,"")}var H="";if(""!=E){H=E=qqc.balance_closing_tag(E);var B='<button id="start_button-qdeck'+t+'" class="qwiz_button" onclick="'+qname+".start_deck ("+t+')">'+T("Start reviewing cards")+"</button>";-1!=E.indexOf("[start]")?E=E.replace("[start]",B):(E+=B,H+="[start]")}set_qwizard_data_b&&(H=qqc.remove_empty_opening_tags(H),qw.set_qwizard_data("intro_text",H)),deckdata[t].intro_html=E;var F=e;if(0!=P){S=qqc.opening_tag_shortcode_pos("([q |[q])",e);F=e.substr(S)}var W='<button class="summary_exit_mobile_deck qwiz_button" onclick="'+qname+".exit_mobile ("+t+')">\nReturn to page view</button>\n',L=qqc.parse_html_block(e,["[x]"],[]);if("NA"!=L?(L=L.replace(/\[x\]/,""),L=qqc.balance_closing_tag(L)):L="",set_qwizard_data_b&&qw.set_qwizard_data("exit_text",qqc.remove_empty_opening_tags(L)),L&&-1!=L.indexOf("[unpaid")&&-1!=L.indexOf("[/unpaid]")?L=(L=L.replace("[unpaid]",'<span class="unpaid_msg">')).replace("[/unpaid]","</span>"):deckdata[t].pay_quiz_deck_id&&(L+='<span class="unpaid_msg_payment_type unpaid_msg"></span>'),deckdata[t].use_dataset&&-1==L.indexOf("[restart")&&(L+="<br />[restart]"),L){var Y;Y=deckdata[t].use_dataset&&deckdata[t].dataset_intro_f?T("Practice more flashcards"):T("Review this flashcard stack again");var G=L.match(/\[restart[^\]]*\]/);if(G){var N=get_attr(qqc.replace_smart_quotes(G[0]),"label");N&&(Y=N)}var M=' <button class="qwiz_button qwiz_restart" onclick="'+qname+".start_deck ("+t+', true)">\n'+Y+"\n </button>\n";L=L.replace(G,M),L+="<br />"+W;var V=qqc.opening_tag_shortcode_pos("[x]",F);F=F.substr(0,V)}else L=W;if(deckdata[t].exit_html=L,_||-1!=e.search(/use_dataset_card\s*=\s
15*/)&&(n=!0,deckdata[t].use_dataset_card_html=F),!P||_||n&&!c?(c&&(qwizard.questions_cards_dataset_b=!1),debug[0]&&console.log("[process_qdeck_pair] (not calling process_cards ()) qwizard_process_dataset_questions_f:",c)):P=q.process_cards(F,t),q.no_intro_b[t]=O,!_&&!n){deckdata[t].n_cards=P,set_qwizard_data_b&&qw.set_qwizard_data("n_questions",P);const e=deckdata[t].cards_to_show;e&&e<P?(deckdata[t].n_to_go=e,deckdata[t].n_cards_for_done=e,deckdata[t].random_b=!0):(deckdata[t].n_to_go=P,deckdata[t].n_cards_for_done=P)}return I=create_qdeck_divs(t,r),debug[3]&&console.log(" new_html: ",I),"undefined"!=typeof qwizard&&"undefined"!=typeof qwizard&&(qwizard.errmsgs=errmsgs),set_qwizard_data_b=!1,I},this.process_cards=function(e,t,a,d,c){debug[0]&&console.log("[process_cards] card_html:",e,", i_qwizard_card:",a),d&&(qw=qwizard,n_decks=1,set_qwizard_data_b=!0,q.qwizard_b=!0),number_first_card=void 0!==a?a:0,set_qwizard_data_b||-1!=e.indexOf("[!")&&(e=e.replace(/\[!+\][^]*?\[\/!+\]/gm,""));var r=e.match(/\[(q\]|q\s+[^\]]*\])/gm);if(debug[4]&&console.log("[process_cards] card_tags[0]: ",r[0]),r.length){q.process_card_attributes(t,r,number_first_card);const e=Object.values(deckdata[t].dataset_id);if(e.length>1){e.sort();const a=e.length;for(var i=!1,n=1;n<a;n++)e[n]==e[n-1]&&(errmsgs.push(T("Duplicate")+" dataset_id: "+e[n]+". qdeck: "+(t+1)),i=!0);i&&errmsgs.push(T('Please delete the duplicate dataset_id="..." attribute(s); new IDs will be created'))}}for(var _=[],s=["[q]","[q "],o=e;;){var l=qqc.parse_html_block(o,s,s);if("NA"==l)break;o=o.substr(l.length),l=(l=l.replace(/\[q[^\]]*\]/,"")).replace(/^\s*(<\/[^>]+>)+/,""),_.push(l)}debug[0]&&console.log("[process_cards] cards_html: ",_);var k=_.length;debug[0]&&console.log("[process_cards] n_cards: ",k);for(var h=0;h<k;h++){var u,p=h+number_first_card;u=-1!=_[h].search(/\[hangman|qdeck_hangman|hangman_img_wrapper/m)?process_hangman(t,p,_[h]):-1!=_[h].search(/\[c\]|\[c\*\]/m)?process_textentry(t,p,_[h]):process_card_input(t,p,_[h]),deckdata[t].cards[p]=u}return k},this.qwiz_icon_stop_propagation=function(e){$("#icon_qdeck"+e).click((function(e){e.stopPropagation()}))},this.hangman_show=function(e,t){if(suppress_hangman_hint_b)return suppress_hangman_hint_b=!1,!1;var a=$(e);if(a.find("span.hangman_type_letters").hide(),clearTimeout(e.i_hint_timeout),t){e.i_hint_timeout=setTimeout((function(){a.find("button.hangman_hint, span.hangman_status").fadeOut(1e3)}),2e3)}if(!e.done_f){a.find("button.hangman_hint").show();var d=a.find("span.hangman_status");d.html()&&d.show()}},this.hangman_hide=function(e){var t=$(e);e.i_hint_timeout=setTimeout((function(){t.find("button.hangman_hint, span.hangman_status").fadeOut(500)}),500)},this.hangman_keyup=function(e,t,a,d,c,r){t.keyCode;var i=e.value;e.value=a,debug[9]&&console.log("[hangman_keyup] value.charCodeAt:",i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3));var n=i.replace(/[^a-z0-9]/gi,"");if(""==n)return!1;n=n.toLowerCase(),debug[9]&&console.log("[hangman_keyup] keychars:",n);for(var _,s=deckdata[d].hangman[c].hangman_current_entry[r],o=deckdata[d].hangman[c].hangman_final_entry[r],l=n.length,q=0;q<l;q++){if(_=update_hangman_input(n[q],s,o,d,c,r,e))break}if(!_&&deckdata[d].hangman[c].hangman_incorrect_chars[r]){var k=qqc.create_hangman_incorrect_chars_display(deckdata[d].hangman[c].hangman_incorrect_chars[r],3);$(e).siblings("span.hangman_status").html(k).show()}return!0},this.hangman_hint=function(e,t,a){if(deckdata[e].hangman[t].hangman_n_hints[a]++,deckdata[e].hangman[t].hangman_n_hints[a]>deckdata[e].hangman[t].hangman_max_hints)return!1;deckdata[e].hangman[t].hangman_n_hints[a]==deckdata[e].hangman[t].hangman_max_hints&&$("#hangman_hint-qdeck"+e+"-c"+a).prop("disabled",!0).addClass("qwiz_button_disabled");deckdata[e].hangman[t].hangman_answer[a];var d=deckdata[e].hangman[t].hangman_current_entry[a],c=d.match(/<u>.<\/u>/g),r=c.indexOf("<u>\t</u>");if(debug[9]&&(console.log("[hangman_hint] matches:",c),console.log("[hangman_hint] i_pos:",r)),-1!=r){var i=deckdata[e].hangman[t].hangman_final_entry[a],n=(c=i.match(/<u>.<\/u>/g))[r][3],_=q.get_card_front(e).find("span.qdeck_hangman.qdeck_hangman_c"+a+" input");update_hangman_input(n,d,i,e,t,a,_[0],!0),_.focus()}},this.textentry_hint=function(e){clearTimeout(show_hint_timeout[e]),show_hint_timeout[e]=0,deckdata[e].textentry_n_hints++;var t=deckdata[e].i_card,a=deckdata[e].cards[t].all_choices[0].substr(0,deckdata[e].textentry_n_hints),d=$("input.textentry-qdeck"+e);d.val(a).focus(),d.autocomplete("search"),$("#textentry_hint-qdeck"+e).attr("disabled",!0).addClass("qwiz_button_disabled").html("Another<br />hint");hint_timeout_sec>=0&&(show_hint_timeout[e]=setTimeout((function(){$("#textentry_hint-qdeck"+e).removeAttr("disabled").removeClass("qwiz_button_disabled")}),1e3*hint_timeout_sec))},this.set_textentry_i_deck=function(e){var t=e.className;textentry_i_deck=t.match(/textentry-qdeck([0-9]+)/)[1],debug[6]&&console.log("[set_textentry_i_deck] textentry_i_deck: ",textentry_i_deck)},this.flip_if_back=function(e){return $("div.card-container").click((function(e){e.preventDefault(),console.log("[flip_if_back] > preventDefault")})),showing_front(e)||q.qdeck_flip(e),!1},this.process_card_attributes=function(e,t,a){var d=t.length;deckdata[e].card_topics||(deckdata[e].card_topics=new Array(d)),deckdata[e].units||(deckdata[e].units=[]),deckdata[e].topics||(deckdata[e].topics=[]),deckdata[e].levels||(deckdata[e].levels=[]);for(var c=!1,r=0;r<d;r++){var i=r+a;set_qwizard_data_b&&(qw.questions_cards[i]={});var n=t[r];deckdata[e].dataset_id[i]=i,deckdata[e].unit[i]=deckdata[e].default_unit;var _=n.match(/\[q +([^\]]*)\]/);if(_){var s=_[1];if(s=qqc.replace_smart_quotes(s),set_qwizard_data_b&&(qw.questions_cards[i].question_attributes=s),b=get_attr(s,"topic",!0)){debug[4]&&console.log("[process_card_attributes] card_topics: ",b),set_qwizard_data_b&&(qw.questions_cards[i].topic=b),b=b.split(/; */),deckdata[e].card_topics[i]=b;for(var o=0;o<b.length;o++){var l=b[o];-1==deckdata[e].topics.indexOf(l)&&deckdata[e].topics.push(l)}}else deckdata[e].card_topics[i]=["Other"],c=!0;if(deckdata[e].use_dataset||deckdata[e].dataset||deckdata[e].use_dataset_card_ids[i]){const t=get_attr(s,"dataset_id");t&&(deckdata[e].dataset_id[i]=t)}var k=get_attr(s,"unit");k&&(deckdata[e].unit[i]=k,set_qwizard_data_b&&(qw.questions_cards[i].unit=k,-1==deckdata[e].units.indexOf(k)&&deckdata[e].units.push(k)));var h=get_attr(s,"level");h&&(deckdata[e].level[i]=h,set_qwizard_data_b&&(qw.questions_cards[i].level=h),-1==deckdata[e].levels.indexOf(h)&&deckdata[e].levels.push(h));var u=get_attr(s,"card_back");u?deckdata[e].card_back_background[i]=u:(u=get_attr(s,"card_back_image"))&&(deckdata[e].card_back_background[i]="img:"+u),u&&(deckdata[e].default_card_back_background||(deckdata[e].default_card_back_background=q.ruled_lines));var p=get_attr(s,"use_dataset_card");p&&(deckdata[e].use_dataset_card_ids[i]=p,deckdata[e].dataset_id[i]=p,set_qwizard_data_b&&(qw.questions_cards[i].from_dataset_b=!0))}}c&&-1==deckdata[e].topics.indexOf("Other")&&deckdata[e].topics.push("Other"),debug[4]&&console.log("[process_card_attributes] deckdata[i_deck].c
15ard_topics:",deckdata[e].card_topics),set_qwizard_data_b&&(qw.unit_names=deckdata[e].units,qw.topic_names=deckdata[e].topics,qw.level_names=deckdata[e].levels),deckdata[e].topic_statistics={};for(var m=deckdata[e].topics.length,g=0;g<m;g++){l=deckdata[e].topics[g];deckdata[e].topic_statistics[l]={},deckdata[e].topic_statistics[l].n_cards=0,deckdata[e].topic_statistics[l].n_reviewed=0}for(i=0;i<d;i++){var b;if(b=deckdata[e].card_topics[i]){debug[4]&&console.log("[process_card_attributes] i_card:",i,", card_topics: "+b);for(m=b.length,g=0;g<m;g++){l=b[g];deckdata[e].topic_statistics[l].n_cards++}}}},this.start_deck=function(e,t){if(debug[0]&&console.log("[start_deck] deckdata[i_deck].i_card:",deckdata[e].i_card),0!=deckdata[e].n_cards){if(qqc.is_mobile(deckdata[e].mobile_enabled)&&q.go_mobile(e),t&&(deckdata[e].deck_started_b=!0),!t&&!q.qwizard_b&&deckdata[e].qrecord_id){var a="undefined"!=typeof document_qwiz_user_logged_in_b&&document_qwiz_user_logged_in_b&&"undefined"!=typeof document_qwiz_username;if(!(a||"undefined"!=typeof document_qwiz_declined_login_b&&document_qwiz_declined_login_b))return q.display_login(e),!1;if(a&&!document_qwiz_wp_user_session_id){if($.cookie("qwiz_current_login_lt_nmin_ago")){if(document_qwiz_team_b&&!confirm(T("You are logged in as team")+": "+document_qwiz_username+".\n"+T("Do you want to continue as this team?"))){document_qwiz_session_id=document_qwiz_session_id.split(";")[0],document_qwiz_username=document_qwiz_username.split("; ")[0],document_qwiz_team_b=!1,qqc.set_user_menus_and_icons(qname);var d=T("OK. Only %s is logged in now");d=d.replace("%s",document_qwiz_username),alert(d)}}else{var c="";if(document_qwiz_team_b&&(c=" "+T("a team")+":"),!confirm(T("You are logged in as")+c+" "+document_qwiz_username+".\n"+T('Do you want to continue? (Click "Cancel" to sign out)')))return qqc.sign_out(),deckdata[e].deck_started_b=!0,q.process_card(e),!1;var r={path:"/",expires:qqc.get_qwiz_param("login_timeout_min",40)/1440};$.cookie("qwiz_current_login_lt_nmin_ago",1,r)}if(deckdata[e].qrecord_id&&document_qwiz_user_logged_in_b){deckdata[e].record_start_b=!1;var i={type:"start",now_sec:(new Date).getTime()/1e3,confirm:"js"};record_qcard(e,deckdata[e].qrecord_id,i,!0)}}}if(deckdata[e].use_dataset)if(deckdata[e].dataset_intro_f)deckdata[e].i_card=-1,q.display_login(e,!1,"use_dataset_options");else{deckdata[e].i_card=0;var[n,_,s]=qqc.parse_use_dataset(deckdata[e].use_dataset);qqc.get_dataset_questions(n,qname,e,deckdata[e].qrecord_id,_,s,1e4,deckdata[e].dataset_questions_to_do,!1,deckdata[e].use_dataset_card_html)}else q.start_deck2(e)}},this.start_deck2=function(e,t,a){deckdata[e].i_card=void 0!==t?t:0,deckdata[e].n_got_it=0,deckdata[e].n_reviewed=0;var d=deckdata[e].n_cards;const c=deckdata[e].cards_to_show;if(c&&c<d?(deckdata[e].n_to_go=c,deckdata[e].n_cards_for_done=c,deckdata[e].random_b=!0):(deckdata[e].n_to_go=d,deckdata[e].n_cards_for_done=d),a&&qqc.is_mobile(deckdata[e].mobile_enabled)&&q.go_mobile(e),q.preview&&deckdata[e].use_dataset){const t=deckdata[e].attributes;for(var r=[],i=0;i<d;i++)r=r.concat(card_container_divs(e,t,i));return $("div.preview-dataset-placeholder").replaceWith(r.join("\n")),init_preview(e),void set_flip()}var n=0;d>1||!deckdata[e].click_flip_b||deckdata[e].cards[0].textentry_required_b||deckdata[e].combo?q.set_next_buttons(e):n=deckdata[e].header_height+20,(n||deckdata[e].spacing)&&(n?deckdata[e].spacing&&(n+=deckdata[e].spacing-20):n+=deckdata[e].spacing,deckdata[e].$qcard_window.css({"margin-bottom":n+"px"}));for(var _=0;_<d;_++)deckdata[e].cards[_].got_it=!1;deckdata[e].bck_f=!1,deckdata[e].user_card_number=0;for(_=0;_<d;_++){var s=deckdata[e].cards[_];s.user_card_number=void 0,s.i_user_next_card=void 0,s.i_user_prev_card=void 0,s.saved_textentry="",s.saved_textentry_ok=!1}deckdata[e].reshow_after&&(deckdata[e].i_cards_done=[]),deckdata[e].hide_forward_back_b||($(".bbfe-qdeck"+e).css({visibility:"visible",opacity:.2}).removeClass("hover"),$("span.card-number-qdeck"+e).css({visibility:"visible"}).html(1)),deckdata[e].use_dataset&&deckdata[e].dataset_intro_f&&$(".bck-card-qdeck"+e).first().css({opacity:.5}
15).addClass("hover"),deckdata[e].deck_timer&&(q.no_intro_b[e]||start_timers(e),deckdata[e].$deck_timer&&deckdata[e].$deck_timer.html("0:00"));for(var o=deckdata[e].topics.length,l=0;l<o;l++){var k=deckdata[e].topics[l];deckdata[e].topic_statistics[k].n_reviewed=0}q.init_card_order(e),deckdata[e].deck_started_b=!0,void 0!==t&&deckdata[e].i_card>=0&&deckdata[e].i_card<d&&(deckdata[e].no_flip_b=!1),deckdata[e].$qcard_card_back.css({display:""}),showing_front(e)||q.qdeck_flip(e),q.process_card(e,!1,!0)},this.show_response_recorded=function(e){if(!q.preview){var t=deckdata[e].i_card,a=deckdata[e].cards,d=a[t],c=DateFormat.format.date((new Date).getTime(),"h:mm:ss");const _=$(`span.response_recorded-qdeck${e} img.response_recording`);var r,i=d.i_user_prev_card;if(void 0!==a[i]){var n=a[i].user_card_number;r=T("Response to card")+" "+n+" "+T("recorded")+" "+c}else r=T("Response recorded")+" "+c;_.removeClass("response_recording_spin").attr("title",r)}},this.pay_lock_settings=function(e,t,a,d){qqc.pay_lock_settings(qname,deckdata,n_decks,t,a,d,e)},this.go_mobile=function(e){non_mobile_scrollLeft=window.scrollX,non_mobile_scrollTop=window.scrollY;var t=deckdata[e].$qcard_window;if(deckdata[e].deck_style=t.attr("style"),t.removeAttr("style").removeAttr("width").removeClass("qcard_window").addClass("qdeck-mobile qwizard_qwiz_deck_div"),parent!==window||deckdata[e].$next_buttons.find("button").removeClass("qwiz_button").addClass("qwiz_button_small"),t.after('<div id="deck_div_placeholder"></div>'),t.appendTo("body"),window.scrollTo(0,0),deckdata[e].$qcard_window.css({width:"","min-height":""}),$("body").css({overflow:"hidden"}),qqc.is_mobile(deckdata[e].mobile_enabled)||!document_qwiz_force_mobile_f){if($(".go-mobile-qdeck"+e).hide(),!document_qwiz_force_mobile_f){$(".exit-mobile-qdeck"+e).show(),$("#icon-exit-mobile-qdeck"+e).show(),$("#summary-deck"+e).find("button.summary_exit_mobile_deck").show();var a=navigator.userAgent.toLowerCase();-1!=a.indexOf("firefox")&&-1!=a.indexOf("mobile")&&$("div.qdeck-mobile").css({"padding-bottom":"10vh"});deckdata[e].$qcard_card.css({transform:"","margin-bottom":deckdata[e].qcard_window_margin}+"px");deckdata[e].$qcard_window.find("div.qcard_progress, div.qcard_header").css({transform:""})}document_qwiz_mobile="mobile_",mobile_i_deck=e}},this.open_panel_exit_mobile=function(e){$("#overlay-exit-mobile-qdeck"+e).show().animate({top:"0px"},500),panel_exit_mobile_open_b=!0,$("#icon-exit-mobile-qdeck"+e).hide()},this.close_panel_exit_mobile=function(e){return $(e).animate({top:"-100px"},500,(function(){$(this).hide(),$("div.icon-exit-mobile-qwiz").show()})),panel_exit_mobile_open_b=!1,panel_exit_mobile_just_closed_b=!0,!1},this.exit_mobile=function(e){var t=deckdata[e].$qcard_window;t.attr("style",deckdata[e].deck_style).removeClass("qdeck-mobile qwizard_qwiz_deck_div").addClass("qcard_window"),deckdata[e].$next_buttons.find("button").removeClass("qwiz_button_small").addClass("qwiz_button"),$("#deck_div_placeholder").replaceWith(t),$("body").css({overflow:""}),window.scrollTo(non_mobile_scrollLeft,non_mobile_scrollTop),deckdata[e].$qcard_window.css({width:deckdata[e].card_width_setting,"min-height":deckdata[e].card_height_setting}),$("#overlay-exit-mobile-qdeck"+e).css({top:"-100px",display:"none"}),$(window).off("scroll"),$("div.icon-exit-mobile-qwiz, div.icon-panel-exit-mobile-qwiz").hide(),$(".exit-mobile-qdeck").hide(),$("button.summary_exit_mobile_deck").hide();const a=deckdata[e].mobile_enabled;("Always"==a||"Small screens only"==a&&qqc.is_mobile(a))&&$(".go-mobile-qdeck"+e).show(),document_qwiz_mobile="",panel_exit_mobile_just_closed_b=!1,q.set_container_width_height(e)},this.init_card_order=function(e){var t=deckdata[e].n_cards;deckdata[e].card_order=new Array(t);for(var a=0;a<t;a++)deckdata[e].card_order[a]=a;deckdata[e].random_b&&(deckdata[e].card_order=qqc.shuffle(deckdata[e].card_order),debug[0]&&console.log("[init_card_order] deckdata[i_deck].card_order:",deckdata[e].card_order))},this.set_next_buttons=function(e){var t="",a="",d="qwiz_button ";qqc.is_mobile(deckdata[e].mobile_enabled)&&(parent!==window||(d="qwiz_button_small "));var c=d,r="Check answer";if(deckdata[e].hide_flip_b&&(q.qwizard_b?(c="qwizard_gray ",r="Flip (click disabled)"):a='style="display: none;" '),t+='<button class="'+c+"flip flip-qdeck"+e+'" '+a+'onclick="'+qname+".qdeck_flip ("+e+')" title="'+T("Show the other side")+'">'+T(r)+"</button> ",deckdata[e].n_to_go>1&&(deckdata[e].hide_gotit_b?next_button_active_b||deckdata[e].gotit_active?t+='<button class="'+d+"next_card-qdeck"+e+'" onclick="'+qname+".next_card ("+e+')" title="'+T("Put this card at the bottom of the stack, show the next card")+'">'+T("Next card")+"</button> ":t+='<button class="'+d+"qwiz_button_disabled next_card-qdeck"+e+'" disabled onclick="'+qname+".next_card ("+e+')" title="'+T("Put this card at the bottom of the stack, show the next card")+'">'+T("Next card")+"</button> ":t+='<button class="'+d+"qwiz_button_disabled next_card-qdeck"+e+'" disabled onclick="'+qname+".next_card ("+e+')" title="'+T("Put this card at the bottom of the stack, show the next card")+'">'+T("Need more practice")+"</button> "),a="",deckdata[e].hide_gotit_b&&(a='style="display: none;" '),next_button_active_b||deckdata[e].gotit_active){const c=deckdata[e].gotit_active?T("Skip"):T("Got it!");t+='<button class="'+d+"got_it got_it-qdeck"+e+'" '+a+'onclick="'+qname+".got_it ("+e+')" title="'+T("Remove this card from the stack")+'">'+c+"</button> "}else t+='<div class="got-it_wrapper"><button class="'+d+"qwiz_button_disabled got_it got_it-qdeck"+e+'" '+a+'disabled onclick="'+qname+".got_it ("+e+')" title="'+T("Remove this card from the stack")+'">'+T("Got it!")+'</button> <span id="got-it_unavailable-qdeck'+e+'" class="got-it_unavailable" style="display: none;">Unavailable - <span class="times_up"> </span></span></div>';deckdata[e].n_to_go>1&&(a="",deckdata[e].hide_shuffle_b&&(a='style="display: none;" '),t+='<button class="'+d+"shuffle-qdeck"+e+'" '+a+'onclick="'+qname+".shuffle_order ("+e+')" title="'+T("Randomly shuffle the remaining cards")+'">'+T("Shuffle")+"</button> "),debug[5]&&console.log("[set_next_buttons] htm:",t),deckdata[e].$next_buttons.html(t).css({visibility:"visible"})},this.process_card=function(e,t,a){if(debug[0]&&console.log("[process_card] i_deck:",e),0!=deckdata[e].n_to_go||q.qwizard_b){for(var d,c,r=deckdata[e].i_user_card;;){if(q.qwizard_b?d=deckdata[e].i_card:(c=deckdata[e].ii_card,debug[0]&&console.log("[process_card] ii_card:",c),c>=deckdata[e].n_cards_for_done&&(c=0,deckdata[e].ii_card=0),d=deckdata[e].card_order[c]),!deckdata[e].cards[d].got_it){if(deckdata[e].reshow_after){const t=deckdata[e].reshow_after,a=deckdata[e].i_cards_done,c=a.length-t;if(c>=0){const t=a[c];deckdata[e].cards[t].got_it||(d=t)}deckdata[e].i_cards_done.push(d)}deckdata[e].card_reviewed_b=!1,deckdata[e].times_up=!1,deckdata[e].qrecord_id&&(deckdata[e].current_first_flip_sec=0,deckdata[e].n_flips=0,deckdata[e].current_first_textentry_sec=0),next_button_active_b||deckdata[e].gotit_active||$("button.got_it-qdeck"+e+", button.next_card-qdeck"+e).attr("disabled",!0).addClass("qwiz_button_disabled"),1==deckdata[e].n_to_go&&$("button.next_card-qdeck"+e+", button.shuffle-qdeck"+e).attr("disabled",!0).addClass("qwiz_button_disabled");var i=deckdata[e].cards[d];if(i.i_user_prev_card=r,-1==r)deckdata[e].i_dataset_intro_user_next_card=d;else deckdata[e].cards[r].i_user_next_card=d,q.qwizard_b||$(".bck-card-qdeck"+e).css({opacity:.5}).addClass("hover");deckdata[e].i_card=d,deckdata[e].i_user_card=d,void 0===i.user_card_number&&(deckdata[e].user_card_number++,i.user_card_number=deckdata[e].user_card_number),q.qwizard_b||$("span.card-number-qdeck"+e).html(i.user_card_number),q.set_card_front_and_back(e,d,a),q.qwizard_b&&(qwizard.set_qwizard_data("i_question",d),qwizard.go_to_card2());break}deckdata[e].ii_card++}deckdata[e].ii_card++}else if(deckdata[e].n_cards>1||deckdata[e].combo){var n=deckdata[e].i_user_card,_=deckdata[e].n_cards;deckdata[e].cards[_]={i_user_prev_card:n},deckdata[e].cards[n].i_user_next_card=_,q.done(e,t)}},this.done=function(e,t){showing_front(e)||q.qdeck_flip(e,event,void 0,!0),stop_timer(e),stop_timer(e,!0),deckdata[e].$card_timer&&deckdata[e].$card_timer.hide(),deckdata[e].$progress_text.html(" "),q.qwizard_b||$(".bck-card-qdeck"+e).css({opacity:.5}).addClass("hover"),$("span.card-number-qdeck"+e).html("--"),q.preview||(deckdata[e].$qcard_card_back.hide(),deckdata[e].$next_buttons.css({visibility:"hidden"}));var a=[];a.push('<div class="flashcard_summary">');var d=deckdata[e].n_cards,c=deckdata[e].n_cards_for_done;if(deckdata[e].summary_b){var r;const t=deckdata[e].n_reviewed,d=t-c;d<=0?r=T("In this %s-flashcard stack, you clicked")+" “"+T("Got it!")+"” "+T("on the first try for every card")+".":(r=T("This flashcard stack had %s cards.")+" ",r+=1==d?1==c?T("It took you one re-try overall until you clicked")+" “"+T("Got it!")+"” "+T("for this card")+".":T("It took you one re-try overall until you clicked")+" “"+T("Got it!")+"” "+T("on all cards")+".":1==c?T("It took you %s re-tries overall until you clicked")+" “"+T("Got it!")+"” "+T("for this card")+".":T("It took you %s re-tries overall until you clicked")+" “"+T("Got it!")+"” "+T("on all cards")+"."),r=(r=r.replace("%s",qqc.number_to_word(c))).replace("%s",qqc.number_to_word(d)),a.push("<p>"+r+"</p>");var i=0;if(deckdata[e].topics&&(i=deckdata[e].topics.length),1==i){const t=(o=deckdata[e].topics[0]).replace(/^(\d\.\d+-*(\d\.*\d*)*[\., _]*)*/,"").replace(/_/g," ");var n;if("Other"!=o)n=1==c?T("This"):2==c?T("Both"):T("All")+" "+qqc.number_to_word(c),a.push("<p>"+n+" "+plural(T("card was"),T("cards were"),c)+" "+T("about topic")+" “"+t+".”</p>")}else if(i>1&&t>c){for(var _=[],s=0;s<i;s++){var o;const t=(o=deckdata[e].topics[s]).replace(/^(\d\.\d+-*(\d\.*\d*)*[\., _]*)*/,"").replace(/_/g," ");var l=deckdata[e].topic_statistics[o].n_cards,k=deckdata[e].topic_statistics[o].n_reviewed;if(debug[4]&&console.log("[done] topic:",t,", i_topic_n_cards:",l,", i_topic_n_reviewed:",k),k>l){var h="<strong>"+t+"</strong>: "+qqc.number_to_word(l)+" "+plural(T("card"),T("cards"),l)+", "+qqc.number_to_word(k)+" "+T("views");_.push(h)}}var u=_.length,p='<p class="topic_list">';if(u>
151){p+=T("These are the topics of cards where you clicked");for(var m=0;m<u;m++)_[m]="• "+_[m]}else p+=T("This is the only topic for which you clicked");p+=" “"+T("Need more practice")+"”: ",p+=_.join("; ")+".",p+="</p>",a.push(p)}}a.push("</div>"),a.push(deckdata[e].exit_html),a=a.join("\n"),q.qwizard_b?q.set_editable_parts_front(e,-1,a):(a=qqc.decode_image_tags(a),q.preview?q.get_card_front(e,d).html(a):q.get_card_front(e,void 0,!1,!0).html(a),-1!=a.indexOf("mjp-s-wrapper")&&setTimeout(delay_mp3_player_reset,200)),deckdata[e].i_card=d,deckdata[e].i_user_card=c,document_qwiz_mobile?$("button.summary_exit_mobile_deck").show():$("button.summary_exit_mobile_deck").hide();var g=$("div.qcard_card-qdeck"+e+" span.unpaid_msg");if(g.length){var b=deckdata[e].pay_quiz_ok;b&&"paid"==b?g.hide():g.show()}var f=$("div.qcard_card-qdeck"+e+" span.unpaid_msg_payment_type");if(f.length&&"paid"!=deckdata[e].pay_quiz_ok){var v=deckdata[e].taker_unpaid_msgs;if(v.length){var w=Math.floor(Math.random()*v.length);f.html(v[w])}}if(q.preview||(deckdata[e].no_flip_b=!0,deckdata[e].deck_started_b=!1),q.set_container_width_height(e),deckdata[e].qrecord_id&&document_qwiz_user_logged_in_b&&!t){setTimeout((function(){var t={type:"completed",now_sec:(new Date).getTime()/1e3,confirm:"js"};record_qcard(e,deckdata[e].qrecord_id,t,!0)}),2e3)}},this.display_progress=function(e){var t;t="<p>"+deckdata[e].n_cards_for_done+" "+T("cards total")+", "+deckdata[e].n_reviewed+" "+plural(T("card"),T("cards"),deckdata[e].n_reviewed)+" "+T("reviewed"),deckdata[e].hide_gotit_b||(t+=", "+deckdata[e].n_to_go+" "+plural(T("card"),T("cards"),deckdata[e].n_to_go)+" "+T("to go")+"</p>"),deckdata[e].$progress_text.html(t)}
15,this.hide_menu_and_display_login=function(e,t,a,d,c,r){var i=$("div.qwiz_icon_and_menu_container.qdeck"+e+" div.qwiz_icon_trigger_and_menu");i.removeClass("qwiz-hover"),q.display_login(e,t,a,d,c,r);setTimeout((function(){i.addClass("qwiz-hover")}),500)},this.display_login=function(e,t,a,d,c,r){a||(a=""),t||a||$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce"),showing_front(e)||(deckdata[e].check_answer_disabled_b=!1,deckdata[e].no_flip_b=!1,q.qdeck_flip(e)),deckdata[e].no_flip_b=!0,deckdata[e].deck_started_b=!1,$(".bbfe-qdeck"+e).css({visibility:"hidden"}),$("span.card-number-qdeck"+e).css({visibility:"hidden"}),$("span.response_recorded_wrapper-qdeck"+e).css({display:"none"}),"progress_bars"==a||"leaderboard"==a?qqc.create_progress_bars(qname,deckdata,e,a):"feedback"==a?qqc.create_provide_feedback_screen(qname,e,deckdata[e].i_card):"use_dataset_options"==a?qqc.create_use_dataset_options(qname,deckdata,e):"pay"==a?qqc.create_pay_screen(qname,deckdata,e,d,r):"maker_pay"==a?qqc.create_maker_pay_screen(qname,deckdata,e,d):"enroll"==a?qqc.create_enroll_screen(qname,e):"register"==a||"open_register"==a?qq
15c.create_register_taker_screen(qname,e,!1,d,a):"free_trial"==a?qqc.create_register_taker_screen(qname,e,!0,d,a):"paypal_subscription"==a?qqc.create_paypal_subscription_screen(qname,e):document_qwiz_wp_user_session_id?qqc.create_refresh_page_notice(qname,e):(deckdata[e].$qcard_card_front.html(get_login_html(e,t,d,c)),deckdata[e].deck_started_b=!1,qqc.init_hide_show_password("#qdeck_password-qdeck"+e),$("#qdeck_username-qdeck"+e).focus()),deckdata[e].$next_buttons.css("visibility","hidden")},this.qdeck_password_focus=function(e,t){e.qwiz_pw="",e.value="",$("#qdeck_login-qdeck"+t+" p.login_error").css({display:"none"})},this.login=function(e,t,a){t=t?1:0,a=a?1:0,$.removeCookie("qwiz_declined_login",{path:"/"}),document_qwiz_declined_login_b=!1;var d=$("#qdeck_username-qdeck"+e),c=d.val();if(!c)return alert(T("Please enter Login name")),d.focus(),!1;if(t&&-1!=document_qwiz_username.split("; ").indexOf(c))return alert("User "+c+" is already on your team."),!1;var r=$("#qdeck_password-qdeck"+e),i=r.val();if(!i)return alert(T("Please enter Password")),r.focus(),!1;r.blur();var n,_=CryptoJS.SHA3(i).toString();t?n=document_qwiz_remember_f:(n=$("#qdeck_login-qdeck"+e+' input[type="checkbox"]').prop("checked")?1:0,document_qwiz_remember_f=n);var s={username:c,sha3_password:_,remember_f:n,add_team_member_f:t};return t&&(s.previous_username=document_qwiz_username),a&&(s.proceed_to_pay_f="1"),qqc.jjax(qname,e,deckdata[e].qrecord_id,"login",s),!1},this.login_ok=function(e,t,a,d){debug[0]&&console.log("[login_ok] i_deck:",e);var c={path:"/"};1==a&&(c.expires=1),$.cookie("qwiz_session_id",document_qwiz_session_id,c),c.expires=30,$.cookie("qwiz_user_login",1,c),qqc.check_session_id(e),document_qwiz_user_logged_in_b=!0;var r=qqc.get_qwiz_param("login_timeout_min",40);if(c.expires=r/1440,$.cookie("qwiz_current_login_lt_nmin_ago",1,c),qqc.set_user_menus_and_icons(qname),qwiz_&&qwiz_.any_pay_quiz_f&&qwiz_.pay_lock_settings(),qcard_&&qcard_.any_pay_deck_f&&qcard_.pay_lock_settings(),$("#qdeck_login-qdeck"+e).hide(),q.qrecord_b)for(var i=0;i<n_decks;i++)deckdata[i].qrecord_id&&(deckdata[i].record_start_b=!0);return d&&"paid"==deckdata[e].pay_quiz_ok&&(d=!1),d?q.display_login(e,!1,"pay"):-1==deckdata[e].i_card?deckdata[e].$qcard_card_front.html(qqc.decode_image_tags(deckdata[e].intro_html)):q.login_ok_start_deck(e),!1},this.login_ok_start_deck=function(e){var t=deckdata[e].i_card;if(deckdata[e].$next_buttons.css("visibility","visible"),0==t)q.start_deck(e,!0);else{deckdata[e].record_start_b=!1;var a={type:"start",now_sec:(new Date).getTime()/1e3,confirm:"js"};if(record_qcard(e,deckdata[e].qrecord_id,a,!0),-1==t){var d=q.get_card_front(e,-1,!1,!0);d.html(qqc.decode_image_tags(deckdata[e].intro_html)),d.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this,!0)}))}else $(".bbfe-qdeck"+e).css({visibility:"visible"}),$("span.card-number-qdeck"+e).css({visibility:"visible"}),t>=deckdata[e].n_cards?q.done(e):(q.set_card_front_and_back(e,t,!0),deckdata[e].no_flip_b=!1)}},this.login_not_ok=function(e,t){t||(t=T("Login incorrect. Please try again")),$("#qdeck_login-qdeck"+e+" p.login_error").html(t).css("display","block"),debug[0]&&console.log("[login_not_ok] $ ('#qdeck_login-qdeck"+e+" p.login_error'):",$("#qdeck_login-qdeck"+e+" p.login_error"))},this.no_login=function(e,t,a,d){debug[0]&&console.log("[no_login] e:",d),a&&d&&d.stopPropagation(),t||a||$("#qdeck_login-qdeck"+e+' input[type="checkbox"]').prop("checked")&&($.cookie("qwiz_declined_login",1,{path:"/"}),document_qwiz_declined_login_b=!0),$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce"),deckdata[e].$next_buttons.css("visibility","visible");var c=deckdata[e].i_user_card;-1==c?a?q.get_card_front(e,-1,!1,!0).html(qqc.decode_image_tags(deckdata[e].intro_html)):q.start_deck(e,!0):(c==deckdata[e].n_cards?q.done(e):(q.set_card_front_and_back(e,c,!0),deckdata[e].no_flip_b=!1),$(".bbfe-qdeck"+e).css({visibility:"visible"}),$("span.card-number-qdeck"+e).css({visibility:"visible"}));setTimeout((function(){showing_front(e)||(deckdata[e].check_answer_disabled_b=!1,q.qdeck_flip(e))}),50)},this.icon_no_login=function(e){$("div.qwiz-usermenu_icon").removeClass("qwiz-icon-bounce"),$("#usermenu-qdeck"+e+' input[type="checkbox"]').prop("checked")&&($.cookie("qwiz_declined_login",1,{path:"/"}),document_qwiz_declined_login_b=!0),$("#usermenu-qdeck"+e).hide()},this.qdeck_flip=function(e,t,a,d,c){if(debug[0]&&console.log("[qdeck_flip] i_deck:",e,", deckdata[i_deck].i_card:",deckdata[e].i_card,", deckdata[i_deck].no_flip_b:",deckdata[e].no_flip_b),void 0!==a){if(-1==a||a==deckdata[e].n_cards)return!1}else a=deckdata[e].bck_f?deckdata[e].i_user_card:deckdata[e].i_card;if(deckdata[e].no_flip_b)return deckdata[e].deck_started_b&&(deckdata[e].no_flip_b=!1),!1;if(t){var r=$(t.srcElement);if("a"==t.srcElement.tagName.toLowerCase()||r.parents("a").length)if(r.parents("figcaption").length)return!1}var i,n=deckdata[e].cards[a];if(!n.single_char_b&&deckdata[e].check_answer_disabled_b)return void(n.textentry_required_b&&(alert(Tcheck_answer_message),$("#textentry_hint-qdeck"+e).removeAttr("disabled").removeClass("qwiz_button_disabled").show()));1==deckdata[e].n_cards?stop_timer(e):deckdata[e].deck_timer&&q.no_intro_b[e]&&(d?deckdata[e].$card_timer&&deckdata[e].$card_timer.hide():c||deckdata[e].card_reviewed_b||deckdata[e].times_up||start_timers(e)),q.preview?(i=$("div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+a+" div.qcard_card-qdeck"+e+" div.qcard-front"),$("div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+a+" div.qcard_card-qdeck"+e+" div.qcard-back")):(i=q.get_card_front(e),get_card_back(e),$("div.qcard_card-qdeck"+e+" div.qcard-front"),$("div.qcard_card-qdeck"+e+" div.qcard-back"));var _=i.find("input.textentry-qdeck"+e),s=!1,o="";q.preview&&(o=" preview-qcard"+deckdata[e].i_card);var l=showing_front(e);const k=deckdata[e].showing_first;if(debug[0]&&console.log("[qdeck_flip] showing_front_f:",l,", showing_first:",k),"back"==k&&(l=!l,debug[0]&&console.log("[qdeck_flip] showing_front_f:",l)),l){if(deckdata[e].qrecord_id&&document_qwiz_user_logged_in_b&&(deckdata[e].n_flips++,deckdata[e].record_start_b&&document_qwiz_user_logged_in_b)){deckdata[e].record_start_b=!1;var h={type:"start",now_sec:g=(new Date).getTime()/1e3,confirm:"js"};record_qcard(e,deckdata[e].qrecord_id,h,!0)}if(1==deckdata[e].user_card_number&&($("div#icon_qdeck"+e).hide(),alert_not_logged_in(e)),"front"==k&&$(button_flip_selector(e)).html(T("Flip back")).removeClass("qwiz_button_disabled").attr("disabled",!1),!deckdata[e].bck_f){if(deckdata[e].times_up||deckdata[e].hangman_incorrect_chars_f){const t=deckdata[e].hangman_incorrect_chars_f?T("too many incorrect letters"):T("time limit");$("span#got-it_unavailable-qdeck"+e+" span.times_up").html(t),$("span#got-it_unavailable-qdeck"+e).show()}else"front"==k||n.textentry_required_b||void 0!==deckdata[e].hangman[a]?$("button.got_it-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled"):$("button.got_it-qdeck"+e).prop("disabled",!0).addClass("qwiz_button_disabled");"front"==k||n.textentry_required_b||void 0!==deckdata[e].hangman[a]?$("button.next_card-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled"):$("button.next_card-qdeck"+e).prop("disabled",!0).addClass("qwiz_button_disabled"),deckdata[e].card_t
15ime_limit&&stop_timer(e,!0)}if(!deckdata[e].card_reviewed_b&&!deckdata[e].bck_f){deckdata[e].card_reviewed_b=!0,deckdata[e].n_reviewed++;var u=deckdata[e].card_topics[a];if(debug[4]&&console.log("[qdeck_flip] card_topics:",u),u)for(var p=0;p<u.length;p++){var m=u[p];deckdata[e].topic_statistics[m].n_reviewed++}if((deckdata[e].n_cards>1||deckdata[e].combo)&&q.display_progress(e),deckdata[e].gotit_active&&$("button.got_it-qdeck"+e).html(T("Got it!")),deckdata[e].qrecord_id){var g=(new Date).getTime()/1e3;deckdata[e].current_first_flip_sec=g}}_.length&&(_.blur(),n.textentry_required_b?q.textentry_set_card_back(e,a):(s=_.val())?(n.saved_textentry=s,$("p.back_textentry_p-qdeck"+e+o).css("visibility","visible"),$("span.back_textentry-qdeck"+e+o).html(s)):$("p.back_textentry_p-qdeck"+e+o).css("visibility","hidden")),"back"}else"front",deckdata[e].bck_f||("back"==k&&(n.textentry_required_b||void 0!==deckdata[e].hangman[a]?($("button.got_it-qdeck"+e).prop("disabled",!0).addClass("qwiz_button_disabled"),$("button.next_card-qdeck"+e).prop("disabled",!0).addClass("qwiz_button_disabled")):($("button.got_it-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled"),$("button.next_card-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled"))),$(button_flip_selector(e)).html(n.check_answer));if(q.preview)$("div.card-container.preview-qdeck"+e+".preview-qcard"+a+" div.qcard_card").flip("toggle");else if(deckdata[e].flip_axis){deckdata[e].$qcard_card.flip({axis:deckdata[e].flip_axis});setTimeout((function(){deckdata[e].$qcard_card.flip("toggle")}),20)}else deckdata[e].$qcard_card.flip("toggle");return deckdata[e].showing_front_b&&setTimeout("qcard_.set_container_width_height ("+e+", "+a+")",700),toggle_showing_front(e),q.qwizard_b&&(showing_front(e)?qqc.select_placeholder(deckdata[e].$qcard_front_part1):(qqc.select_placeholder(deckdata[e].$qcard_back_part1),qwizard.init_tinymce_onclick(deckdata[e].$qcard_back_part1[0]))),!1},this.set_card_front_and_back=function(e,t,a,d){debug[0]&&console.log("[set_card_front_and_back] i_deck:",e,", i_card:",t),q.preview?$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-front-back"):deckdata[e].$qcard_card_front_back,(deckdata[e].n_cards>1||deckdata[e].combo)&&(q.display_progress(e),deckdata[e].card_time_limit&&(q.no_intro_b[e]||start_timers(e)));var c,r,i=deckdata[e].cards[t];$(button_flip_selector(e)).removeAttr("disabled").removeClass("qwiz_button_disabled"),deckdata[e].check_answer_disabled_b=!1;var n="front";q.qwizard_b||q.preview||"random"==(n=deckdata[e].show_first)&&(n=Math.random()<.5?"front":"back"),deckdata[e].showing_first=n;var _=-1,s="",o=function(){q.preview?c=q.get_card_front(e,t):(c=q.get_card_front(e),q.get_card_front(e,t,!0).hide());c.css({display:"inline-block"});var a,r=i.card_front;if([r,a]=qqc.qlatex_convert(r),q.qwizard_b&&!deckdata[e].use_dataset_card_ids[t]?q.set_editable_parts_front(e,t,r):c.html(qqc.decode_image_tags(r)),q.no_intro_b[e]&&0==deckdata[e].n_reviewed){if(!deckdata[e].hide_qwizcards_icon_b){var n=create_qwiz_icon_div(e);deckdata[e].$qcard_card.append(n)}q.qwiz_icon_stop_propagation(e)}var o=c.find("input.textentry-qdeck"+e);if(o.length){var l="";d&&i.saved_textentry&&(l=i.saved_textentry,i.saved_textentry_ok&&($(button_flip_selector(e)).removeAttr("disabled").removeClass("qwiz_button_disabled").html(T("Check answer")),deckdata[e].check_answer_disabled_b=!1)),o.val(l),0==deckdata[e].n_reviewed&&q.no_intro_b[e]||(panel_exit_mobile_just_closed_b=!0,s=o),deckdata[e].click_flip_b&&o.click((function(e){e.stopPropagation(),debug[0]&&console.log("[set_card_front_and_back] click event:",e)}))}else if(void 0!==deckdata[e].hangman[t]){var k=deckdata[e].hangman[t],h=k.n_hangman;k.n_hangman_done=0,k.n_hangman_correct=0;for(var u=!0,p=deckdata[e].answered_correctly[t],m=0;m<h;m++){var g=c.find("span.qdeck_hangman.qdeck_hangman_c"+m),b=k.hangman_final_entry[m];if(d)-1==(f=k.hangman_current_entry[m]).indexOf("<u>\t</u>")&&(k.n_hangman_done++,k.n_hangman_correct++),f=f.replace(/\t/g," "),g.find("span.hangman_current_entry").html(f),g.find("span.hangman_type_letters").hide();else if(h>1&&!p&&!1===p&&(g.find("span.hangman_current_entry").html(f),k.hangman_incorrect_chars[m].length<=3&&0==k.hangman_n_hints[m]))g.find("span.hangman_current_entry").html(b),g.find("span.hangman_type_letters").hide(),k.n_hangman_done++,k.n_hangman_correct++;else{var f=b.replace(/>[a-z0-9]</gi,"> <");k.hangman_current_entry[m]=f.replace(/u> </g,"u>\t<"),g.find("span.hangman_current_entry").html(f);var v,w=g.find("input");q.qwizard_b&&"placeholder"==k.hangman_answer[m]||(w.off("mousedown"),$("#hangman_hint-qdeck"+e).removeAttr("disabled").removeClass("qwiz_button_disabled")),k.hangman_incorrect_chars[m]="",k.hangman_n_hints[m]=0,deckdata[e].click_flip_b&&w.click((function(e){e.stopPropagation(),debug[0]&&console.log("[set_card_front_and_back] click event:",e)}
15)),v=-1!=k.hangman_answer[m].search(/[a-z]/i)?T("Type letters in the box"):T("Type numbers in the box"),g.find("span.hangman_type_letters").html('<span class="type_letters">'+v+"</span>"),u&&(u=!1,0==deckdata[e].n_reviewed&&q.no_intro_b[e]&&(p||!1!==p)||(panel_exit_mobile_just_closed_b=!0,_=m))}}"hangman_labeled_diagram"==deckdata[e].cards[t].type&&(q.qwizard_b?(c.find("div.hangman_label").addClass("ui-draggable ui-draggable-handle ui-resizable"),qwizzled.reinit_dragging(c)):c.find("div.hangman_label").each((function(){var e=$(this),t=e.outerWidth();e.outerWidth(1.2*t)})))}if(q.qwizard_b||c.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this,!0)})),$().mediaelementplayer&&$("div.qcard-front .wp-audio-shortcode, div.qcard-front .wp-video-shortcode").not(".mejs-container").filter((function(){return!$(this).parent().hasClass("mejs-mediaelement")})).mediaelementplayer(),deckdata[e].click_flip_b){setTimeout((function(){deckdata[e].$qcard_card_front.find('div.mejs-container, input[onclick^="play_mp3"], div.qwiz_no_click_flip, .mjp-s-wrapper').click((function(e){e.stopPropagation()}))}),250)}init_code_highlight(c),a&&qqc.qlatex_init(c)},l=function(){q.preview?r=get_card_back(e,t):(r=get_card_back(e),get_card_back(e,t,!0).hide());r.css({display:"inline-block"});var a,d=i.card_back;[d,a]=qqc.qlatex_convert(d),q.qwizard_b&&!deckdata[e].use_dataset_card_ids[t]?set_editable_parts_back(e,d):r.html(qqc.decode_image_tags(d));var c,n=deckdata[e].default_card_back_background,_=deckdata[e].card_back_background[t];if(_&&(n=_),n&&(c="img:"==n.substr(0,4)?{"background-image":"url("+n.substr(4)+")"}:{background:n},r.parents(".qcard-back").css(c)),$().mediaelementplayer&&$("div.qcard-back .wp-audio-shortcode, div.qcard-back .wp-video-shortcode").not(".mejs-container").filter((function(){return!$(this).parent().hasClass("mejs-mediaelement")})).mediaelementplayer(),deckdata[e].click_flip_b){setTimeout((function(){deckdata[e].$qcard_card_back.find('div.mejs-container, input[onclick^="play_mp3"], div.qwiz_no_click_flip, .mjp-s-wrapper').click((function(e){e.stopPropagation()}))}),250)}q.qwizard_b||r.find("span.qwiz_img_swap.not_inited").each((function(){qqc.init_image_swap(this,!0)})),init_code_highlight(r),a&&qqc.qlatex_init(r)},k=function(){if(setTimeout((function(){$("div.qcard-front-back .mejs-container").css({"min-width":"300px"})}),200),void 0!==deckdata[e].hangman[t]&&(q.qwizard_b||deckdata[e].bck_f||"front"!=n||($(button_flip_selector(e)).addClass("qwiz_button_disabled").attr("disabled",!0),deckdata[e].check_answer_disabled_b=!0)),document_active_qwiz_qdeck&&$(document_active_qwiz_qdeck).find("div.qdeck-focusable input").focus().blur(),i.textentry_required_b)q.init_textentry_autocomplete(e,t);else{var a=q.qwizard_b&&deckdata[e].hide_flip_b?T("Flip (click disabled)"):T("Check answer");$(button_flip_selector(e)).html(T(a)).attr("title",T("Show the other side")),i.check_answer=T(a)}(q.set_container_width_height(e,t,i.textentry_required_b),deckdata[e].scroll_b||document_qwiz_mobile)&&(deckdata[e].$qcard_card.find("div.qcard-front, div.qcard-back").css({overflow:"auto"}),deckdata[e].$qcard_card_front_back.scrollLeft(0).scrollTop(0))};if(showing_front(e))debug[0]&&console.log("[set_card_front_and_back] (showing front)"),o(),l(),k(),_>=0&&hangman_focus(e,_);else{debug[0]&&console.log("[set_card_front_and_back] (showing back)"),"front"==n?o():l();setTimeout((function(){a||q.qdeck_flip(e);setTimeout((function(){"front"==n?l():o(),k(),s&&s.focus(),_>=0&&hangman_focus(e,_)}),700)}),100)}deckdata[e].first_display_f?deckdata[e].first_display_f=!1:"undefined"!=typeof MP3_JPLAYER&&(-1==i.card_front.indexOf("mjp-s-wrapper")&&-1==i.card_back.indexOf("mjp-s-wrapper")||setTimeout(delay_mp3_player_reset,200))},this.set_editable_parts_front=function(e,t,a){debug[0]&&console.log("[set_editable_parts_front] card_front:",a);var d,c,r=!1,i="",n=[];if(-1!=(a=qqc.shortcodes_to_video_elements(a)).indexOf("qcard_textentry"))i=new RegExp('<div class="qcard_textentry[^>]*[^]*?</div>\x3c!-- END --\x3e',"g");else if(-1!=a.indexOf("qcard_single_char_entry"))i=new RegExp('<div class="qcard_single_char_entry[^>]*[^]*?</div>\x3c!-- END --\x3e',"g");else if(-1!=a.indexOf("hangman_img_wrapper")){r=!0;var _=a.search(/<div[^>]+hangman_labeled_diagram_fields/);d=qqc.find_matching_block(a.substr(_)),a=a.replace(d,"")}else-1!=a.indexOf("qdeck_hangman")&&(i=new RegExp('<span class="qdeck_hangman[^>]*[^]*?</span>\x3c!-- END --\x3e',"g"),n=a.match(i),c=a.split(i));if(i&&(n=a.match(i),c=a.split(i)),n.length){debug[9]&&(console.log("[set_editable_parts_front] divs:",n),console.log("[set_editable_parts_front] splits:",c)),qwizard.init_tinymce($("div#qcard_front-part1-qdeck"+e)[0]),qwizard.init_tinymce_onclick($("div#qcard_front-part2-qdeck"+e)[0]);var s=n.length;add_editable_parts(e,s),$("#qcard_front-part0-qdeck"+e).hide(),$("div.qcard_front-parts, div.qcard_front-inputs").html("").hide();for(var o=0;o<s;o++){var l=o+1,k=qqc.remove_unmatched_tag(c[o],1==l);$("#qcard_front-part"+l+"-qdeck"+e).html(k).css({display:""}),$("#qcard_front-input"+l+"-qdeck"+e).html(n[o]).css({display:""})}l=s+1,k=qqc.remove_unmatched_tag(c[s],!1,!0);$("#qcard_front-part"+l+"-qdeck"+e).html(k).css({display:""})}else{for(var h=3;;){var u=$("div#qcard_front-input"+(h-1)+"-qdeck"+e);
15if(0==u.length)break;u.remove(),$("div#qcard_front-part"+h+"-qdeck"+e).remove(),h++}qwizard.init_tinymce($("div#qcard_front-part1-qdeck"+e)[0]),qwizard.init_tinymce_onclick($("div#qcard_front-part2-qdeck"+e)[0]);var p=qqc.opening_tag_shortcode_pos("<button",a);if(!r&&p<a.length){var m=a.substr(0,p);if(-1!=m.indexOf('<div class="flashcard_summary')){var g=m.indexOf("</div>")+6,b=m.substring(0,g);$("#qcard_front-part0-qdeck"+e).html(b).show(),m=m.substr(g+1)}else $("#qcard_front-part0-qdeck"+e).hide();var f=qqc.find_matching_block(a.substr(p)),v=a.substr(p+f.length);$("#qcard_front-part1-qdeck"+e).html(m).css({display:""}),$("#qcard_front-input1-qdeck"+e).html(f).show();v=delete_unmatched_p(v);$("#qcard_front-part2-qdeck"+e).html(v).css({display:""})}else if($("#qcard_front-part0-qdeck"+e).hide(),$("#qcard_front-part1-qdeck"+e).html(a).css({display:"block"}),$("#qcard_front-input1-qdeck"+e).html("").hide(),$("#qcard_front-part2-qdeck"+e).html("").hide(),r){var w=q.get_card_front(e);q.save_remove_hangman_fields(e,w),w.append(d);setTimeout((function(){w.find("div.hangman_labeled_diagram_fields").attr("data-qcard",t),qwizard.position_hangman_fields_div(),qwizard.set_hangman_label_width(w)}),100),w.on("keyup",(function(){qwizard.position_hangman_fields_div("",!0)}))}}if(!r){w=q.get_card_front(e);q.save_remove_hangman_fields(e,w),(w=q.get_card_front(e)).off("keyup")}},this.save_remove_hangman_fields=function(e,t,a){var d=t.find("div.hangman_labeled_diagram_fields").first();if(d.length){var c=d.data("qcard"),r=d.html();qwizard.questions_cards[c].hangman_fields=r,a||d.remove();var i=deckdata[e].cards[c].card_front,n=i.search(/<div[^>]+hangman_labeled_diagram_fields/);if(-1==n)deckdata[e].cards[c].card_front+='<div class="hangman_labeled_diagram_fields" data-qcard="'+c+'">'+r+"</div>";else{var _=qqc.find_matching_block(i.substr(n)).match(/>([^]*)<\/div>$/);if(_){var s=_[1];deckdata[e].cards[c].card_front=i.replace(s,r)}}}},this.textentry_set_card_back=function(e,t,a,d){debug[0]&&console.log("[textentry_set_card_back] i_card:",t,", local_i_choice:",a);var c,r,i=deckdata[e].cards[t],n=get_card_back(e);if(void 0!==a)c=a,r=n.find("span.back_qcard_textentry").html();else{var _=(r=(q.preview?$("div#qcard_window-qdeck"+e+" div.card-container.preview-qcard"+t+" input.textentry-qdeck"+e):$("input.textentry-qdeck"+e)).val()).toLowerCase();c=-1;for(var s=i.choices.length,o=0,l=0;l<s;l++){var k=i.choices[l];if("*"==k[0])o=l;else if(-1!=k.map((function(e){return e.toLowerCase()})).indexOf(_)){c=l;break}}-1==c&&(c=o)}r||(r="___________");var h="";q.preview&&(h=" preview-qcard"+t);var u='<p class="back_textentry_p'+h+'">'+T("You entered")+' “<span class="back_qcard_textentry'+h+'">'+r+'</span>”</p><div id="qcard_back-part1-qdeck'+e+'" class="card_back_textentry">\n'+i.feedback_htmls[c]+"</div>";q.qwizard_b&&!deckdata[e].use_dataset_card_ids[t]?set_editable_parts_back(e,u,c,d):get_card_back(e).html(qqc.decode_image_tags(u))},window.onorientationchange=function(){if(document_qwiz_mobile&&void 0!==mobile_i_deck){setTimeout((function(){mobile_center_vertical(mobile_i_deck)}),100)}},this.set_container_width_height=function(e,t,a){if(document_qwiz_mobile)mobile_center_vertical(e);else{var d,c,r,i,n=deckdata[e].scroll_b;void 0===t&&(t=deckdata[e].i_user_card),q.preview?(d=$("div.card-window.preview-qdeck"+e+".preview-qcard"+t),c=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t),$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-front-back"),deckdata[e].use_dataset_card_ids[t]?(r=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-front div.qcard_content_size_alt"),i=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-back div.qcard_content_size_alt")):(r=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-front div.qcard_content_size"),i=$("div.card-container.preview-qdeck"+e+".preview-qcard"+t+" div.qcard-back div.qcard_content_size"))):(d=deckdata[e].$qcard_window,c=deckdata[e].$qcard_container,deckdata[e].$qcard_card_front_back,r=q.get_card_front(e),i=get_card_back(e));var _=c.find("div.qcard_card"),s=0,o=function(){var l,k,h=_.find("img");if(h.length&&0==h[0].width&&(debug[0]&&console.log("[delay_set_container_width_height] zero-width img; n_delays:",s),s<10))return s++,setTimeout(o,100),!1;if(deckdata[e].card_width_setting&&(l=deckdata[e].card_width_setting.replace("px",""),k=deckdata[e].card_height_setting.replace("px","")),n)l?(l=deckdata[e].card_width_setting.replace("px",""),k=deckdata[e].card_height_setting.replace("px",""),d.width(l),d.height(k)):(l=c.outerWidth(),k=c.outerHeight());else{var u=parseInt(r.outerWidth()),p=parseInt(r.outerHeight()),m=parseInt(i.outerWidth()),g=parseInt(i.outerHeight()),b=Math.max(u,m),f=Math.max(p,g);debug[0]&&console.log("[delay_set_container_width_height] width_front: ",u,", width_back: ",m);var v=parseInt(r.outerWidth()),w=parseInt(r.outerHeight());debug[0]&&console.log("[delay_set_container_width_height] i_deck:",e,", new_width_front: ",v,", new_height_front: ",w);var y=0,x=0;if(a)for(var z=deckdata[e].cards[t].choices.length,A=0;A<z;A++){q.textentry_set_card_back(e,t,A);var T=parseInt(i.find("#qcard_back-part1-qdeck"+e).outerWidth()),C=parseInt(i.find("#qcard_back-part1-qdeck"+e).outerHeight());y=Math.max(y,T),x=Math.max(x,C)}else y=parseInt(i.outerWidth()),x=parseInt(i.outerHeight());var I=Math.max(v,y),O=Math.max(w,x);debug[13]&&(console.log("[delay_set_container_width_height] new_width_front: ",v,", new_width_back: ",y),console.log("[delay_set_container_width_height] new_height_front: ",w,", new_height_back: ",x),console.log("[delay_set_container_width_height] new_max_width: ",I,", new_max_height: ",O)),a&&(I+=10,O+=10),b=Math.max(b,I,l),f=Math.max(f,O,k),debug[13]&&console.log("[delay_set_container_width_height] max_width: ",b,", max_height: ",f)}q.preview?(c.width(b).height(f),d.width(b).height(f)):n||document_qwiz_mobile||document_qwiz_force_mobile_f||(_.width(b).height(f),d.width(b).height(f),q.qwizard_b&&$("div.qcard_card-qdeck"+e).css({width:b+"px",height:f+"px"})),center_vertical(r,k),center_vertical(i,k);const D=d.parents("div").first();if(D.length){const e=D.width();if(b>e){const t=e/b,a=Math.round(50*(1-t)),c={"max-width":"none",transform:"translate("+("rtl"==getComputedStyle(D[0]).direction?1:-1)*a+"%, -"+a+"%) scale("+t.toFixed(3)+")"};d.css(c),qqc.offset_height_rescale(d,t,80*t)}else d.css({transform:""})}};setTimeout(o,300)}},this.got_it=function(e){if(!q.qwizard_b){const t=deckdata[e].i_card;deckdata[e].cards[t].got_it=!0,deckdata[e].n_to_go--}q.next_card(e,!0)},this.next_card=function(e,t,a){if(debug[0]&&console.log("[next_card] deckdata[i_deck].i_card:",deckdata[e].i_card),deckdata[e].bck_f)return void q.fwd_card(e,!1);if(!a){var d=deckdata[e].i_card;
15if(void 0!==deckdata[e].hangman[d]){if(!t){deckdata[e].answered_correctly[d]=!1;for(var c=deckdata[e].hangman[d],r=c.n_hangman,i=0;i<r;i++)c.hangman_n_hints[i]=1;$("span#got-it_unavailable-qdeck"+e).hide(),deckdata[e].hangman_incorrect_chars_f=!1}}else deckdata[e].cards[d].textentry_required_b&&(t||$("span#got-it_unavailable-qdeck"+e).hide());if(deckdata[e].gotit_active&&$("button.got_it-qdeck"+e).html(T("Skip")),!q.qwizard_b&&deckdata[e].qrecord_id&&document_qwiz_user_logged_in_b){var n=(new Date).getTime()/1e3;t=t?1:0;var _={type:"flashcard",i_card:deckdata[e].dataset_id[d],unit:deckdata[e].unit[d],level:deckdata[e].level[d],q_and_a_text:btoa(encodeURIComponent(deckdata[e].q_and_a_text[d])),first_flip_sec:deckdata[e].current_first_flip_sec,n_flips:deckdata[e].n_flips,first_textentry_sec:deckdata[e].current_first_textentry_sec,response:"",now_sec:n,got_it_f:t,confirm:"js"};record_qcard(e,deckdata[e].qrecord_id,_)}deckdata[e].i_user_card=d;var s=deckdata[e].flip_axis,o=!1;if(s||(s=Math.random()>.5?"x":"y",o=Math.random()>.5),deckdata[e].$qcard_card.flip({axis:s,reverse:o}),deckdata[e].pay_quiz_deck_id&&("preview_questions"==deckdata[e].pay_quiz_ok||"preview_period_expired"==deckdata[e].pay_quiz_ok||"no_free_trial"==deckdata[e].pay_quiz_ok)&&qqc.preview_limit("deck",deckdata,e))return void(showing_front(e)||q.qdeck_flip(e))}const l=deckdata[e].combo_i_qwiz;void 0===l||a?q.process_card(e):qqc.combo_next("F",l,e,t)},this.bck_card=function(e,t){if($(".bck-card-qdeck"+e).hasClass("hover")){var a;if(deckdata[e].bck_f=!0,t){if(deckdata[e].use_dataset&&deckdata[e].dataset_intro_f)return deckdata[e].saved_i_card=deckdata[e].i_card,$(".bck-card-qdeck"+e).css({opacity:.2}).removeClass("hover"),$(".fwd-card-qdeck"+e).css({opacity:.5}).addClass("hover"),$("span.card-number-qdeck"+e).html("--"),deckdata[e].i_card=-1,void q.display_login(e,!1,"use_dataset_options");a=deckdata[e].card_order[0]}else if(a=deckdata[e].i_user_card,-1==(a=deckdata[e].cards[a].i_user_prev_card))return;deckdata[e].i_user_card=a;var d=deckdata[e].cards[a];if(t||-1==d.i_user_prev_card){var c=$(".bck-card-qdeck"+e);deckdata[e].use_dataset&&deckdata[e].dataset_intro_f&&(c=c.last()),c.css({opacity:.2}).removeClass("hover")}var r=d.user_card_number;$("span.card-number-qdeck"+e).html(r),$(".fwd-card-qdeck"+e).css({opacity:.5}).addClass("hover"),deckdata[e].$next_buttons.css({visibility:"visible"}),deckdata[e].no_flip_b=!1,$("button.got_it-qdeck"+e).prop("disabled",!0).addClass("qwiz_button_disabled"),$("button.next_card-qdeck"+e).prop("disabled",!1).removeClass("qwiz_button_disabled"),deckdata[e].check_answer_disabled_b=!1,showing_front(e)||q.qdeck_flip(e),q.set_card_front_and_back(e,a,!1,!0)}},this.fwd_card=function(e,t){if($(".fwd-card-qdeck"+e).hasClass("hover")){var a;t?(-1==deckdata[e].i_card&&(deckdata[e].i_card=deckdata[e].saved_i_card),a=deckdata[e].i_card,deckdata[e].no_flip_b=!1,deckdata[e].$next_buttons.css({visibility:"visible"})):-1==deckdata[e].i_card?(a=deckdata[e].i_dataset_intro_user_next_card,deckdata[e].i_card=deckdata[e].saved_i_card,deckdata[e].no_flip_b=!1,deckdata[e].$next_buttons.css({visibility:"visible"})):(a=deckdata[e].i_user_card,a=deckdata[e].cards[a].i_user_next_card),deckdata[e].i_user_card=a;var d=deckdata[e].cards[a];if(a==deckdata[e].i_card){if(deckdata[e].bck_f=!1,$(".fwd-card-qdeck"+e).css({opacity:.2}).removeClass("hover"),deckdata[e].i_card==deckdata[e].n_cards)return void q.done(e);deckdata[e].card_reviewed_b?($("button.got_it-qdeck"+e).attr("disabled",!1).removeClass("qwiz_button_disabled"),deckdata[e].check_answer_disabled_b=!1):($("button.next_card-qdeck"+e).attr("disabled",!0).addClass("qwiz_button_disabled"),deckdata[e].check_answer_disabled_b=!0)}var c=d.user_card_number;$("span.card-number-qdeck"+e).html(c);var r=$(".bck-card-qdeck"+e);-1==d.i_user_prev_card&&(r=r.first()),r.css({opacity:.5}).addClass("hover"),showing_front(e)||q.qdeck_flip(e),q.set_card_front_and_back(e,a,!1,!0)}},this.shuffle_order=function(e){for(var t=deckdata[e].i_card,a=deckdata[e].card_order[t];;){var d=deckdata[e].card_order[t];if(d!=a&&!deckdata[e].cards[d].got_it)break;deckdata[e].card_order=qqc.shuffle(deckdata[e].card_order)}showing_front(e)||q.qdeck_flip(e),q.process_card(e)};var find_matching_terms=function(e,t){var a=e.term.toLowerCase(),d=qqc.metaphone(a);if(debug[6]&&console.log("[find_matching_terms] entry_metaphone; ",d),deckdata[textentry_i_deck].qrecord_id&&!deckdata[textentry_i_deck].current_first_textentry_sec){var c=(new Date).getTime()/1e3;deckdata[textentry_i_deck].current_first_textentry_sec=c}for(var r=100,i=100,n=deckdata[textentry_i_deck].i_card,_=deckdata[textentry_i_deck].c
15ards[n],s=_.textentry_minlength,o=0;o<textentry_answer_metaphones[textentry_i_deck].length;o++)a[0]==textentry_answers[textentry_i_deck][o][0].toLowerCase()&&(r=Math.min(r,textentry_answers[textentry_i_deck][o].length),debug[6]&&console.log("[find_matching_terms] entry[0]:",a[0],", textentry_answers[textentry_i_deck][i][0]:",textentry_answers[textentry_i_deck][o][0])),d[0]==textentry_answer_metaphones[textentry_i_deck][o][0]&&(i=Math.min(i,textentry_answer_metaphones[textentry_i_deck][o].length),debug[6]&&console.log("[find_matching_terms] textentry_answer_metaphones[textentry_i_deck]["+o+"]:",textentry_answer_metaphones[textentry_i_deck][o],", textentry_answers[textentry_i_deck]["+o+"][0]:",textentry_answers[textentry_i_deck][o][0],", required_metaphone_length:",i));100==r?r=s:(r-=2,r=Math.min(s,r)),100!=i&&(--i<2?i=2:i>4&&(i=4)),debug[6]&&console.log("[find_matching_terms] required_entry_length:",r,", required_metaphone_length:",i);var l=a.replace(/(.)\1{2,}/gi,"$1");if(l.length<r&&d.length<i)textentry_matches[textentry_i_deck]=[];else if(debug[6]&&console.log("[find_matching_terms] request.term:",e.term,d,d.length),textentry_matches[textentry_i_deck]=$.map(current_card_textentry_terms_metaphones[textentry_i_deck],(function(e){if(""==d?""==e[1]||0===e[0].toLowerCase().indexOf(a):0===e[1].indexOf(d)||0===e[0].toLowerCase().indexOf(a))return debug[6]&&console.log("[find_matching_terms] term_i:",e),e[0]})),debug[6]&&console.log("[find_matching_terms] textentry_matches[textentry_i_deck]:",textentry_matches[textentry_i_deck]),_.use_dict_b){var q,k=_.textentry_plural_b?1:0,h={action:"textentry_suggestions",entry:encodeURIComponent(a),entry_metaphone:encodeURIComponent(d),n_hints:deckdata[textentry_i_deck].textentry_n_hints,terms:textentry_matches[textentry_i_deck],plural_f:k};q=qwizcards_page_f?qqc.get_qwiz_param("server_loc","http://qwizcards.com/admin")+"/qwizard_textentry_suggestions.php":qqc.get_qwiz_param("ajaxurl",""),$.ajax({type:"POST",url:q,data:h,dataType:"json",error:function(e,t){debug[0]&&console.log("[find_matching_terms] error desc:",t)},success:function(e){textentry_matches[textentry_i_deck]=e,find_matching_terms2(t,l)}})}else find_matching_terms2(t,l)};function find_matching_terms2(e,t){textentry_matches[textentry_i_deck].length&&(lc_textentry_matches[textentry_i_deck]=textentry_matches[textentry_i_deck].map((function(e){return e.toLowerCase()})),debug[6]&&console.log("[find_matching_terms2] textentry_matches[textentry_i_deck]:",textentry_matches[textentry_i_deck])),debug[6]&&console.log("[find_matching_terms] deduped_entry.length: ",t.length,", textentry_matches[textentry_i_deck].length: ",textentry_matches[textentry_i_deck].length,", deckdata[textentry_i_deck].textentry_n_hints: ",deckdata[textentry_i_deck].textentry_n_hints);var a=deckdata[textentry_i_deck].i_card,d=deckdata[textentry_i_deck].cards[a],c=d.textentry_minlength;if(t.length>=c&&deckdata[textentry_i_deck].textentry_n_hints<5){var r=d.all_choices[0];void 0!==lc_textentry_matches[textentry_i_deck]&&-1!=lc_textentry_matches[textentry_i_deck].indexOf(r)||$("#textentry_hint-qdeck"+textentry_i_deck).removeAttr("disabled").removeClass("qwiz_button_disabled").show()}e(textentry_matches[textentry_i_deck])}function menu_closed(e){var t=deckdata[textentry_i_deck].i_card,a=deckdata[textentry_i_deck].cards[t],d=e.target.value.toLowerCase(),c=deckdata[textentry_i_deck].textentry_n_hints;if(d.length<c){var r=a.all_choices[0].substr(0,c);e.target.value=r}(a.saved_textentry=e.target.value,deckdata[textentry_i_deck].check_answer_disabled_b||(debug[6]&&console.log("[menu_closed] textentry_matches[textentry_i_deck]: ",textentry_matches[textentry_i_deck]),lc_textentry_matches[textentry_i_deck]&&-1!=lc_textentry_matches[textentry_i_deck].indexOf(d)||($(button_flip_selector(textentry_i_deck)).addClass("qwiz_button_disabled"),deckdata[textentry_i_deck].check_answer_disabled_b=!0,a.saved_textentry_ok=!1)),show_hint_timeout[textentry_i_deck])&&($("input.textentry-qdeck"+textentry_i_deck).val().length>=a.textentry_minlength&&(clearTimeout(show_hint_timeout[textentry_i_deck]),show_hint_timeout[textentry_i_deck]=0))}function menu_shown(e){if(debug[0]&&(console.log("[menu_shown] textentry_i_deck:",textentry_i_deck,", document_qwiz_user_logged_in_b:",document_qwiz_user_logged_in_b),console.log("[menu_shown] deckdata[textentry_i_deck].record_start_b:",deckdata[textentry_i_deck].record_start_b)),deckdata[textentry_i_deck].record_start_b&&document_qwiz_user_logged_in_b){deckdata[textentry_i_deck].record_start_b=!1;var t={type:"start",now_sec:(new Date).getTime()/1e3,confirm:"js"};record_qcard(textentry_i_deck,deckdata[textentry_i_deck].qrecord_id,t,!0)}var a=e.target.value.toLowerCase(),d=deckdata[textentry_i_deck].i_card,c=deckdata[textentry_i_deck].c
15ards[d],r=c.all_choices[0];if(-1!=lc_textentry_matches[textentry_i_deck].indexOf(r)&&$("#textentry_hint-qdeck"+textentry_i_deck).attr("disabled",!0).addClass("qwiz_button_disabled"),-1!=lc_textentry_matches[textentry_i_deck].indexOf(a)){var i=q.qwizard_b&&deckdata[i_deck].hide_flip_b?"Flip (click disabled)":"Check answer";$(button_flip_selector(textentry_i_deck)).removeAttr("disabled").removeClass("qwiz_button_disabled").html(T(i)),c.check_answer=T(i),deckdata[textentry_i_deck].check_answer_disabled_b=!1}else c.check_answer=c.save_check_answer,$(button_flip_selector(textentry_i_deck)).addClass("qwiz_button_disabled").html(c.check_answer),deckdata[textentry_i_deck].check_answer_disabled_b=!0}function get_attr(e,t,a){var d=qqc.get_attr(e,t,a);return a&&!d&&(d=qqc.get_attr(e,t+"s")),d}function T(e){return qqc.T(e)}function plural(e,t,a){return qqc.plural(e,t,a)}this.item_selected=function(e){$(button_flip_selector(textentry_i_deck)).removeAttr("disabled").removeClass("qwiz_button_disabled").html(T("Check answer")),deckdata[textentry_i_deck].check_answer_disabled_b=!1;var t=deckdata[textentry_i_deck].i_card,a=deckdata[textentry_i_deck].cards[t];e&&(a.saved_textentry=e.target.value),a.saved_textentry_ok=!0},this.keep_next_button_active=function(){next_button_active_b=!0,$("button.got_it").attr("disabled",!1).removeClass("qwiz_button_disabled");for(var e=0;e<n_decks;e++)deckdata[e].hide_gotit_b&&$("button.next_card-qdeck"+e).attr("disabled",!1).removeClass("qwiz_button_disabled")},this.get_deckdata=function(e,t){return deckdata[e][t]},this.set_deckdata=function(i_deck,variable,value){if(-1==i_deck){var s=variable+" = "+value;eval(s)}else deckdata[i_deck][variable]=value},this.set_carddata=function(e,t,a,d,c){debug[0]&&console.log("[set_carddata] i_card:",t,", variable:",a,", value:",d),void 0===c?deckdata[e].cards[t][a]=d:deckdata[e].cards[t][a][c]=d}};qcardf.call(qcard_), 16/*! flip - v1.1.2 - 2016-10-20 17* github.com/nnattawat/flip 18* Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */ 19function(e){var t=function(t,a,d){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=e.extend(this.setting,a),"string"!=typeof a.axis||"x"!==a.axis.toLowerCase()&&"y"!==a.axis.toLowerCase()||(this.setting.axis=a.axis.toLowerCase()),"boolean"==typeof a.reverse&&(this.setting.reverse=a.reverse),"string"==typeof a.trigger&&(this.setting.trigger=a.trigger.toLowerCase());var c=parseInt(a.speed);isNaN(c)||(this.setting.speed=c),"boolean"==typeof a.forceHeight&&(this.setting.forceHeight=a.forceHeight),"boolean"==typeof a.forceWidth&&(this.setting.forceWidth=a.forceWidth),"boolean"==typeof a.autoSize&&(this.setting.autoSize=a.autoSize),("string"==typeof a.front||a.front instanceof e)&&(this.setting.front=a.front),("string"==typeof a.back||a.back instanceof e)&&(this.setting.back=a.back),this.element=t,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(d)};e.extend(t.prototype,{flipDone:function(e){var t=this;t.element.one(function(){var e,t=document.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in a)if(void 0!==t.style[e])return a[e]}(),(function(){t.element.trigger("flip:done"),"function"==typeof e&&e.call(t.element)}))},flip:function(e){if(!this.isFlipped){this.isFlipped=!0;var t="rotate"+this.setting.axis;this.frontElement.css({transform:t+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:t+"(0deg)","z-index":"1"}),this.flipDone(e)}},unflip:function(e){if(this.isFlipped){this.isFlipped=!1;var t="rotate"+this.setting.axis;this.frontElement.css({transform:t+"(0deg)","z-index":"1"}),this.backElement.css({transform:t+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.flipDone(e)}},getFrontElement:function(){return this.setting.front instanceof e?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof e?this.setting.back:this.element.find(this.setting.back)},init:function(e){var t=this,a=t.frontElement.add(t.backElement),d="rotate"+t.setting.axis,c=2*t.element["outer"+("rotatex"===d?"Height":"Width")](),r={perspective:c=Math.max(c,800),position:"relative"},i={transform:d+"("+(t.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},n={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};t.setting.forceHeight?a.outerHeight(t.element.height()):t.setting.autoSize&&(n.height="100%"),t.setting.forceWidth?a.outerWidth(t.element.width()):t.setting.autoSize&&(n.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(r["-webkit-transform-style"]="preserve-3d"),a.css(n).find("*").not("tbody").css({"backface-visibility":"hidden"}),t.element.css(r),t.backElement.css(i),setTimeout((function(){var d=t.setting.speed/1e3||.5;a.css({transition:"all "+d+"s ease-out"}),"function"==typeof e&&e.call(t.element)}),20),t.attachEvents()},clickHandler:function(t){t||(t=window.event),this.element.find(e(t.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var t=this;t.element.off("mouseleave.flip"),t.flip(),setTimeout((function(){t.element.on("mouseleave.flip",e.proxy(t.unflip,t)),t.element.is(":hover")||t.unflip()}),t.setting.speed+150)},attachEvents:function(){var t=this;"click"===t.setting.trigger?t.element.on(e.fn.tap?"tap.flip":"click.flip",e.proxy(t.clickHandler,t)):"hover"===t.setting.trigger&&(t.element.on("mouseenter.flip",e.proxy(t.hoverHandler,t)),t.element.on("mouseleave.flip",e.proxy(t.unflip,t)))},flipChanged:function(e){this.element.trigger("flip:change"),"function"==typeof e&&e.call(this.element)},changeSettings:function(e,t){var a=this,d=!1;if(void 0!==e.axis&&a.setting.axis!==e.axis.toLowerCase()&&(a.setting.axis=e.axis.toLowerCase(),d=!0),void 0!==e.reverse&&a.setting.reverse!==e.reverse&&(a.setting.reverse=e.reverse,d=!0),d){var c=a.frontElement.add(a.backElement),r=c.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);c.css({transition:"none"});var i="rotate"+a.setting.axis;a.isFlipped?a.frontElement.css({transform:i+(a.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):a.backElement.css({transform:i+(a.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout((function(){c.css(r),a.flipChanged(t)}),0)}else a.flipChanged(t)}}),e.fn.flip=function(a,d){return"function"==typeof a&&(d=a),"string"==typeof a||"boolean"==typeof a?this.each((function(){var t=e(this).data("flip-model");"toggle"===a&&(a=!t.isFlipped),a?t.flip(d):t.unflip(d)})):this.each((function(){if(e(this).data("flip-model")){var c=e(this).data("flip-model");!a||void 0===a.axis&&void 0===a.reverse||c.changeSettings(a,d)}else e(this).data("flip-model",new t(e(this),a||{},d))})),this}}(jQuery); 20; 21/** 22 * Featherlight - ultra slim jQuery lightbox 23 * Version 1.7.8 - http://noelboss.github.io/featherlight/ 24 * 25 * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com) 26 * MIT Licensed. 27**/ 28(function($) { 29 "use strict"; 30 31 if('undefined' === typeof $) { 32 if('console' in window){ window.console.info('Too much lightness, Featherlight needs jQuery.'); } 33 return; 34 } 35 36 /* Featherlight is exported as $.featherlight. 37 It is a function used to open a featherlight lightbox. 38 39 [tech] 40 Featherlight uses prototype inheritance. 41 Each opened lightbox will have a corresponding object. 42 That object may have some attributes that override the 43 prototype's. 44 Extensions created with Featherlight.extend will have their 45 own prototype that inherits from Featherlight's prototype, 46 thus attributes can be overriden either at the object level, 47 or at the extension level. 48 To create callbacks that chain themselves instead of overriding, 49 use chainCallbacks. 50 For those familiar with CoffeeScript, this correspond to 51 Featherlight being a class and the Gallery being a class 52 extending Featherlight. 53 The chainCallbacks is used since we don't have access to 54 CoffeeScript's `super`. 55 */ 56 57 function Featherlight($content, config) { 58 if(this instanceof Featherlight) { /* called with new */ 59 this.id = Featherlight.id++; 60 this.setup($content, config); 61 this.chainCallbacks(Featherlight._callbackChain); 62 } else { 63 var fl = new Featherlight($content, config); 64 fl.open(); 65 return fl; 66 } 67 } 68 69 var opened = [], 70 pruneOpened = function(remove) { 71 opened = $.grep(opened, function(fl) { 72 return fl !== remove && fl.$instance.closest('body').length > 0; 73 } ); 74 return opened; 75 }; 76 77 // Removes keys of `set` from `obj` and returns the removed key/values. 78 function slice(obj, set) { 79 var r = {}; 80 for (var key in obj) { 81 if (key in set) { 82 r[key] = obj[key]; 83 delete obj[key]; 84 } 85 } 86 return r; 87 } 88 89 // NOTE: List of available [iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe). 90 var iFrameAttributeSet = { 91 allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1, 92 name: 1, referrerpolicy: 1, scrolling: 1, sandbox: 1, src: 1, srcdoc: 1, width: 1 93 }; 94 95 // Converts camelCased attributes to dasherized versions for given prefix:
96 // parseAttrs({hello: 1, hellFrozeOver: 2}, 'hell') => {froze-over: 2} 97 function parseAttrs(obj, prefix) { 98 var attrs = {}, 99 regex = new RegExp('^' + prefix + '([A-Z])(.*)'); 100 for (var key in obj) { 101 var match = key.match(regex); 102 if (match) { 103 var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase(); 104 attrs[dasherized] = obj[key]; 105 } 106 } 107 return attrs; 108 } 109 110 /* document wide key handler */ 111 var eventMap = { keyup: 'onKeyUp', resize: 'onResize' }; 112 113 var globalEventHandler = function(event) { 114 $.each(Featherlight.opened().reverse(), function() { 115 if (!event.isDefaultPrevented()) { 116 if (false === this[eventMap[event.type]](event)) { 117 event.preventDefault(); event.stopPropagation(); return false; 118 } 119 } 120 }); 121 }; 122 123 var toggleGlobalEvents = function(set) { 124 if(set !== Featherlight._globalHandlerInstalled) { 125 Featherlight._globalHandlerInstalled = set; 126 var events = $.map(eventMap, function(_, name) { return name+'.'+Featherlight.prototype.namespace; } ).join(' '); 127 $(window)[set ? 'on' : 'off'](events, globalEventHandler); 128 } 129 }; 130 131 var globalNoClose_b = true; 132 var globalOpenTimeout; 133 Featherlight.prototype = { 134 constructor: Featherlight, 135 /*** defaults ***/ 136 /* extend featherlight with defaults and methods */ 137 namespace: 'featherlight', /* Name of the events and css class prefix */ 138 targetAttr: 'data-featherlight', /* Attribute of the triggered element that contains the selector to the lightbox content */ 139 variant: null, /* Class that will be added to change look of the lightbox */ 140 resetCss: false, /* Reset all css */ 141 background: null, /* Custom DOM for the background, wrapper and the closebutton */ 142 openTrigger: 'click', /* Event that triggers the lightbox */ 143 closeTrigger: 'click', /* Event that triggers the closing of the lightbox */ 144 filter: null, /* Selector to filter events. Think $(...).on('click', filter, eventHandler) */ 145 root: 'body', /* Where to append featherlights */ 146 openSpeed: 250, /* Duration of opening animation */ 147 closeSpeed: 250, /* Duration of closing animation */ 148 closeOnClick: 'background', /* Close lightbox on click ('background', 'anywhere' or false) */ 149 closeOnEsc: true, /* Close lightbox when pressing esc */ 150 closeIcon: '✕', /* Close icon */ 151 loading: '', /* Content to show while initial content is loading */ 152 persist: false, /* If set, the content will persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */ 153 otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */ 154 beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */ 155 beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */ 156 beforeClose: $.noop, /* Called before close. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */ 157 afterOpen: $.noop, /* Called after open. Gets event as parameter, this contains all data */ 158 afterContent: $.noop, /* Called after content is ready and has been set. Gets event as parameter, this contains all data */ 159 afterClose: $.noop, /* Called after close. Gets event as parameter, this contains all data */ 160 onKeyUp: $.noop, /* Called on key up for the frontmost featherlight */ 161 onResize: $.noop, /* Called after new content and when a window is resized */ 162 type: null, /* Specify type of lightbox. If unset, it will check for the targetAttrs value. */ 163 contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], /* List of content filters to use to determine the content */ 164 165 /*** methods ***/ 166 /* setup iterates over a single instance of featherlight and prepares the background and binds the events */ 167 setup: function(target, config){ 168 /* all arguments are optional */ 169 if (typeof target === 'object' && target instanceof $ === false && !config) { 170 config = target; 171 target = undefined; 172 } 173 174 var self = $.extend(this, config, {target: target}), 175 css = !self.resetCss ? self.namespace : self.namespace+'-reset', /* by adding -reset to the classname, we reset all the default css */ 176 $background = $(self.background || [ 177 '<div class="'+css+'-loading '+css+'">', 178 '<div class="'+css+'-content">', 179 '<button class="'+css+'-close-icon '+ self.namespace + '-close" aria-label="Close">', 180 self.closeIcon, 181 '</button>', 182 '<div class="'+self.namespace+'-inner">' + self.loading + '</div>', 183 '</div>', 184 '</div>'].join('')), 185 closeButtonSelector = '.'+self.namespace+'-close' + (self.otherClose ? ',' + self.otherClose : ''); 186 187 self.$instance = $background.clone().addClass(self.variant); /* clone DOM for the background, wrapper and the close button */ 188 189 /* close when click on background/anywhere/null or closebox */ 190 self.$instance.on(self.closeTrigger+'.'+self.namespace, function(event) { 191 var $target = $(event.target); 192 if( ('background' === self.closeOnClick && $target.is('.'+self.namespace)) 193 || 'anywhere' === self.closeOnClick 194 || $target.closest(closeButtonSelector).length ){ 195 196 // DK: we're going to close on 197 // mousemove, but not within a while 198 // of open. 199 if (! globalNoClose_b) { 200 self.close(event); 201 event.preventDefault(); 202 } 203 } 204 }); 205 206 return this; 207 }, 208
209 /* this method prepares the content and converts it into a jQuery object or a promise */ 210 getContent: function(){ 211 if(this.persist !== false && this.$content) { 212 return this.$content; 213 } 214 var self = this, 215 filters = this.constructor.contentFilters, 216 readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); }, 217 targetValue = readTargetAttr(self.targetAttr), 218 data = self.target || targetValue || ''; 219 220 /* Find which filter applies */ 221 var filter = filters[self.type]; /* check explicit type like {type: 'image'} */ 222 223 /* check explicit type like data-featherlight="image" */ 224 if(!filter && data in filters) { 225 filter = filters[data]; 226 data = self.target && targetValue; 227 } 228 data = data || readTargetAttr('href') || ''; 229 230 /* check explicity type & content like {image: 'photo.jpg'} */ 231 if(!filter) { 232 for(var filterName in filters) { 233 if(self[filterName]) { 234 filter = filters[filterName]; 235 data = self[filterName]; 236 } 237 } 238 } 239 240 /* otherwise it's implicit, run checks */ 241 if(!filter) { 242 var target = data; 243 data = null; 244 $.each(self.contentFilters, function() { 245 filter = filters[this]; 246 if(filter.test) { 247 data = filter.test(target); 248 } 249 if(!data && filter.regex && target.match && target.match(filter.regex)) { 250 data = target; 251 } 252 return !data; 253 }); 254 if(!data) { 255 if('console' in window){ window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"' : ' (no target specified)')); } 256 return false; 257 } 258 } 259 /* Process it */ 260 return filter.process.call(self, data); 261 }, 262 263 /* sets the content of $instance to $content */ 264 setContent: function($content){ 265 var self = this; 266 /* we need a special class for the iframe */ 267 if($content.is('iframe')) { 268 self.$instance.addClass(self.namespace+'-iframe'); 269 } 270 271 self.$instance.removeClass(self.namespace+'-loading'); 272 273 /* replace content by appending to existing one before it is removed 274 this insures that featherlight-inner remain at the same relative 275 position to any other items added to featherlight-content */ 276 self.$instance.find('.'+self.namespace+'-inner') 277 .not($content) /* excluded new content, important if persisted */ 278 .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */ 279 .replaceWith($.contains(self.$instance[0], $content[0]) ? '' : $content); 280 281 self.$content = $content.addClass(self.namespace+'-inner'); 282 283 return self; 284 }, 285 286 /* opens the lightbox. "this" contains $instance with the lightbox, and with the config. 287 Returns a promise that is resolved after is successfully opened. */ 288 open: function(event){ 289 var self = this; 290 self.$instance.hide().appendTo(self.root); 291 if((!event || !event.isDefaultPrevented()) 292 && self.beforeOpen(event) !== false) { 293 294 if(event){ 295 event.preventDefault(); 296 } 297 var $content = self.getContent(); 298 299 if($content) { 300 opened.push(self); 301 302 toggleGlobalEvents(true); 303 304 self.$instance.fadeIn(self.openSpeed); 305 self.beforeContent(event); 306 307 /* Set content and show */ 308 return $.when($content) 309 .always(function($content){ 310 self.setContent($content); 311 self.afterContent(event); 312 }) 313 .then(self.$instance.promise()) 314 /* Call afterOpen after fadeIn is done */ 315 .done(function(){ self.afterOpen(event); }); 316 } 317 } 318 self.$instance.detach(); 319 return $.Deferred().reject().promise(); 320 }, 321 322 /* closes the lightbox. "this" contains $instance with the lightbox, and with the config 323 returns a promise, resolved after the lightbox is successfully closed. */ 324 close: function(event){ 325 var self = this, 326 deferred = $.Deferred(); 327 328 if(self.beforeClose(event) === false) { 329 deferred.reject(); 330 } else { 331 332 if (0 === pruneOpened(self).length) { 333 toggleGlobalEvents(false); 334 } 335 336 self.$instance.fadeOut(self.closeSpeed,function(){ 337 self.$instance.detach(); 338 self.afterClose(event); 339 deferred.resolve(); 340 }); 341 } 342 return deferred.promise(); 343 }, 344 345 /* resizes the content so it fits in visible area and keeps the same aspect ratio. 346 Does nothing if either the width or the height is not specified. 347 Called automatically on window resize. 348 Override if you want different behavior. */ 349 resize: function(w, h) { 350 if (w && h) { 351 /* Reset apparent image size first so container grows */ 352 this.$content.css('width', '').css('height', ''); 353 /* Calculate the worst ratio so that dimensions fit */ 354 /* Note: -1 to avoid rounding errors */ 355 var ratio = Math.max( 356 w / (this.$content.parent().width()-1), 357 h / (this.$content.parent().height()-1)); 358 /* Resize content */ 359 if (ratio > 1) { 360 ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */ 361 this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px'); 362 } 363 } 364 }, 365 366 /* Utility function to chain callbacks 367 [Warning: guru-level] 368 Used be extensions that want to let users specify callbacks but 369 also need themselves to use the callbacks. 370 The argument 'chain' has callback names as keys and function(super, event) 371 as values. That function is meant to call `super` at some point. 372 */
373 chainCallbacks: function(chain) { 374 for (var name in chain) { 375 this[name] = $.proxy(chain[name], this, $.proxy(this[name], this)); 376 } 377 } 378 }; 379 380 $.extend(Featherlight, { 381 id: 0, /* Used to id single featherlight instances */ 382 autoBind: '[data-featherlight]', /* Will automatically bind elements matching this selector. Clear or set before onReady */ 383 defaults: Featherlight.prototype, /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */ 384 /* Contains the logic to determine content */ 385 contentFilters: { 386 jquery: { 387 regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */ 388 test: function(elem) { return elem instanceof $ && elem; }, 389 process: function(elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); } 390 }, 391 image: { 392 regex: /\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i, 393 process: function(url) { 394 var self = this, 395 deferred = $.Deferred(), 396 img = new Image(), 397 $img = $('<img src="'+url+'" alt="Could not load full-size image" class="'+self.namespace+'-image" />'); 398 img.onload = function() { 399 /* Store naturalWidth & height for IE8 */ 400 $img.naturalWidth = img.width; $img.naturalHeight = img.height; 401 deferred.resolve( $img ); 402 }; 403 img.onerror = function() { deferred.reject($img); }; 404 img.src = url; 405 return deferred.promise(); 406 } 407 }, 408 html: { 409 regex: /^\s*<[\w!][^<]*>/, /* Anything that starts with some kind of valid tag */ 410 process: function(html) { return $(html); } 411 }, 412 ajax: { 413 regex: /./, /* At this point, any content is assumed to be an URL */ 414 process: function(url) { 415 var self = this, 416 deferred = $.Deferred(); 417 /* we are using load so one can specify a target with: url.html #targetelement */
418 var $container = $('<div></div>').load(url, function(response, status){ 419 if ( status !== "error" ) { 420 deferred.resolve($container.contents()); 421 } 422 deferred.fail(); 423 }); 424 return deferred.promise(); 425 } 426 }, 427 iframe: { 428 process: function(url) { 429 var deferred = new $.Deferred(); 430 var $content = $('<iframe/>'); 431 var css = parseAttrs(this, 'iframe'); 432 var attrs = slice(css, iFrameAttributeSet); 433 $content.hide() 434 .attr('src', url) 435 .attr(attrs) 436 .css(css) 437 .on('load', function() { deferred.resolve($content.show()); }) 438 // We can't move an <iframe> and avoid reloading it, 439 // so let's put it in place ourselves right now: 440 .appendTo(this.$instance.find('.' + this.namespace + '-content')); 441 return deferred.promise(); 442 } 443 }, 444 text: { 445 process: function(text) { return $('<div>', {text: text}); } 446 } 447 }, 448 449 functionAttributes: ['beforeOpen', 'afterOpen', 'beforeContent', 'afterContent', 'beforeClose', 'afterClose'], 450 451 /*** class methods ***/ 452 /* read element's attributes starting with data-featherlight- */ 453 readElementConfig: function(element, namespace) { 454 var Klass = this, 455 regexp = new RegExp('^data-' + namespace + '-(.*)'), 456 config = {}; 457 if (element && element.attributes) { 458 $.each(element.attributes, function(){ 459 var match = this.name.match(regexp); 460 if (match) { 461 var val = this.value, 462 name = $.camelCase(match[1]); 463 if ($.inArray(name, Klass.functionAttributes) >= 0) { /* jshint -W054 */ 464 val = new Function(val); /* jshint +W054 */ 465 } else { 466 try { val = JSON.parse(val); } 467 catch(e) {} 468 } 469 config[name] = val; 470 } 471 }); 472 } 473 return config; 474 }, 475 476 /* Used to create a Featherlight extension 477 [Warning: guru-level] 478 Creates the extension's prototype that in turn 479 inherits Featherlight's prototype. 480 Could be used to extend an extension too... 481 This is pretty high level wizardy, it comes pretty much straight 482 from CoffeeScript and won't teach you anything about Featherlight 483 as it's not really specific to this library. 484 My suggestion: move along and keep your sanity. 485 */ 486 extend: function(child, defaults) { 487 /* Setup class hierarchy, adapted from CoffeeScript */ 488 var Ctor = function(){ this.constructor = child; }; 489 Ctor.prototype = this.prototype; 490 child.prototype = new Ctor(); 491 child.__super__ = this.prototype; 492 /* Copy class methods & attributes */ 493 $.extend(child, this, defaults); 494 child.defaults = child.prototype; 495 return child; 496 }, 497 498 attach: function($source, $content, config) { 499 var Klass = this; 500 if (typeof $content === 'object' && $content instanceof $ === false && !config) { 501 config = $content; 502 $content = undefined; 503 } 504 /* make a copy */ 505 config = $.extend({}, config); 506 507 /* Only for openTrigger and namespace... */ 508 var namespace = config.namespace || Klass.defaults.namespace, 509 tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config), 510 sharedPersist; 511 var handler = function(event) { 512 var $target = $(event.currentTarget); 513 /* ... since we might as well compute the config on the actual target */ 514 var elemConfig = $.extend( 515 {$source: $source, $currentTarget: $target}, 516 Klass.readElementConfig($source[0], tempConfig.namespace), 517 Klass.readElementConfig(event.currentTarget, tempConfig.namespace), 518 config); 519 var fl = sharedPersist || $target.data('featherlight-persisted') || new Klass($content, elemConfig); 520 if(fl.persist === 'shared') { 521 sharedPersist = fl; 522 } else if(fl.persist !== false) { 523 $target.data('featherlight-persisted', fl); 524 } 525 if (elemConfig.$currentTarget.blur) { 526 elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again 527 } 528 529 // DK: Don't do open just yet, in case immediate 530 // mouseleave. 531 globalOpenTimeout = setTimeout (function () { 532 fl.open(event); 533 }, 250); 534 535 // DK: set flag and start timer - no close for 536 // a while. 537 globalNoClose_b = true; 538 setTimeout (function () { 539 globalNoClose_b = false;
540 }, 500); 541 }; 542 543 $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, handler); 544 545 // DK: if immediate mouseleave (before open timeOut 546 // finishes), cancel. 547 $source.on('mouseleave', function () { 548 clearTimeout (globalOpenTimeout); 549 }); 550 551 return handler; 552 }, 553 554 current: function() { 555 var all = this.opened(); 556 return all[all.length - 1] || null; 557 }, 558 559 opened: function() { 560 var klass = this; 561 pruneOpened(); 562 return $.grep(opened, function(fl) { return fl instanceof klass; } ); 563 }, 564 565 close: function(event) { 566 var cur = this.current(); 567 if(cur) { return cur.close(event); } 568 }, 569 570 /* Does the auto binding on startup. 571 Meant only to be used by Featherlight and its extensions 572 */ 573 _onReady: function() { 574 var Klass = this; 575 if(Klass.autoBind){ 576 /* Bind existing elements */ 577 $(Klass.autoBind).each(function(){ 578 Klass.attach($(this)); 579 }); 580 /* If a click propagates to the document level, then we have an item that was added later on */ 581 $(document).on('click', Klass.autoBind, function(evt) { 582 if (evt.isDefaultPrevented()) { 583 return; 584 } 585 /* Bind featherlight */ 586 var handler = Klass.attach($(evt.currentTarget)); 587 /* Dispatch event directly */ 588 handler(evt); 589 }); 590 } 591 }, 592 593 /* Featherlight uses the onKeyUp callback to intercept the escape key. 594 Private to Featherlight. 595 */ 596 _callbackChain: { 597 onKeyUp: function(_super, event){ 598 if(27 === event.keyCode) { 599 if (this.closeOnEsc) { 600 $.featherlight.close(event); 601 } 602 return false; 603 } else { 604 return _super(event); 605 } 606 }, 607 608 beforeOpen: function(_super, event) { 609 // Used to disable scrolling 610 $(document.documentElement).addClass('with-featherlight'); 611 612 // Remember focus: 613 this._previouslyActive = document.activeElement; 614 615 // Disable tabbing: 616 // See http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus 617 this._$previouslyTabbable = $("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]") 618 .not('[tabindex]') 619 .not(this.$instance.find('button')); 620 621 this._$previouslyWithTabIndex = $('[tabindex]').not('[tabindex="-1"]'); 622 this._previousWithTabIndices = this._$previouslyWithTabIndex.map(function(_i, elem) { 623 return $(elem).attr('tabindex'); 624 }); 625 626 this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr('tabindex', -1); 627 628 if (document.activeElement.blur) { 629 document.activeElement.blur(); 630 } 631 return _super(event); 632 }, 633 634 afterClose: function(_super, event) { 635 var r = _super(event); 636 // Restore focus 637 var self = this; 638 this._$previouslyTabbable.removeAttr('tabindex'); 639 this._$previouslyWithTabIndex.each(function(i, elem) { 640 $(elem).attr('tabindex', self._previousWithTabIndices[i]); 641 }); 642 this._previouslyActive.focus(); 643 // Restore scroll 644 if(Featherlight.opened().length === 0) { 645 $(document.documentElement).removeClass('with-featherlight'); 646 } 647 return r; 648 }, 649 650 onResize: function(_super, event){ 651 this.resize(this.$content.naturalWidth, this.$content.naturalHeight); 652 return _super(event); 653 }, 654 655 afterContent: function(_super, event){ 656 var r = _super(event); 657 this.$instance.find('[autofocus]:not([disabled])').focus(); 658 this.onResize(event); 659 return r; 660 } 661 } 662 }); 663 664 $.featherlight = Featherlight; 665 666 /* bind jQuery elements to trigger featherlight */ 667 $.fn.featherlight = function($content, config) { 668 Featherlight.attach(this, $content, config); 669 return this; 670 }; 671 672 /* bind featherlight on ready if config autoBind is set */ 673 $(document).ready(function(){ Featherlight._onReady(); }); 674}(jQuery)); 675; 676 (function( $ ) { 677 $.widget( "custom.combobox", { 678 _create: function() { 679 this.wrapper = $( "<span>" ) 680 .addClass( "custom-combobox" ) 681 .insertAfter( this.element ); 682 this.element.hide(); 683 this._createAutocomplete(); 684 this._createShowAllButton(); 685 }, 686 _createAutocomplete: function() { 687 var selected = this.element.children( ":selected" ), 688 value = selected.val() ? selected.text() : ""; 689 this.input = $( "<input>" ) 690 .appendTo( this.wrapper ) 691 .val( value ) 692 .attr( "title", "" ) 693 .addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" ) 694 .autocomplete({ 695 delay: 0, 696 minLength: 0, 697 source: $.proxy( this, "_source" ), 698 select: function (event, ui) { 699 qwiz_combobox_callback (ui.item.label, 'class_by_name', this); 700 } 701 }) 702 /* 703 .tooltip({ 704 tooltipClass: "ui-state-highlight" 705 }); 706 */ 707 this._on( this.input, { 708 autocompleteselect: function( event, ui ) { 709 ui.item.option.selected = true; 710 this._trigger( "select", event, { 711 item: ui.item.option 712 }); 713 }, 714 autocompletechange: "_removeIfInvalid" 715 }); 716 }, 717 _createShowAllButton: function() { 718 var input = this.input, 719 wasOpen = false;
720 $( "<a>" ) 721 .attr( "tabIndex", -1 ) 722 .attr( "title", "Show all items" ) 723 .appendTo( this.wrapper ) 724 .button({ 725 icons: { 726 primary: "ui-icon-triangle-1-s" 727 }, 728 text: false 729 }) 730 .removeClass( "ui-corner-all" ) 731 .addClass( "custom-combobox-toggle ui-corner-right" ) 732 .mousedown(function() { 733 wasOpen = input.autocomplete( "widget" ).is( ":visible" ); 734 }) 735 .click(function() { 736 input.focus(); 737 if ( wasOpen ) { 738 return; 739 } 740 input.autocomplete( "search", "" ); 741 }); 742 }, 743 _source: function( request, response ) { 744 var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); 745 response( this.element.children( "option" ).map(function() { 746 var text = $( this ).text(); 747 if ( this.value && ( !request.term || matcher.test(text) ) ) 748 return { 749 label: text, 750 value: text, 751 option: this 752 }; 753 }) ); 754 }, 755 _removeIfInvalid: function( event, ui ) { 756 if ( ui.item ) { 757 return; 758 } 759 var value = this.input.val(), 760 valueLowerCase = value.toLowerCase(), 761 valid = false; 762 this.element.children( "option" ).each(function() { 763 if ( $( this ).text().toLowerCase() === valueLowerCase ) { 764 this.selected = valid = true; 765 return false; 766 } 767 }); 768 if ( valid ) { 769 return; 770 } 771 /* 772 this.input 773 .val( "" ) 774 .attr( "title", value + " didn't match any item" ) 775 .tooltip( "open" ); 776 this._delay(function() { 777 this.input.tooltip( "close" ).attr( "title", "" ); 778 }, 2500 ); 779 */ 780 this.element.val( "" ); 781 this.input.autocomplete( "instance" ).term = ""; 782 }, 783 _destroy: function() { 784 this.wrapper.remove(); 785 this.element.show(); 786 } 787 }); 788 })( jQuery ); 789 /* 790 $(function() { 791 $( "#combobox" ).combobox(); 792 $( "#toggle" ).click(function() { 793 $( "#combobox" ).toggle(); 794 }); 795 }); 796 */ 797; 798/*! Select2 4.0.6-rc.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];
798return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.a
798pply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k<c.children.length;k++){var l=c.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}
798),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(!(c<=0)){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","fal
798se"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),window.setTimeout(function(){d.$selection.focus()},0),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.attr("title",e.title||e.text),c.StoreData(f[0],"data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}
798),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h<e.length;h++)if(g={data:e[h]},this.trigger("unselect",g),g.prevented)return void this.$element.val(f);this.$element.trigger("change"),this.trigger("toggle",{})}}},d.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},d.prototype.update=function(b,d){if(b.call(this,d),!(this.$selection.find(".select2-selection__placeholder").length>0||0===d.length)){var e=a('<span class="select2-selection__clear">×</span>');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;if(this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c){this.$element.find("[data-select2-tag]").length?this.$element.focus():this.$search.focus()}},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({}
798,b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â¶":"A","A":"A","Ã":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä":"A","Ä":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ã":"A","Ç":"A","Ả":"A","Ã
":"A","Ǻ":"A","Ç":"A","È":"A","È":"A","Ạ":"A","Ậ":"A","Ặ":"A","á¸":"A","Ä":"A","Ⱥ":"A","Ɐ":"A","ê²":"AA","Ã":"AE","Ǽ":"AE","Ç¢":"AE","ê´":"AO","ê¶":"AU","ê¸":"AV","êº":"AV","ê¼":"AY","â·":"B","ï¼¢":"B","á¸":"B","á¸":"B","á¸":"B","É":"B","Æ":"B","Æ":"B","â¸":"C","ï¼£":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ã":"C","á¸":"C","Æ":"C","È»":"C","ê¾":"C","â¹":"D","D":"D","á¸":"D","Ä":"D","á¸":"D","á¸":"D","á¸":"D","á¸":"D","Ä":"D","Æ":"D","Æ":"D","Æ":"D","ê¹":"D","DZ":"DZ","Ç":"DZ","Dz":"Dz","Ç
":"Dz","âº":"E","ï¼¥":"E","Ã":"E","Ã":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","Ẽ":"E","Ä":"E","á¸":"E","á¸":"E","Ä":"E","Ä":"E","Ã":"E","Ẻ":"E","Ä":"E","È":"E","È":"E","Ẹ":"E","á»":"E","Ȩ":"E","á¸":"E","Ä":"E","á¸":"E","á¸":"E","Æ":"E","Æ":"E","â»":"F","F":"F","á¸":"F","Æ":"F","ê»":"F","â¼":"G","ï¼§":"G","Ç´":"G","Ä":"G","Ḡ":"G","Ä":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ":"G","ê ":"G","ê½":"G","ê¾":"G","â½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","È":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","ê":"H","â¾":"I","I":"I","Ã":"I","Ã":"I","Ã":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","á»":"I","Ç":"I","È":"I","È":"I","á»":"I","Ä®":"I","Ḭ":"I","Æ":"I","â¿":"J","J":"J","Ä´":"J","É":"J","â":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Æ":"K","Ⱪ":"K","ê":"K","ê":"K","ê":"K","ê¢":"K","â":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","ê":"L","ê":"L","ê":"L","Ç":"LJ","Ç":"Lj","â":"M","ï¼":"M","Ḿ":"M","á¹":"M","á¹":"M","â±®":"M","Æ":"M","â":"N","ï¼®":"N","Ǹ":"N","Å":"N","Ã":"N","á¹":"N","Å":"N","á¹":"N","Å
":"N","á¹":"N","á¹":"N","È ":"N","Æ":"N","ê":"N","ê¤":"N","Ç":"NJ","Ç":"Nj","â":"O","O":"O","Ã":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","Ã":"O","á¹":"O","Ȭ":"O","á¹":"O","Å":"O","á¹":"O","á¹":"O","Å":"O","È®":"O","Ȱ":"O","Ã":"O","Ȫ":"O","á»":"O","Å":"O","Ç":"O","È":"O","È":"O","Æ ":"O","á»":"O","á»":"O","á» ":"O","á»":"O","Ợ":"O","á»":"O","á»":"O","Ǫ":"O","Ǭ":"O","Ã":"O","Ǿ":"O","Æ":"O","Æ":"O","ê":"O","ê":"O","Æ¢":"OI","ê":"OO","È¢":"OU","â
":"P","ï¼°":"P","á¹":"P","á¹":"P","Ƥ":"P","â±£":"P","ê":"P","ê":"P","ê":"P","â":"Q","ï¼±":"Q","ê":"Q","ê":"Q","É":"Q","â":"R","ï¼²":"R","Å":"R","á¹":"R","Å":"R","È":"R","È":"R","á¹":"R","á¹":"R","Å":"R","á¹":"R","É":"R","Ɽ":"R","ê":"R","ê¦":"R","ê":"R","â":"S","ï¼³":"S","áº":"S","Å":"S","Ṥ":"S","Å":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","È":"S","Å":"S","â±¾":"S","ê¨":"S","ê":"S","â":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","È":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","ê":"T","ê¨":"TZ","â":"U","ï¼µ":"U","Ã":"U","Ã":"U","Ã":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ã":"U","Ç":"U","Ç":"U","Ç":"U","Ç":"U","Ủ":"U","Å®":"U","Ű":"U","Ç":"U","È":"U","È":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É":"U","â":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","ê":"V","É
":"V","ê ":"VY","â":"W","ï¼·":"W","áº":"W","áº":"W","Å´":"W","áº":"W","áº":"W","áº":"W","â±²":"W","â":"X","X":"X","áº":"X","áº":"X","â":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","áº":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","É":"Y","Ỿ":"Y","â":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","áº":"Z","áº":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â":"a","ï½":"a","áº":"a","à ":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","Ä":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","Ç":"a","ả":"a","Ã¥":"a","Ç»":"a","Ç":"a","È":"a","È":"a","ạ":"a","áº":"a","ặ":"a","á¸":"a","Ä
":"a","â±¥":"a","É":"a","ê³":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","êµ":"ao","ê·":"au","ê¹":"av","ê»":"av","ê½":"ay","â":"b","ï½":"b","á¸":"b","á¸
":"b","á¸":"b","Æ":"b","Æ":"b","É":"b","â":"c","ï½":"c","Ä":"
798c","Ä":"c","Ä":"c","Ä":"c","ç":"c","á¸":"c","Æ":"c","ȼ":"c","ê¿":"c","â":"c","â":"d","ï½":"d","á¸":"d","Ä":"d","á¸":"d","á¸":"d","á¸":"d","á¸":"d","Ä":"d","Æ":"d","É":"d","É":"d","êº":"d","dz":"dz","Ç":"dz","â":"e","ï½
":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»
":"e","á»":"e","ẽ":"e","Ä":"e","á¸":"e","á¸":"e","Ä":"e","Ä":"e","ë":"e","ẻ":"e","Ä":"e","È
":"e","È":"e","ẹ":"e","á»":"e","È©":"e","á¸":"e","Ä":"e","á¸":"e","á¸":"e","É":"e","É":"e","Ç":"e","â":"f","ï½":"f","á¸":"f","Æ":"f","ê¼":"f","â":"g","ï½":"g","ǵ":"g","Ä":"g","ḡ":"g","Ä":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","ê¡":"g","áµ¹":"g","ê¿":"g","â":"h","ï½":"h","Ä¥":"h","ḣ":"h","ḧ":"h","È":"h","ḥ":"h","ḩ":"h","ḫ":"h","áº":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ":"hv","â":"i","ï½":"i","ì":"i","Ã":"i","î":"i","Ä©":"i","Ä«":"i","Ä":"i","ï":"i","ḯ":"i","á»":"i","Ç":"i","È":"i","È":"i","á»":"i","į":"i","á¸":"i","ɨ":"i","ı":"i","â":"j","ï½":"j","ĵ":"j","ǰ":"j","É":"j","â":"k","ï½":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ":"k","ⱪ":"k","ê":"k","ê":"k","ê
":"k","ê£":"k","â":"l","ï½":"l","Å":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å":"l","Æ":"l","É«":"l","ⱡ":"l","ê":"l","ê":"l","ê":"l","Ç":"lj","â":"m","ï½":"m","ḿ":"m","á¹":"m","á¹":"m","ɱ":"m","ɯ":"m","â":"n","ï½":"n","ǹ":"n","Å":"n","ñ":"n","á¹
":"n","Å":"n","á¹":"n","Å":"n","á¹":"n","á¹":"n","Æ":"n","ɲ":"n","Å":"n","ê":"n","ê¥":"n","Ç":"nj","â":"o","ï½":"o","ò":"o","ó":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","õ":"o","á¹":"o","È":"o","á¹":"o","Å":"o","á¹":"o","á¹":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å":"o","Ç":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»":"o","ỡ":"o","á»":"o","ợ":"o","á»":"o","á»":"o","Ç«":"o","Ç":"o","ø":"o","Ç¿":"o","É":"o","ê":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","â":"p","ï½":"p","á¹":"p","á¹":"p","Æ¥":"p","áµ½":"p","ê":"p","ê":"p","ê":"p","â ":"q","ï½":"q","É":"q","ê":"q","ê":"q","â¡":"r","ï½":"r","Å":"r","á¹":"r","Å":"r","È":"r","È":"r","á¹":"r","á¹":"r","Å":"r","á¹":"r","É":"r","ɽ":"r","ê":"r","ê§":"r","ê":"r","â¢":"s","ï½":"s","Ã":"s","Å":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È":"s","Å":"s","È¿":"s","ê©":"s","ê
":"s","áº":"s","â£":"t","ï½":"t","ṫ":"t","áº":"t","Å¥":"t","á¹":"t","È":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ":"t","Ê":"t","ⱦ":"t","ê":"t","ê©":"tz","â¤":"u","ï½":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å":"u","ü":"u","Ç":"u","Ç":"u","Ç":"u","Ç":"u","á»§":"u","ů":"u","ű":"u","Ç":"u","È":"u","È":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","Ê":"u","â¥":"v","ï½":"v","á¹½":"v","ṿ":"v","Ê":"v","ê":"v","Ê":"v","ê¡":"vy","â¦":"w","ï½":"w","áº":"w","áº":"w","ŵ":"w","áº":"w","áº
":"w","áº":"w","áº":"w","â±³":"w","â§":"x","ï½":"x","áº":"x","áº":"x","â¨":"y","ï½":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","áº":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â©":"z","ï½":"z","ź":"z","áº":"z","ż":"z","ž":"z","áº":"z","áº":"z","ƶ":"z","È¥":"z","É":"z","ⱬ":"z","ê£":"z","Î":"Î","Î":"Î","Î":"Î","Î":"Î","Ϊ":"Î","Î":"Î","Î":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","Î":"ε","ή":"η","ί":"ι","Ï":"ι","Î":"ι","Ï":"ο","Ï":"Ï
","Ï":"Ï
","ΰ":"Ï
","Ï":"Ï","Ï":"Ï"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){b.RemoveData(this)})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var d;a.children?(d=document.createElement("optgroup"),d.label=a.text):(d=document.createElement("option"),void 0!==d.textContent?d.textContent=a.text:d.innerText=a.text),void 0!==a.id&&(d.value=a.id),a.disabled&&(d.disabled=!0),a.selected&&(
798d.selected=!0),a.title&&(d.title=a.title);var e=c(d),f=this._normalizeItem(a);return f.element=d,b.StoreData(d,"data",f),e},d.prototype.item=function(a){var d={};if(null!=(d=b.GetData(a[0],"data")))return d;if(a.is("option"))d={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){d={text:a.prop("label"),children:[],title:a.prop("title")};for(var e=a.children("option"),f=[],g=0;g<e.length;g++){var h=c(e[g]),i=this.item(h);f.push(i)}d.children=f}return d=this._normalizeItem(d),d.element=a[0],b.StoreData(a[0],"data",d),d},d.prototype._normalizeItem=function(a){a!==Object(a)&&(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);
798return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}
vendor: 20,302 bytes, line 798
798),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",["../utils"],function(a){function b(){}return b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},b.prototype._handleSelectOnClose=function(b,c){if(c&&null!=c.originalSelect2Event){var d=c.originalSelect2Event;if("select"===d._type||"unselect"===d._type)return}var e=this.getHighlightedResults();if(!(e.length<1)){var f=a.GetData(e[0],"data");null!=f.element&&f.element.selected||null==f.element&&f.selected||this.trigger("select",{data:f})}},b}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more resultsâ¦"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searchingâ¦"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")}
798,e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated
798in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery","../utils"],function(a,b){function c(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return c.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},c.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},c.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},c.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},c.prototype.addOptions=function(c,d){var e=a.map(d,function(a){return b.GetData(a[0],"data")});this._currentData.push.apply(this._currentData,e)},c}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1
798),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n<f)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});; 799!function(a){a.fn.simpleColor=function(b){function c(){b=a.simpleColorOptions;var c=a("<div class='simpleColorContainer' />");c.css("position","relative");var e=this.value&&""!=this.value?this.value:b.defaultColor,f=a("<div class='simpleColorDisplay' />");f.css(a.extend(b.displayCSS,{"background-color":e})),f.data("color",e),c.append(f),b.displayColorCode&&(f.data("displayColorCode",!0),f.text(this.value),f.css({color:b.colorCodeColor,textAlign:b.colorCodeAlign}));var g=function(c){if(a("html").bind("click.simpleColorDisplay",function(e){a("html").unbind("click.simpleColorDisplay"),a(".simpleColorChooser").hide();var g=a(e.target);(g.is(".simpleColorCell")===!1||a.contains(a(c.target).closest(".simpleColorContainer")[0],g[0])===!1)&&(f.css("background-color",f.data("color")),b.displayColorCode&&f.text(f.data("color"))),b.onClose&&b.onClose(d)}
799),c.data.container.chooser)c.data.container.chooser.toggle();else{var e=a("<div class='simpleColorChooser'/>");e.css(b.chooserCSS),c.data.container.chooser=e,c.data.container.append(e);for(var g=0;g<b.colors.length;g++){var h=a("<div class='simpleColorCell' id='"+b.colors[g]+"'/>");h.css({width:b.cellWidth+"px",height:b.cellHeight+"px",margin:b.cellMargin+"px",cursor:"pointer",lineHeight:b.cellHeight+"px",fontSize:"1px","float":"left","background-color":"#"+b.colors[g]}),e.append(h),(b.onCellEnter||b.livePreview)&&h.bind("mouseenter",function(){b.onCellEnter&&b.onCellEnter(this.id,d),b.livePreview&&(f.css("background-color","#"+this.id),b.displayColorCode&&f.text("#"+this.id))}),h.bind("click",{input:c.data.input,chooser:e,displayBox:f},function(c){var e="#"+this.id;c.data.input.value=e,a(c.data.input).change(),a(c.data.displayBox).data("color",e),c.data.displayBox.css("background-color",e),c.data.chooser.hide(),b.displayColorCode&&c.data.displayBox.text(e),b.onSelect&&b.onSelect(this.id,d)})}}},h={input:this,container:c,displayBox:f};f.bind("click",h,g),a(this).after(c),a(this).data("container",c)}var d=this,e=["990033","ff3366","cc0033","ff0033","ff9999","cc3366","ffccff","cc6699","993366","660033","cc3399","ff99cc","ff66cc","ff99ff","ff6699","cc0066","ff0066","ff3399","ff0099","ff33cc","ff00cc","ff66ff","ff33ff","ff00ff","cc0099","990066","cc66cc","cc33cc","cc99ff","cc66ff","cc33ff","993399","cc00cc","cc00ff","9900cc","990099","cc99cc","996699","663366","660099","9933cc","660066","9900ff","9933ff","9966cc","330033","663399","6633cc","6600cc","9966ff","330066","6600ff","6633ff","ccccff","9999ff","9999cc","6666cc","6666ff","666699","333366","333399","330099","3300cc","3300ff","3333ff","3333cc","0066ff","0033ff","3366ff","3366cc","000066","000033","0000ff","000099","0033cc","0000cc","336699","0066cc","99ccff","6699ff","003366","6699cc","006699","3399cc","0099cc","66ccff","3399ff","003399","0099ff","33ccff","00ccff","99ffff","66ffff","33ffff","00ffff","00cccc","009999","669999","99cccc","ccffff","33cccc","66cccc","339999","336666","006666","003333","00ffcc","33ffcc","33cc99","00cc99","66ffcc","99ffcc","00ff99","339966","006633","336633","669966","66cc66","99ff99","66ff66","339933","99cc99","66ff99","33ff99","33cc66","00cc66","66cc99","009966","009933","33ff66","00ff66","ccffcc","ccff99","99ff66","99ff33","00ff33","33ff33","00cc33","33cc33","66ff33","00ff00","66cc33","006600","003300","009900","33ff00","66ff00","99ff00","66cc00","00cc00","33cc00","339900","99cc66","669933","99cc33","336600","669900","99cc00","ccff66","ccff33","ccff00","999900","cccc00","cccc33","333300","666600","999933","cccc66","666633","999966","cccc99","ffffcc","ffff99","ffff66","ffff33","ffff00","ffcc00","ffcc66","ffcc33","cc9933","996600","cc9900","ff9900","cc6600","993300","cc6633","663300","ff9966","ff6633","ff9933","ff6600","cc3300","996633","330000","663333","996666","cc9999","993333","cc6666","ffcccc","ff3333","cc3333","ff6666","660000","990000","cc0000","ff0000","ff3300","cc9966","ffcc99","ffffff","cccccc","999999","666666","333333","000000","000000","000000","000000","000000","000000","000000","000000","000000"];return b=a.extend({defaultColor:this.attr("defaultColor")||"#FFF",cellWidth:this.attr("cellWidth")||10,cellHeight:this.attr("cellHeight")||10,cellMargin:this.attr("cellMargin")||1,boxWidth:this.attr("boxWidth")||"115px",boxHeight:this.attr("boxHeight")||"20px",columns:this.attr("columns")||16,insert:this.attr("insert")||"after",colors:this.attr("colors")||e,displayColorCode:this.attr("displayColorCode")||!1,colorCodeAlign:this.attr("colorCodeAlign")||"center",colorCodeColor:this.attr("colorCodeColor")||"#FFF",onSelect:null,onCellEnter:null,onClose:null,livePreview:!1},b||{}),b.totalWidth=b.columns*(b.cellWidth+2*b.cellMargin),b.chooserCSS=a.extend({border:"1px solid #000",margin:"0 0 0 5px",width:b.totalWidth,height:b.totalHeight,top:0,left:b.boxWidth,position:"absolute","background-color":"#fff"},b.chooserCSS||{}),b.displayCSS=a.extend({"background-color":b.defaultColor,border:"1px solid #000",width:b.boxWidth,height:b.boxHeight,"line-height":b.boxHeight+"px",cursor:"pointer"}
799,b.displayCSS||{}),this.hide(),-1!=navigator.userAgent.indexOf("MSIE")&&(b.totalWidth+=2),b.totalHeight=Math.ceil(b.colors.length/b.columns)*(b.cellHeight+2*b.cellMargin),a.simpleColorOptions=b,this.each(c),a(".simpleColorDisplay").each(function(){a(this).click(function(a){a.stopPropagation()})}),this},a.fn.closeChooser=function(){return this.each(function(){a(this).data("container").find(".simpleColorChooser").hide()}),this},a.fn.setColor=function(b){return this.each(function(){var c=a(this).data("container").find(".simpleColorDisplay");c.css("background-color",b).data("color",b),c.data("displayColorCode")===!0&&c.text(b)}),this}}(jQuery);; 800jQuery(document).ready(function(){var t=!1;void 0!==eztoc_smooth_local.JumpJsLinks&&1===parseInt(eztoc_smooth_local.JumpJsLinks)&&(t=!0),document.querySelectorAll(".ez-toc-link").forEach(t=>{t=t.replaceWith(t.cloneNode(!0))}),document.querySelectorAll(".ez-toc-section").forEach(t=>{t.setAttribute("ez-toc-data-id","#"+decodeURI(t.getAttribute("id")))}),jQuery("a.ez-toc-link").click(function(){let e=jQuery(this).attr("data-href"),i=jQuery(this).attr("href");if(1===parseInt(eztoc_smooth_local.add_request_uri)||1===parseInt(eztoc_smooth_local.add_self_reference_link)){if(jQuery(this).attr("data-href")){let r=jQuery(this).attr("data-href").split("#");r&&r.length>1&&(e=`#${r[1]}`)}if(jQuery(this).attr("href")){let a=jQuery(this).attr("href").split("#");a&&a.length>1&&(i=`#${a[1]}`)}}let l=t?e:i,o=jQuery("#wpadminbar"),s=jQuery("header"),h=0;if(parseInt(eztoc_smooth_local.scroll_offset)>30&&(h=parseInt(eztoc_smooth_local.scroll_offset)),o.length&&(h+=o.height()),(s.length&&"fixed"==s.css("position")||"sticky"==s.css("position"))&&(h+=s.height()),jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').length>0&&(h=jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').offset().top-h),jQuery("html, body").animate({scrollTop:h},500),t)return!1})});; 801/*! 802 * JavaScript Cookie v2.2.1 803 * https://github.com/js-cookie/js-cookie 804 * 805 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 806 * Released under the MIT license 807 */ 808!function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes)result[key]=attributes[key]}return result}function decode(s){return s.replace(/(%[0-9A-Z]{2}
vendor: 4,120 bytes, lines 808-821
808)+/g,decodeURIComponent)}function init(converter){function api(){}function set(key,value,attributes){if("undefined"!=typeof document){"number"==typeof(attributes=extend({path:"/"},api.defaults,attributes)).expires&&(attributes.expires=new Date(1*new Date+864e5*attributes.expires)),attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{var result=JSON.stringify(value);/^[\{\[]/.test(result)&&(value=result)}catch(e){}value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes)attributes[attributeName]&&(stringifiedAttributes+="; "+attributeName,!0!==attributes[attributeName]&&(stringifiedAttributes+="="+attributes[attributeName].split(";")[0]));return document.cookie=key+"="+value+stringifiedAttributes}}function get(key,json){if("undefined"!=typeof document){for(var jar={},cookies=document.cookie?document.cookie.split("; "):[],i=0;i<cookies.length;i++){var parts=cookies[i].split("="),cookie=parts.slice(1).join("=");json||'"'!==cookie.charAt(0)||(cookie=cookie.slice(1,-1));try{var name=decode(parts[0]);if(cookie=(converter.read||converter)(cookie,name)||decode(cookie),json)try{cookie=JSON.parse(cookie)}catch(e){}if(jar[name]=cookie,key===name)break}catch(e){}}return key?jar[key]:jar}}return api.set=set,api.get=function(key){return get(key,!1)},api.getJSON=function(key){return get(key,!0)},api.remove=function(key,attributes){set(key,"",extend(attributes,{expires:-1}))},api.defaults={},api.withConverter=init,api}return init((function(){}))}));; 809(function(){var a,b;a=this.jQuery||window.jQuery;b=a(window);a.fn.stick_in_parent=function(d){var p,m,o,n,j,h,k,f,l,e,c,g;if(d==null){d={};}g=d.sticky_class,h=d.inner_scrolling,c=d.recalc_every,e=d.parent,l=d.offset_top,f=d.spacer,o=d.bottoming; 810if(l==null){l=0;}if(e==null){e=void 0;}if(h==null){h=true;}if(g==null){g="is_stuck";}p=a(document);if(o==null){o=true;}n=function(t,G,q,i,B,C,y,z){var D,H,r,F,I,s,w,u,x,A,v,E; 811if(t.data("sticky_kit")){return;}t.data("sticky_kit",true);I=p.height();w=t.parent();if(e!=null){w=w.closest(e);}if(!w.length){throw"failed to find stick parent"; 812}r=false;D=false;v=f!=null?f&&t.closest(f):a("<div />");u=function(){var J,L,K;if(z){return;}I=p.height();J=parseInt(w.css("border-top-width"),10);L=parseInt(w.css("padding-top"),10); 813G=parseInt(w.css("padding-bottom"),10);q=w.offset().top+J+L;i=w.height();if(r){r=false;D=false;if(f==null){t.insertAfter(v);v.detach();}t.css({position:"",top:"",width:"",bottom:""}).removeClass(g); 814K=true;}B=t.offset().top-(parseInt(t.css("margin-top"),10)||0)-l;C=t.outerHeight(true);y=t.css("float");if(v){v.css({width:t.outerWidth(true),height:C,display:t.css("display"),"vertical-align":t.css("vertical-align"),"float":y}); 815}if(K){return E();}};u();if(C===i){return;}F=void 0;s=l;A=c;E=function(){var L,O,M,K,J,N;if(z){return;}M=false;if(A!=null){A-=1;if(A<=0){A=c;u();M=true; 816}}if(!M&&p.height()!==I){u();M=true;}K=b.scrollTop();if(F!=null){O=K-F;}F=K;if(r){if(o){J=K+C+s>i+q;if(D&&!J){D=false;t.css({position:"fixed",bottom:"",top:s}).trigger("sticky_kit:unbottom"); 817}}if(K<B){r=false;s=l;if(f==null){if(y==="left"||y==="right"){t.insertAfter(v);}v.detach();}L={position:"",width:"",top:""};t.css(L).removeClass(g).trigger("sticky_kit:unstick"); 818}if(h){N=b.height();if(C+l>N){if(!D){s-=O;s=Math.max(N-C,s);s=Math.min(l,s);if(r){t.css({top:s+"px"});}}}}}else{if(K>B){r=true;L={position:"fixed",top:s}; 819L.width=t.css("box-sizing")==="border-box"?t.outerWidth()+"px":t.width()+"px";t.css(L).addClass(g);if(f==null){t.after(v);if(y==="left"||y==="right"){v.append(t); 820}}t.trigger("sticky_kit:stick");}}if(r&&o){if(J==null){J=K+C+s>i+q;}if(!D&&J){D=true;if(w.css("position")==="static"){w.css({position:"relative"});}return t.css({position:"absolute",bottom:G,top:"auto"}).trigger("sticky_kit:bottom"); 821}}};x=function(){u();return E();};H=function(){z=true;
821b.off("touchmove",E);b.off("scroll",E);b.off("resize",x);a(document.body).off("sticky_kit:recalc",x); 822t.off("sticky_kit:detach",H);t.removeData("sticky_kit");t.css({position:"",bottom:"",top:"",width:""});w.position("position","");if(r){if(f==null){if(y==="left"||y==="right"){t.insertAfter(v); 823}v.remove();}return t.removeClass(g);}};b.on("touchmove",E);b.on("scroll",E);b.on("resize",x);a(document.body).on("sticky_kit:recalc",x);t.on("sticky_kit:detach",H); 824return setTimeout(E,0);};for(j=0,k=this.length;j<k;j++){m=this[j];n(a(m));}return this;};}).call(this);; 825jQuery((function(e){if("undefined"!=typeof ezTOC){function t(){if(0!==e(".ez-toc-widget-container.ez-toc-affix").length){var t=30;void 0!==ezTOC.scroll_offset&&(t=parseInt(ezTOC.scroll_offset)),e(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:t})}if(e.fn.shrinkTOCWidth=function(){e(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&e(this).css("width","")},void 0!==ezTOC.visibility_hide_by_default){var o=e(".ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)"),i=void 0!==ezTOC.visibility_hide_by_device?ezTOC.visibility_hide_by_device:0,c=ezTOC.visibility_hide_by_default;e.each(o,(function(t,o){var n=e(this);e(n).addClass("ez-toc-loaded");var s=e(n).parents("#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container").find("ul.ez-toc-list,ul.ez-toc-widget-sticky-list");if(e(s).hasClass("eztoc-toggle-hide-by-default")&&(c=1),"undefined"!=typeof Cookies&&(Cookies?(1==Cookies.get("ezTOC_hidetoc-"+t)?e(n).data("visible",!1):e(n).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+t)):(e(n).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+t))),c&&"0"!=i&&e(n).data("visible",!1),!e(n).data("visible")){s.hide();const e=document.querySelector("#ez-toc-container");if(e){const t=e.querySelector(".ez-toc-box-title");t&&t.classList.add("toc-closed")}else{const e=document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");if(e){const t=e.querySelector(".ez-toc-box-title");t&&t.classList.add("toc-closed")}}}e(n).on("click",(function(o){o.preventDefault();const i=document.querySelector("#ez-toc-container");if(i){i.classList.toggle("toc_close");const e=i.querySelector(".ez-toc-box-title");e&&e.classList.toggle("toc-closed")}else{const e=document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");e.classList.toggle("toc_close");const t=e.querySelector(".ez-toc-box-title");t&&t.classList.toggle("toc-closed")}e(this).data("visible")?(e(this).data("visible",!1),"undefined"!=typeof Cookies&&Cookies&&(c?Cookies.set("ezTOC_hidetoc-"+t,null,{path:"/",sameSite:"Strict"}):Cookies.set("ezTOC_hidetoc-"+t,"1",{expires:30,path:"/",sameSite:"Strict"})),s.hide("fast")):(e(this).data("visible",!0),"undefined"!=typeof Cookies&&Cookies&&(c?Cookies.set("ezTOC_hidetoc-"+t,"1",{expires:30,path:"/",sameSite:"Strict"}):Cookies.set("ezTOC_hidetoc-"+t,null,{path:"/",sameSite:"Strict"})),s.show("fast"))}))}))}var n=e("span.ez-toc-section").toArray(),s=function(t){return t.reduce((function(t,o){return t[o.id]=function(t){return e('.ez-toc-widget-container .ez-toc-list a[href="#'+e(t).attr("id")+'"]')}(o),t}),{})}(n),a=e.map(s,(function(e,t){return e})),l=function(){var t=5;void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(t=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30);var o=e("#wpadminbar");o.length&&(t+=o.height());return t}();function r(){var t=function(t,o){var i=e(window).scrollTop()+t+1,c=o[0],n=i-e(c).offset().top;return o.forEach((function(t){var o=i-e(t).offset().top;o>0&&o<n&&(n=o,c=t)})),c}(l,n);if(t){var o=s[t.id];!function(e,t){t.forEach((function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")}))}(o,a),function(t){var o=t.parent();o.hasClass("active")||o.addClass("active");!function(t){var o=function(t){var o=e(t),i=o.html();o.parent().append('<li id="ez-toc-height-test" class="active">'+i+"</li>");var c=e("#ez-toc-height-test"),n=c.height();return c.remove(),n-(o.children("ul").first().height()||0)}(t);!function(t){e(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",t+"px")}(o)}(o)}(o)}}n.length>0&&e(".ez-toc-widget-container").length&&e(window).on("load resize scroll",r)}function o(){e('.ez-toc-list[class*="ez-toc-columns-"]').each((function(){var t=e(this),o=t.attr("class").match(/ez-toc-columns-(\d+)/);o&&(parseInt(o[1])<=1||(t.addClass("ez-toc-columns-optimized"),t.find("li").each((function(){var t=e(this);t.outerHeight()>50&&t.css("break-inside","avoid")}))))}))}e("#ez-toc-container").length&&(e("#ez-toc-container .ez-toc-toggle label span").html()||e("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon)),ezTOC.init=function(){t()},t(),setTimeout(o,100),void 0!==ezTOC.ajax_toggle&&1===parseInt(ezTOC.ajax_toggle)&&e(document).ajaxComplete((function(){t(),setTimeout(o,100)}))}e(document).on("click","#ez-toc-open-sub-hd",(function(t){e(this).attr("id","ez-toc-open-sub-hd-active"),t.preventDefault()})),e(document).on("click","#ez-toc-open-sub-hd-active",(function(t){e(this).attr("id","ez-toc-open-sub-hd"),t.preventDefault()})),e("#ez-toc-more-links-enabler").click((function(){e(".ez-toc-more-link").show(),e("#ez-toc-more-links-enabler").hide(),e("#ez-toc-more-links-disabler").attr("style","display:inline-block")})),e("#ez-toc-more-links-disabler").click((function(){e(".ez-toc-more-link").hide(),e("#ez-toc-more-links-enabler").show(),e("#ez-toc-more-links-disabler").hide()})),1===parseInt(ezTOC.chamomile_theme_is_on)&&e("#ez-toc-container").find(".hamburger").remove()})); 826;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.