document_protocol="https";document_root="taoclass.com.ng/";equation_dir_www="https://www.taoclass.com.ng/equation/";equation_dir="https://taoclass.com.ng/equation/";username='16';full_screen_mode=!1,scroll_button_pressed=!1,lecture_mode=!1,saving_file=!1,edit_document_type=-1,lecture_time_count=0,act_cursor_parent_id=null,act_cursor_leader_id=null,assoc_files_been_loaded=[],temp_insert_panel_content="",active_chat_exists=!1,auto_scroll_chat=!1,chat_time_count=0,poll_time_count=0,active_poll_ids=[],core_channel="",current_import_filename="",share_id="",share_platform_id=0,exam_setup_type="none",exam_setup_merger_data="",exam_answers="",exam_end_times=[],exam_remove_qst=[],exam_groups=[],user_answers=[],submitted_exams=[],current_submit_answers="",current_submit_exam_id=0,current_submit_eq_id="",current_submit_mode="",current_edit_exam_id=0,current_exams=[],current_course="",current_course_topic="",current_equation_data=null,current_exam_id=0,all_tts_ids=[],current_read_tts={eq_id:"",paused:0,nextStart:"",h_col:"rgb(15,157,88)",delay:2e3,voice:0,mode:1,pointer:0,controls:1,repeat_wd:0,repeat_all:0,singify:0,replace:{}},current_read_tts_timer=null,current_read_tts_repeat=!1,read_tts_auto_nav_timer=null,sym_map=new Map,sym_map.set("∠",{s:"angle",p:"angle",t:0}),sym_map.set("∧",{s:"and",p:"and",t:0}),sym_map.set("∨",{s:"or",p:"or",t:0}),sym_map.set("∩",{s:"intersection",p:"intersection",t:0}),sym_map.set("∪",{s:"union",p:"union",t:0}),sym_map.set("∫",{s:"integral",p:"integral",t:0}),sym_map.set("∴",{s:"therefore",p:"therefore",t:0}),sym_map.set("∼",{s:"is similar to",p:"is similar to",t:0}),sym_map.set("≅",{s:"is congruent to",p:"is congruent to",t:0}),sym_map.set("≈",{s:"is asymptotic to",p:"is asymptotic to",t:0}),sym_map.set("≠",{s:"is not equal to",p:"is not equal to",t:0}),sym_map.set("≡",{s:"is equivalent to",p:"is equivalent to",t:0}),sym_map.set("≤",{s:"is less than or equal to",p:"is less than or equal to",t:0}),sym_map.set("≥",{s:"is greater than or equal to",p:"is greater than or equal to",t:0}),sym_map.set("∀",{s:"for all",p:"for all",t:0}),sym_map.set("∂",{s:"partial derivative of",p:"partial derivative of",t:0}),sym_map.set("∃",{s:"exist",p:"exist",t:0}),sym_map.set("∅",{s:"empty",p:"empty",t:0}),sym_map.set("∈",{s:"is a member of",p:"is a member of",t:0}),sym_map.set("∉",{s:"is not a member of",p:"is not a member of",t:0}),sym_map.set("∏",{s:"product of",p:"product of",t:0}),sym_map.set("⊂",{s:"is a subset of",p:"is a subset of",t:0}),sym_map.set("⊃",{s:"is a superset of",p:"is a superset of",t:0}),sym_map.set("⊄",{s:"is not a subset of",p:"is not a subset of",t:0}),sym_map.set("⊆",{s:"is a subset of or equal to",p:"is a subset of or equal to",t:0}),sym_map.set("⊇",{s:"is a superset of or equal to",p:"is a superset of or equal to",t:0}),sym_map.set("¹",{s:"superscript 1",p:"superscript 1",t:0}),sym_map.set("²",{s:"squared",p:"squared",t:0}),sym_map.set("³",{s:"cubed",p:"cubed",t:0}),sym_map.set("(",{s:"open bracket",p:"open bracket",t:0}),sym_map.set(")",{s:"close bracket",p:"close bracket",t:0}),sym_map.set("[",{s:"open square bracket",p:"open square bracket",t:0}),sym_map.set("]",{s:"close square bracket",p:"close square bracket",t:0}),sym_map.set("{",{s:"set of",p:"set of",t:0}),sym_map.set("}",{s:"",p:"",t:0}),sym_map.set(":",{s:"such that",p:"such that",t:0}),sym_map.set("⊥",{s:"is perpendicular to",p:"is perpendicular to",t:0}),sym_map.set("parallel",{s:"is parallel to",p:"is parallel to",t:0}),sym_map.set("α",{s:"alpha",p:"alpha",t:0}),sym_map.set("Α",{s:"Alpha",p:"Alpha",t:0}),sym_map.set("β",{s:"beta",p:"beta",t:0}),sym_map.set("Β",{s:"Beta",p:"Beta",t:0}),sym_map.set("γ",{s:"gamma",p:"gamma",t:0}),sym_map.set("Γ",{s:"Gamma",p:"Gamma",t:0}),sym_map.set("δ",{s:"delta",p:"delta",t:0}),sym_map.set("Δ",{s:"Delta",p:"Delta",t:0}),sym_map.set("ε",{s:"epsilon",p:"epsilon",t:0}),sym_map.set("Ε",{s:"Epsilon",p:"Epsilon",t:0}),sym_map.set("Ζ",{s:"Zeta",p:"Zeta",t:0}),sym_map.set("ζ",{s:"zeta",p:"zeta",t:0}),sym_map.set("Η",{s:"Eta",p:"Eta",t:0}),sym_map.set("η",{s:"eta",p:"eta",t:0}),sym_map.set("Θ",{s:"Theta",p:"Theta",t:0}),sym_map.set("θ",{s:"theta",p:"theta",t:0}),sym_map.set("ϑ",{s:"thetasym",p:"thetasym",t:0}),sym_map.set("Ι",{s:"Iota",p:"Iota",t:0}),sym_map.set("ι",{s:"iota",p:"iota",t:0}),sym_map.set("Κ",{s:"Kappa",p:"Kappa",t:0}),sym_map.set("κ",{s:"kappa",p:"kappa",t:0}),sym_map.set("Λ",{s:"Lambda",p:"Lambda",t:0}),sym_map.set("λ",{s:"lambda",p:"lambda",t:0}),sym_map.set("Μ",{s:"Mu",p:"Mu",t:0}),sym_map.set("μ",{s:"mu",p:"mu",t:0}),sym_map.set("Ν",{s:"Nu",p:"Nu",t:0}),sym_map.set("ν",{s:"nu",p:"nu",t:0}),sym_map.set("Ξ",{s:"Xi",p:"Xi",t:0}),sym_map.set("ξ",{s:"xi",p:"xi",t:0}),sym_map.set("Ο",{s:"Omicron",p:"Omicron",t:0}),sym_map.set("ο",{s:"omicron",p:"omicron",t:0}),sym_map.set("Π",{s:"Pi",p:"Pi",t:0}),sym_map.set("π",{s:"pi",p:"pi",t:0}),sym_map.set("ϖ",{s:"piv",p:"piv",t:0}),sym_map.set("Ρ",{s:"Rho",p:"Rho",t:0}),sym_map.set("ρ",{s:"rho",p:"rho",t:0}),sym_map.set("Σ",{s:"Sigma",p:"Sigma",t:0}),sym_map.set("σ",{s:"sigma",p:"sigma",t:0}),sym_map.set("ς",{s:"sigmaf",p:"sigmaf",t:0}),sym_map.set("Τ",{s:"Tau",p:"Tau",t:0}),sym_map.set("τ",{s:"tau",p:"tau",t:0}),sym_map.set("Υ",{s:"Upsilon",p:"Upsilon",t:0}),sym_map.set("υ",{s:"upsilon",p:"upsilon",t:0}),sym_map.set("ϒ",{s:"upsih",p:"upsih",t:0}),sym_map.set("Φ",{s:"Phi",p:"Phi",t:0}),sym_map.set("φ",{s:"phi",p:"phi",t:0}),sym_map.set("Χ",{s:"Chi",p:"Chi",t:0}),sym_map.set("χ",{s:"chi",p:"chi",t:0}),sym_map.set("Ψ",{s:"Psi",p:"Psi",t:0}),sym_map.set("ψ",{s:"psi",p:"psi",t:0}),sym_map.set("Ω",{s:"Omega",p:"Omega",t:0}),sym_map.set("ω",{s:"omega",p:"omega",t:0}),sym_map.set("∝",{s:"is proportional to",p:"is proportional to",t:0}),sym_map.set("∞",{s:"infinity",p:"infinity",t:0}),sym_map.set(""",{s:"quotation",p:"quotation",t:0}),sym_map.set("&",{s:"ampersand",p:"ampersands",t:0}),sym_map.set("<",{s:"less than",p:"less than",t:0}),sym_map.set(">",{s:"greater than",p:"greater than",t:0}),sym_map.set("ƒ",{s:"function of",p:"function of",t:0}),sym_map.set("©",{s:"copyright",p:"copyright",t:0}),sym_map.set("+",{s:"plus",p:"plus",t:0}),sym_map.set("−",{s:"minus",p:"minus",t:0}),sym_map.set("×",{s:"times",p:"times",t:0}),sym_map.set("÷",{s:"divide by",p:"divide by",t:0}),sym_map.set("°",{s:"degree",p:"degrees",t:0}),sym_map.set("±",{s:"plus-or-minus",p:"plus-or-minus",t:0}),sym_map.set("⊥",{s:"is perpendicular to",p:"is perpendicular to",t:0}),sym_map.set("¼",{s:"one-quarter",p:"one-quarters",t:0}),sym_map.set("½",{s:"half",p:"halves",t:0}),sym_map.set("¾",{s:"three-quarter",p:"three-quarters",t:0}),sym_map.set("metre",{s:"metre",p:"metre",t:0}),sym_map.set("ampere",{s:"ampere",p:"ampere",t:0}),sym_map.set("atm",{s:"atmosphere",p:"atmosphere",t:0}),sym_map.set("faraday",{s:"faraday",p:"faraday",t:0}),sym_map.set("pascal",{s:"pascal",p:"pascal",t:0}),sym_map.set("fahrenheit",{s:"fahrenheit",p:"fahrenheit",t:0}),sym_map.set("volt",{s:"volt",p:"volt",t:0}),sym_map.set("centigrade",{s:"centigrade",p:"centigrade",t:0}),sym_map.set("celcius",{s:"celcius",p:"celcius",t:0}),sym_map.set("coulumb",{s:"coulumb",p:"coulumb",t:0}),sym_map.set("kelvin",{s:"kelvin",p:"kelvin",t:0}),sym_map.set("mercury",{s:"mercury",p:"mercury",t:0}),sym_map.set("gram",{s:"gram",p:"grams",t:0}),sym_map.set("bar",{s:"bar",p:"bar",t:0}),sym_map.set("weber",{s:"weber",p:"weber",t:0}),sym_map.set("mol",{s:"mol",p:"mols",t:0}),sym_map.set("watt",{s:"watt",p:"watts",t:0}),sym_map.set("newton",{s:"newton",p:"newton",t:0}),sym_map.set("ohm",{s:"ohm",p:"ohm",t:0}),sym_map.set("henry",{s:"henry",p:"henry",t:0}),sym_map.set("joule",{s:"joule",p:"joule",t:0}),sym_map.set("litre",{s:"litre",p:"litres",t:0}),sym_map.set("second",{s:"second",p:"seconds",t:0}),sym_map.set("minute",{s:"minute",p:"minutes",t:0}),sym_map.set("hour",{s:"hour",p:"hours",t:0}),sym_map.set("tesla",{s:"tesla",p:"tesla",t:0}),sym_map.set("candela",{s:"candela",p:"candela",t:0}),sym_map.set("hertz",{s:"hertz",p:"hertz",t:0}),sym_map.set("bell",{s:"bell",p:"bell",t:0}),sym_map.set("eV",{s:"electron volt",p:"electron volts",t:0}),sym_map.set("bell",{s:"bell",p:"bell",t:0}),sym_map.set("rad",{s:"radian",p:"radians",t:0}),sym_map.set("centi",{s:"centi",p:"centi",t:0}),sym_map.set("milli",{s:"milli",p:"milli",t:0}),sym_map.set("µ",{s:"micro",p:"micro",t:0}),sym_map.set("nano",{s:"nano",p:"nano",t:0}),sym_map.set("pico",{s:"pico",p:"pico",t:0}),sym_map.set("deca",{s:"deca",p:"deca",t:0}),sym_map.set("hecto",{s:"hecto",p:"hecto",t:0}),sym_map.set("kilo",{s:"kilo",p:"kilo",t:0}),sym_map.set("mega",{s:"mega",p:"mega",t:0}),sym_map.set("giga",{s:"geega",p:"geega",t:0}),sym_map.set("peta",{s:"peta",p:"peta",t:0}),sym_map.set("£",{s:"pound",p:"pounds",t:1}),sym_map.set("₦",{s:"naira",p:"naira",t:1}),sym_map.set("€",{s:"euro",p:"euros",t:1}),sym_map.set("¥",{s:"yuan",p:"yuan",t:1}),sym_map.set("a",{s:"a",p:"a",t:0}),sym_map.set("b",{s:"b",p:"b",t:0}),sym_map.set("c",{s:"c",p:"c",t:0}),sym_map.set("d",{s:"d",p:"d",t:0}),sym_map.set("e",{s:"e",p:"e",t:0}),sym_map.set("f",{s:"f",p:"f",t:0}),sym_map.set("g",{s:"g",p:"g",t:0}),sym_map.set("h",{s:"h",p:"h",t:0}),sym_map.set("i",{s:"i",p:"i",t:0}),sym_map.set("j",{s:"j",p:"j",t:0}),sym_map.set("k",{s:"k",p:"k",t:0}),sym_map.set("l",{s:"l",p:"l",t:0}),sym_map.set("m",{s:"m",p:"m",t:0}),sym_map.set("n",{s:"n",p:"n",t:0}),sym_map.set("o",{s:"o",p:"o",t:0}),sym_map.set("p",{s:"p",p:"p",t:0}),sym_map.set("q",{s:"q",p:"q",t:0}),sym_map.set("r",{s:"r",p:"r",t:0}),sym_map.set("s",{s:"s",p:"s",t:0}),sym_map.set("t",{s:"t",p:"t",t:0}),sym_map.set("u",{s:"u",p:"u",t:0}),sym_map.set("v",{s:"v",p:"v",t:0}),sym_map.set("w",{s:"w",p:"w",t:0}),sym_map.set("x",{s:"x",p:"x",t:0}),sym_map.set("y",{s:"y",p:"y",t:0}),sym_map.set("z",{s:"z",p:"z",t:0}),sym_map.set("A",{s:"A",p:"A",t:0}),sym_map.set("B",{s:"B",p:"B",t:0}),sym_map.set("C",{s:"C",p:"C",t:0}),sym_map.set("D",{s:"D",p:"D",t:0}),sym_map.set("E",{s:"E",p:"E",t:0}),sym_map.set("F",{s:"F",p:"F",t:0}),sym_map.set("G",{s:"G",p:"G",t:0}),sym_map.set("H",{s:"H",p:"H",t:0}),sym_map.set("I",{s:"I",p:"I",t:0}),sym_map.set("J",{s:"J",p:"J",t:0}),sym_map.set("K",{s:"K",p:"K",t:0}),sym_map.set("L",{s:"L",p:"L",t:0}),sym_map.set("M",{s:"M",p:"M",t:0}),sym_map.set("N",{s:"N",p:"N",t:0}),sym_map.set("O",{s:"O",p:"O",t:0}),sym_map.set("P",{s:"P",p:"P",t:0}),sym_map.set("Q",{s:"Q",p:"Q",t:0}),sym_map.set("R",{s:"R",p:"R",t:0}),sym_map.set("S",{s:"S",p:"S",t:0}),sym_map.set("T",{s:"T",p:"T",t:0}),sym_map.set("U",{s:"U",p:"U",t:0}),sym_map.set("V",{s:"V",p:"V",t:0}),sym_map.set("W",{s:"W",p:"W",t:0}),sym_map.set("X",{s:"X",p:"X",t:0}),sym_map.set("Y",{s:"Y",p:"Y",t:0}),sym_map.set("Z",{s:"Z",p:"Z",t:0}),sym_map.set("",{s:"",p:"",t:0}),current_read_ans=null,current_read_ans_timer=null,current_read_ans_repeat=!1,current_read_ans_opt=!1,cur_edit_property_id="",submitting_exam_answers=!1,dc_status="not started",deviceType="pc",user_agent="web",prev_object="none",login_reply_id=0,opened_file_id=0,opened_saved_bank_question=[],download_file_type="",question_bank_object=null,dc_mode="new",wallet_status="",paragraph_type=1,scroll_pos=0,cursor_timer=null,cursor_background="#6699ff",content_pane_width=0,window_width=window.innerWidth,first_text="",second_text="",insert_panel_parent_id="insert_panel_parent",insert_panel_id="col_wrap_1_col_1_insert_panel",page_view="none",current_col_wrap_no=1,current_page_break_no=1;var container_id="str_cursor_str",selected_container="str_cursor_str",insert_data_sel_cont=insert_panel_id,selected_ids=[],selected_td_ids=[],arrow_select_dir="",container_bg=(hover_id="str_cursor_str",hover_rectangle=null,[]),highlight_col="#69F",loop_time_padding=(container_value="",editing=!1,close_win_msg="Please close the current edit window!",clicked=!1,index_i=[],index_j=[],cell_count=[],eq_list=[],time_list=[],comp_list=[],alphabet_list=[],table_rows=[],table_cols=[],glo_copy_str="",glo_new_cont_id="",glo_sel_cont_id="",glo_obj_id="",automatic_hr=!1,line_height="30px",paragraph_align="left",default_paragraph_style="margin:0px !important;padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:2px;box-sizing:border-box;",paragraph_style="margin:0px !important;padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:2px;box-sizing:border-box;",eq_paragraph_style="padding-top:0px;padding-bottom:0px;padding-left:1px;padding-right:1px;box-sizing:border-box;",font_style="font-size:16px;font-weight:normal;color:#000000",eq_font_style="font-size:16px;font-weight:normal;color:#000000",font_weight="normal",font_italic="normal",font_underline="none",font_strike="none",class_count=0,image_dependent=[],image_dependent_index=0,clipboard_object_id="",key_comb=[],last_released_key="",delta_time=14705208e5,0);data_separator="",mousedown=!1,mousedblclicked=!1,eventY=0,eventX=0,eventYY=0,eventXX=0,select_handle_dragged=1,undo_stack_size=10,undo_html_stack=new Pipe("top",undo_stack_size),undo_insert_data_stack=new Pipe("top",undo_stack_size),undo_img_dependency_stack=new Pipe("top",undo_stack_size),undo_container_id_stack=new Pipe("top",undo_stack_size),undo_selected_container_stack=new Pipe("top",undo_stack_size),undo_insert_data_sel_cont_stack=new Pipe("top",undo_stack_size),undo_selected_ids_stack=new Pipe("top",undo_stack_size),undo_container_bg_stack=new Pipe("top",undo_stack_size),redo_html_stack=new Pipe("top",undo_stack_size),redo_insert_data_stack=new Pipe("top",undo_stack_size),redo_img_dependency_stack=new Pipe("top",undo_stack_size),redo_container_id_stack=new Pipe("top",undo_stack_size),redo_selected_container_stack=new Pipe("top",undo_stack_size),redo_insert_data_sel_cont_stack=new Pipe("top",undo_stack_size),redo_selected_ids_stack=new Pipe("top",undo_stack_size),redo_container_bg_stack=new Pipe("top",undo_stack_size);const speechSynth=window.speechSynthesis;let speechSynthVoices=[];edit_material_id="",edit_poster="",edit_username="",edit_tutor="",edit_type="",edit_edit_permission="yes",edit_save_permission="yes",edit_share_permission="yes",edit_all_permission="yes",loading_latest=!1,loading_intermediate=!1,loading_old=!1,loading_latest_prev_visib=!1,loading_intermediate_prev_visib=!1,loading_old_prev_visib=!1,submit_action="";var usedEquations=[],groups_of_aligned_eqs_id="";function Pipe(e,t){this.stack=[],this.maxSize=t,this.dir=e,this.getMaxSize=function(){return this.maxSize},this.getSize=function(){return this.stack.length},this.push=function(e){if("top"==this.dir)if(this.stack.length==this.maxSize){for(xx=0;xx"+getData(e)+""),insert_data=document.getElementById("insert_data").value,pre_ancestor=s.parentNode,result=removeData(d,e,insert_data),new_insert_data="",data_arr=result.split(""),i=0;i"),a=data_arr[i].substring(t+1),d_a=a.split(";"),chk=document.getElementById(d_a[0]),main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")),chk1=document.getElementById(main_id),null!=chk&&null!=chk1&&(""==new_insert_data?new_insert_data=data_arr[i]:new_insert_data+=""+data_arr[i])):(data_arr[i].startsWith(""),a=data_arr[i].substring(0,t),d_a=a.split(" "),null==(chk=document.getElementById(d_a[1])))||(""==new_insert_data?new_insert_data=data_arr[i]:new_insert_data+=""+data_arr[i]);document.getElementById("insert_data").innerHTML=new_insert_data,0==e.indexOf("eq")&&removeAnswer(e),id="",null!==n?(id=n.id.endsWith("_root")?n.id.replace("_root",""):n.id,n.id.startsWith("p_")||n.id.startsWith("div_")||(container_id=id,selected_container=id,insert_data_sel_cont=id,setCursor())):(container_id=document.getElementById("str_cursor_str").parentNode.id,selected_container="str_cursor_str",insert_data_sel_cont=document.getElementById("str_cursor_str").parentNode.id),cancelEdit(),editing=!1}catch(e){alert(e)}}function getData(e){if(insert_data_parent=document.getElementById("insert_data"),val=insert_data_parent.value,data_ar=val.split(""),value="",data="",0===e.indexOf("img_"))for(i=0;i"),t=data_ar[i].substring(t+1),d_a=t.split(";"),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==e)&&(data=data_ar[i])}return data}function removeData(e,t,a){for(new_insert_data="",data_arr=a.split(""),i=0;i"),r=data_arr[i].substring(0,n),d_a=r.split(" "),chk=document.getElementById(d_a[1]),d_a[1]===e&&d_a[2]===t||(""==new_insert_data?new_insert_data=data_arr[i]:new_insert_data+=""+data_arr[i])):(n=data_arr[i].indexOf(">"),(r=data_arr[i].substring(n+1)).startsWith(e.concat(";",t))||(""==new_insert_data?new_insert_data=data_arr[i]:new_insert_data+=""+data_arr[i]))}return new_insert_data}function editText(e){var t;clicked&&(editing=!1,clicked=!1),editing||(document.getElementById("edit_panel").setAttribute("style","display:none"),document.getElementById("edit_panel_1").setAttribute("style","display:none"),document.getElementById("equation_panel").style.visibility="hidden",t=document.getElementById(container_id),setBackground(container_id.substr(0,container_id.length-2),container_bg),container_bg=getBackground(container_id),setBackground(container_id,highlight_col),t=t.firstChild.innerHTML.trim()," "==(container_value=t)&&(t=""),document.getElementById("edit_text").setAttribute("style","display:block"),document.getElementById("edit_text_field").value=t)}function setValue(){var e=document.getElementById(container_id).firstChild,e=(""==(val=document.getElementById("edit_text_field").value.trim())&&(val=" "),e.innerHTML=val,document.getElementById("edit_panel").setAttribute("style","display:none"),document.getElementById("insert_data")),t=e.value,a=container_id+";"+container_value,n=container_id+";"+val;-1"+n+"",e.innerHTML=t=""==t?a:t+""+a),editing=!1}function cancelEdit(){var t;for(t of document.getElementsByClassName("panels")){let e="";e=null!=t.getAttribute("style")?setStyleDisplay("none",t.getAttribute("style")):setStyleDisplay("none",""),t.setAttribute("style",e)}editing=!1,focusCursor()}function createString(e,t=!0){var a,n,r,s,i=(new Date).getTime()-delta_time,d="str_"+username+"_"+i+"_str";try{""!=e&&((a=document.createElement("span")).innerHTML=e,a.setAttribute("onMouseOver","setHoverID('"+d+"',event)"),a.setAttribute("id",d),"str_cursor_str"==container_id&&setContainer(),document.getElementById(container_id).parentNode.id.startsWith("eq")?-1e!=t),last_released_key=t}function processSpecial(e){switch(e.key){case"Backspace":processBackspace();break;case"Tab":processTab(),e.preventDefault()}key_comb.includes(e.key)||key_comb.push(e.key),console.log(key_comb.join().toLowerCase()),1")?t=e.split("
"):-1!=e.indexOf("
")&&(t=e.split("
")),new_str="",0==t.length&&(new_str=e),i=0;i"+t[i]);for(t=new Array,-1!=new_str.indexOf(" ")&&(t=new_str.split(" ")),new_str1="",0==t.length&&(new_str1=new_str),i=0;i")&&(t=new_str.split(">")),new_str1="",0==t.length&&(new_str1=new_str),i=0;i"+t[i]);document.getElementById(container_id).innerHTML=new_str3,setString()}function setString(){var e,t,a,n,r="",r=(-1"),found=!1;try{for(i=0;i"),(subst=data_arr[i].substring(0,index+1)).endsWith(container_id+">")&&(""!=r.trim()?data_arr[i]=subst+r+"":(data_arr[i]="",a=(t=(e=document.getElementById(container_id)).parentNode).childNodes,nd=t.childNodes,1"+data_arr[i]:new_insert_data=data_arr[i];found||""!=r&&(n=""+r+"",new_insert_data=""==new_insert_data?n:new_insert_data+""+n),s.innerHTML=new_insert_data,removeStyle(container_id),editing=!1}catch(e){alert(e)}}function moveUp(){var e,t,a=container_id,n=document.getElementById(a).parentNode,r="",r=n.id.endsWith(insert_panel_id)?n:n.parentNode,s=(object_moved=!1,r.childNodes);for(i=0;i"),found=!1,container_id.startsWith("str_")||container_id.startsWith("sym_"))for(i=0;i"),_=data_arr[i].substring(0,o);if(d_a=_.split(" "),(main_id=d_a[2])==container_id&&0"),_=data_arr[j].substring(0,o),d_a=_.split(" "),main_id=d_a[2],(parent_id=d_a[1])==pres_parent){e=data_arr[j],data_arr[i]=e,data_arr[j]=t,found=!0;break}}else if(data_arr[j].startsWith(""),_=data_arr[j].substring(o+1);if(d_a=_.split(";"),main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")),(parent_id=d_a[0])==pres_parent){e=data_arr[j],data_arr[i]=e,data_arr[j]=t,found=!0;break}}}if(found)break}else if(container_id.startsWith("eq")||container_id.startsWith("tbl")||container_id.startsWith("hr")||container_id.startsWith("img")||container_id.startsWith("vid"))for(i=0;i"),_=data_arr[i].substring(o+1);if(d_a=_.split(";"),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==container_id&&0"),_=data_arr[j].substring(0,o),d_a=_.split(" "),main_id=d_a[2],(parent_id=d_a[1])==pres_parent){e=data_arr[j],data_arr[i]=e,data_arr[j]=t,found=!0;break}}else if(data_arr[j].startsWith(""),_=data_arr[j].substring(o+1);if(d_a=_.split(";"),main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")),(parent_id=d_a[0])==pres_parent){e=data_arr[j],data_arr[i]=e,data_arr[j]=t,found=!0;break}}}if(found)break}for(d="",i=0;i"+data_arr[i];!found&&object_moved&&(d=""==d?""+container_id+"":d+""+container_id+""),document.getElementById("insert_data").innerHTML=d}function moveDown(){var e=container_id,t=document.getElementById(e).parentNode,a="",n=(object_moved=!1,(a=t.id.endsWith(insert_panel_id)?t:t.parentNode).childNodes);for(i=0;i"),found=!1,container_id.startsWith("str_")||container_id.startsWith("sym_"))for(i=0;i"),_=data_arr[i].substring(0,o);if(d_a=_.split(" "),(main_id=d_a[2])==container_id&&data_arr.length>i)for(s="",r=data_arr[i],pres_parent=d_a[1],j=i+1;j"),_=data_arr[j].substring(0,o),d_a=_.split(" "),main_id=d_a[2],(parent_id=d_a[1])==pres_parent){s=data_arr[j],data_arr[i]=s,data_arr[j]=r,found=!0;break}}else if(data_arr[j].startsWith(""),_=data_arr[j].substring(o+1);if(d_a=_.split(";"),main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")),(parent_id=d_a[0])==pres_parent){s=data_arr[j],data_arr[i]=s,data_arr[j]=r,found=!0;break}}}if(found)break}else if(container_id.startsWith("eq")||container_id.startsWith("tbl")||container_id.startsWith("hr")||container_id.startsWith("img")||container_id.startsWith("vid"))for(i=0;i"),_=data_arr[i].substring(o+1);if(d_a=_.split(";"),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==container_id&&data_arr.length>i)for(s="",r=data_arr[i],pres_parent=d_a[0],j=i+1;j"),_=data_arr[j].substring(0,o),d_a=_.split(" "),main_id=d_a[2],(parent_id=d_a[1])==pres_parent){s=data_arr[j],data_arr[i]=s,data_arr[j]=r,found=!0;break}}else if(data_arr[j].startsWith(""),_=data_arr[j].substring(o+1);if(d_a=_.split(";"),main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")),(parent_id=d_a[0])==pres_parent){s=data_arr[j],data_arr[i]=s,data_arr[j]=r,found=!0;break}}}if(found)break}for(d="",i=0;i"+data_arr[i];!found&&object_moved&&(d=""==d?""+container_id+"":d+""+container_id+""),document.getElementById("insert_data").innerHTML=d}function getElementComputedStyle(e){var t,a=document.defaultView.getComputedStyle(document.getElementById(e),null);let n="";for(t in a){var r=a[t];n+=""==n?r+":"+a[r]:";"+r+":"+a[r]}return n}function getBackground(e){e=getElementComputedStyle(e);if(null!=e){var t=e.split(";");for(i=0;i"),e=e.replace("_root",""),i=0;i");for(properties=data_arr[i].substring(t+1).replace("",""),subst=data_arr[i].substring(0,t),my_ar=subst.split(" "),names=my_ar[my_ar.length-1],classname_arr=names.split(","),new_classnames="",z=0;z"+properties+"",new_insert_data+=""==new_insert_data?new_style:""+new_style)}else(!data_arr[i].startsWith("",value=value+""+style),document.getElementById("insert_data").innerHTML=value,--image_dependent_index):image_dependent.push(getImageDep(r))),e}function getImageDep(e){for(insert_data_parent=document.getElementById("insert_data"),val=insert_data_parent.value,data_ar=val.split(""),value="",i=0;i"),n=data_ar[i].substring(t+1);if(d_a=n.split(";"),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==e)return t=data_ar[i].indexOf(">"),n=data_ar[i].substring(0,t),d_a=n.split(" "),img_dep=d_a[2]}}function checkImageDep(e){for(insert_data_parent=document.getElementById("insert_data"),val=insert_data_parent.value,data_ar=val.split(""),total=0,result=!1,i=0;i"),t=data_ar[i].substring(0,t),d_a=t.split(" "),(img_dep=d_a[2])==e)&&(0"),total=0,result=!1,i=0;i"),t=data_ar[i].substring(0,t),d_a=t.split(" "),(img_dep=d_a[2])==e)&&(result=!0)}return result}function adaptToScreenWidth(e,t,n){try{var r;(temp_adapt_div=document.getElementById("temp_adapt_div")).innerHTML=n,mag=t/e;for(r of document.getElementById("temp_adapt_div").getElementsByClassName("page_break"))null!=(oldWidth=$(r).css("width").toLowerCase().replace("px",""))&&oldWidth.indexOf("%")<0&&(newWidth=Math.floor(mag*oldWidth),null!=r.getAttribute("style")?(newStyle=setStyleWidth(newWidth,r.getAttribute("style")),r.setAttribute("style",newStyle)):r.setAttribute("style","width:"+newWidth+"px"));for(table_arr=temp_adapt_div.getElementsByTagName("table"),img_arr=temp_adapt_div.getElementsByTagName("img"),div_arr=temp_adapt_div.getElementsByTagName("div"),hr_arr=temp_adapt_div.getElementsByTagName("hr"),fieldset_arr=temp_adapt_div.getElementsByTagName("fieldset"),i=0;i=window.innerHeight&&(r=!1),a++,r;);n&&jQuery("#dc_tool_bar").css("display","none")}function calculatePageSize(){var e=document.getElementById(insert_panel_parent_id).getElementsByClassName("page_break")[0].getBoundingClientRect(),t=Math.ceil(e.right-e.left),e=Math.ceil(e.bottom-e.top);document.getElementById("toolbar_page_size").innerHTML=t+"px × "+e+"px"}function minimizeToolbar(){jQuery("#dc_tool_bar").removeClass("toolbar_maximized");var e=Math.ceil(1/1.91*content_pane_width);$("#"+insert_panel_parent_id).css("height",e+"px"),jQuery("#maximize_toolbar_icon").css("display","inline"),jQuery("#minimize_toolbar_icon").css("display","none"),alignEquation(),full_screen_mode=!1,resetPageSize()}function clearScreen(e=!1){cancelEdit(),document.getElementById("cursor_container").appendChild(document.getElementById("str_cursor_str"));var t=document.getElementById(insert_panel_parent_id),n=(t.innerHTML="",document.createElement("div")),r=(n.setAttribute("class","shoot_doc"),n.setAttribute("data","paper[type:A4];heights[2,96,2]"),document.createElement("div")),a=(r.setAttribute("id","page_break_1"),r.setAttribute("class","page_break"),document.createElement("div")),i=(a.setAttribute("id","page_background_1"),a.setAttribute("class","page_background"),document.createElement("div")),d=(i.setAttribute("id","page_content_1"),i.setAttribute("class","page_content"),document.createElement("div")),s=(d.setAttribute("id","page_foreground_1"),d.setAttribute("class","page_foreground"),document.createElement("div")),l=(s.setAttribute("id","page_break_1_header"),s.setAttribute("class","page_header"),document.createElement("div")),l=(l.setAttribute("id","page_break_1_header_insert_panel"),l.setAttribute("class","insert_panel"),l.setAttribute("onmouseover","setCurrentColumn('page_break_1_header_insert_panel')"),l.innerHTML=" ",s.appendChild(l),document.createElement("div")),o=(l.setAttribute("id","page_break_1_footer"),l.setAttribute("class","page_footer"),document.createElement("div")),o=(o.setAttribute("id","page_break_1_footer_insert_panel"),o.setAttribute("class","insert_panel"),o.setAttribute("onmouseover","setCurrentColumn('page_break_1_footer_insert_panel')"),o.innerHTML=" ",l.appendChild(o),document.createElement("div")),_=(o.setAttribute("id","page_border_1"),o.setAttribute("class","page_border"),document.createElement("div")),c=(_.setAttribute("id","col_wrap_par_1"),_.setAttribute("class","col_wrap_par"),document.createElement("div")),m=(c.setAttribute("id","col_wrap_1"),c.setAttribute("class","col_wrap"),document.createElement("div"));m.setAttribute("id","col_wrap_1_col_1_insert_panel"),m.setAttribute("class","col_insert_panel insert_panel first_col"),m.setAttribute("onmouseover","setCurrentColumn('col_wrap_1_col_1_insert_panel')"),c.appendChild(m),_.appendChild(c),o.appendChild(_),i.appendChild(s),i.appendChild(o),i.appendChild(l),r.appendChild(a),r.appendChild(i),r.appendChild(d),n.appendChild(r),t.appendChild(n),resetPageSize(),document.getElementById("insert_data").innerHTML="",insert_panel_id="col_wrap_1_col_1_insert_panel",selected_container="str_cursor_str",container_id="str_cursor_str",insert_data_sel_cont=insert_panel_id,document.getElementById(insert_panel_id).appendChild(document.getElementById("str_cursor_str")),focusCursor(),paragraph_type=1,resetParagraphStyle(),insertParagraph(),updateUndoStack(),e&&resetUndoRedo(),class_count=0,opened_file_id=0,current_edit_exam_id=0,key_comb=[],document.getElementById("dc_data_form_submit").setAttribute("onClick","startSave('post')"),"reply"===submit_action&&(document.getElementById("dc_data_form_status").innerHTML="   Ready"),dc_mode="new"}function runCursor(){var e=(bg=getBackground("str_cursor_str")).replace("rgba(","").replace("rgb(","").replace(")","").split(","),t=e[0],n=e[1],e=e[2];"#6699ff"==("#"+decToHex(t)+decToHex(n)+decToHex(e)).toLowerCase()?setBackground("str_cursor_str","transparent"):setBackground("str_cursor_str","#6699ff"),cursor_timer=window.setTimeout("runCursor()",500)}function isToolbarShowing(){return"block"==document.querySelector("#dc_tool_bar").style.display}function showToolbar(e=!0){document.getElementById("dc_tool_bar").setAttribute("style","display:block"),prepareCursor(),$("#dc_parent_tab").css("top","4px"),$("#dc_parent_tab").css("left","4px"),(e?(document.getElementById("typesetting_view").checked=!0,displayTypesettingView):(document.getElementById("post_view").checked=!0,displayPostView))()}function hideToolbar(){document.getElementById("dc_tool_bar").setAttribute("style","display:none")}function prepareCursor(){focusCursor(),null==cursor_timer&&runCursor()}function setCursor(e=!0){if(resetCursor(),setContainer(),addListener(),cursor=document.getElementById("str_cursor_str"),add_paragraph=!1,add_paragraph=AddInsertObject(cursor,e),cont_bg=searchForBackground(container_id),color="",color=(col3=(col2=(col1=(text_color3=(text_color2=(text_color1=(third=cont_bg.trim().startsWith("rgba")||cont_bg.trim().startsWith("rgb")?(arr=cont_bg.replace("rgba(","").replace("rgb(","").replace(")","").split(","),first=arr[0],second=arr[1],arr[2]):(first=cont_bg.trim().substr(1,2),second=cont_bg.trim().substr(3,2),third=cont_bg.trim().substr(5,2),first=hexToDec(first)+"",second=hexToDec(second)+"",hexToDec(third)+""),createAltColor(first)),createAltColor(second)),createAltColor(third)),decToHex(text_color1)),decToHex(text_color2)),decToHex(text_color3)),"#"+col1+col2+col3),setBackground("str_cursor_str",color),cursor_background=color,setEqBorder(),null!=(prev_element=document.getElementById("str_cursor_str").previousElementSibling)?(insert_data_sel_cont=prev_element.id).endsWith("_root")&&(insert_data_sel_cont=insert_data_sel_cont.replace("_root","")):insert_data_sel_cont=document.getElementById("str_cursor_str").parentNode.id,add_paragraph&&insertParagraph(),rect=document.getElementById("str_cursor_str").getBoundingClientRect(),$("#select_handle_1").css("top",rect.top+"px"),$("#select_handle_1").css("left",rect.left-15+"px"),$("#select_handle_2").css("top",rect.top+"px"),$("#select_handle_2").css("left",rect.left-15+"px"),focusCursor(),par=document.getElementById("str_cursor_str").parentNode,1<(ch=par.childNodes).length){var n=[];for(let e=0;e(rect=element.getBoundingClientRect()).top&&r(rect=element.getBoundingClientRect()).top&&rrect.left&&nr&&null!=(t=element.previousElementSibling))return clickProcessor(t,n,r,!0);for(let e=0;en&&null!=(t=element.previousElementSibling))return clickProcessor(t,n,r,!0);if(null==t){if(e.id.endsWith(insert_panel_id)||e.id.endsWith("td")){p_id="",p_id=e.id.endsWith("td")?e.id+"_insert_panel":e.id,children=document.getElementById(p_id).childNodes;for(let e=0;e(rect=element.getBoundingClientRect()).top&&r(rect=element.getBoundingClientRect()).top&&rn?clickProcessor(el=e.firstChild,n,r,!0):clickProcessor(el=e.lastChild,n,r,!0)}}}function searchForClosestElement(e,t,n){try{for(el=[],el_arr=[],i=0;in)break;el_arr.push(element)}for(el_arr1=[],0prev_el.getBoundingClientRect().left));i--)el_arr1.push(el_arr[i]);for(i=el_arr1.length-1;-1t){el[0]="back",el[1]=current_el;break}return 0==el.length&&0cur_el_rect.top&&sel_eq_rect.bottom"),value="",parent_id=document.getElementById(e).parentNode.id,z=0;z"),prop_arr=props[0].split(" "),clss=prop_arr[prop_arr.length-1],""+n+""):data_arr[z],value=""==value?str:value.concat("",str);document.getElementById("insert_data").innerHTML=value}function orderElements(e){for(sorted=[],obj=null,oe=0;oeinsp_top&&my_el_bottomeventY||eventXX>eventX)for(para=a.childNodes,up_selected=!1,z=0;zeventY&&rec.left>eventX){for(j=i;jeventYY&&rec.left>eventXX){for(j=i;jeventX&&r.righteventY||r.lefteventXX&&r.topeventY||r.top>eventY&&r.bottomeventX&&r.righteventY&&r.bottomeventXX||r.right>eventX&&r.righteventYY||r.lefteventXX&&r.topeventYY)&&(selected_td_ids.push(n),addSelection(n.firstElementChild.id))}}function updateUndoStack(){0==selected_ids.length&&(html=document.getElementById(insert_panel_parent_id).innerHTML,data=document.getElementById("insert_data").parentNode.innerHTML,undo_html_stack.push(html),undo_insert_data_stack.push(data),undo_container_id_stack.push(container_id),undo_selected_container_stack.push(selected_container),undo_insert_data_sel_cont_stack.push(insert_data_sel_cont),undo_selected_ids_stack.push(selected_ids),undo_container_bg_stack.push(container_bg))}function undoEdit(){if(1
'+e+"
"}table+="",document.getElementById("open_panel").innerHTML=table,$("#open_panel_parent").css("display","block"),"undefined"==typeof loadCopy&&((sp=document.createElement("script")).setAttribute("src",equation_dir+"edit.js"),(parent=document.getElementsByTagName("head"))[0].appendChild(sp)),document.getElementById("dc_data_form_status").innerHTML="   Documents loaded."}function openFile(e,t){openFileSelect(e),document.getElementById("dc_data_form_status").innerHTML="   Please wait...opening "+t+".dc",(sp=document.createElement("script")).setAttribute("src","dc_openFile.php?id="+e),(parent=document.getElementsByTagName("head"))[0].appendChild(sp)}function openFileSelect(e){if(null!=document.getElementById(e)){for(files=document.getElementsByClassName("open_saved_file_list"),i=0;i
","\n")).replaceAll("

","\n")).replaceAll("
","\n")).replaceAll("
","\n"),document.getElementById("comment_form").comment.value=comment,$("#comment_div_hidden").text(comment),$("#comment").css("text-align","left"),$("#comment").css("font-size","14px"),document.getElementById("comment_form").Submit.value="Save",edit_document_type=doc_type,window.scrollTo(0,200)):1===doc_type?(full_id="edit_post_"+e[0].id,wrapper_div=$("#"+full_id+" div"),html=wrapper_div[0].innerHTML,edit_document_type=doc_type,setDCData(html,data)):alert("Loaded invalid document type!")}function extractEqId(e){e=e.split("_");return e[0]+"_"+e[1]+"_"+e[2]}function setDataPropValue(r,a,i){if(null!=r.getAttribute("data")){let e=r.getAttribute("data");var d;let t="",n=!1;for(d of e.split(";"))-1numberofqst.length)throw"Number of questions per user cannot be greater than the total number of questions.";exam_setup_type="original",submit_action="exam",$("#dc_data_form").submit()}else if(1==e){for(id_ar=[],arr=document.getElementsByClassName("edit_exam_chk_box"),i=0;iMore",td.setAttribute("align","center"),td.setAttribute("style","cursor:pointer"),tr.appendChild(td),document.getElementById("image_panel_list_tab").appendChild(tr))}else{for(n=document.getElementById("image_gallery_more"),(parent=n.parentNode).removeChild(n),i=0;iMore",td.setAttribute("align","center"),td.setAttribute("style","cursor:pointer"),tr.appendChild(td),document.getElementById("image_panel_list_tab").appendChild(tr))}}function insertImageFromDrive(e){isExamRunning()?alert("Sorry, you cannot open a file while you have an examination running. End all currently running examinations and try again."):(insert_image_from_drive_id=e,"undefined"==typeof Image2?((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src",equation_dir+"getImage.php?type=2"),document.getElementsByTagName("head")[0].appendChild(e)):Image2.createImage())}function showMore(){$(document.getElementById("more_panel")).css("display","block")}function showExamPanel(){$(document.getElementById("exam_panel_parent")).css("display","block")}function showPollPanel(){$(document.getElementById("poll_panel_parent")).css("display","block")}function showManagePanel(){$("#manage_panel").css("display","block")}function showGroupPanel(){$("#group_panel").css("display","block")}function showReportPanel(){$("#report_panel").css("display","block")}function showQuestionBankPanel(){$("#question_bank_panel_parent").css("display","block")}function showEditReportPanel(){$("#edit_report_panel_parent").css("display","block")}function showManageReportPanel(){$("#manage_report_panel_parent").css("display","block")}function showNewGroupPanel(){$("#group_panel").css("display","none"),$("#new_group_panel_parent").css("display","block")}function showManageclassroomPanel(){$("#manage_panel").css("display","none"),$("#manage_classroom_panel").css("display","block")}function showUploadMaterialPanel(){$("#manage_classroom_panel").css("display","none"),$("#upload_material_panel_parent").css("display","block")}function processPrivilege(){(sw=document.getElementById("privilege_switch").checked)?$(document.getElementById("more_panel_privilege")).css("display","block"):$(document.getElementById("more_panel_privilege")).css("display","none")}function showPanel(e){$(".panels").css("display","none"),$("#"+e).css("display","block")}function showCBTPanel(){showPanel("cbt_panel_parent"),showToolbar()}function changedCBTWizMode(e){"SET QUESTIONS"==e.value?(jQuery("#cbt_wiz_button").val("Proceed"),jQuery("#cbt_wiz_utme_div").css("display","none"),jQuery("#cbt_wiz_addmore_sub_div").css("display","block")):(jQuery("#cbt_wiz_button").val("Start Test"),jQuery("#cbt_wiz_utme_div").css("display","block"),jQuery("#cbt_wiz_standard").val("UTME"),jQuery("#cbt_wiz_addmore_sub_div").css("display","none"))}function changedCBTWizPracticeStandard(e){e=e.value;coverScreen(),(sp=document.createElement("script")).setAttribute("src","dc_get_qst_bank_subjects.php?stan="+escape(e)+"&callback=processChangedCBTWizPracticeStandard"),(parent=document.getElementsByTagName("head"))[0].appendChild(sp)}function processChangedCBTWizPracticeStandard(e,t){uncoverScreen(),t.length}function changedCBTWizUTMESub(e){var t,n=[];for(t of document.getElementsByClassName("cbt_wiz_utme_sub")){var a=t.parentNode.nextElementSibling.getElementsByTagName("span")[0];if(1==t.checked){if(4==n.length)return shootDisplayDialog("Message","Sorry, you cannot selected more than four (4) subjects for a UTME practice.",{width:"300px"}),!1;n.push(a.innerText)}}}function changedCBTWizSetQstStandard(e){var t=e.value,e={select_id:e.id};coverScreen(),(sp=document.createElement("script")).setAttribute("src","dc_get_qst_bank_subjects.php?stan="+escape(t)+"&callback=processChangedCBTWizSetQstStandard&callback_data="+escape(JSON.stringify(e))),(parent=document.getElementsByTagName("head"))[0].appendChild(sp)}function processChangedCBTWizSetQstStandard(e,t,n){if(uncoverScreen(),0Note: English has already been selected for you.",{width:"300px"}):(r.join(),document.getElementById("cbt_wiz_lit_text1").value==document.getElementById("cbt_wiz_lit_text2").value?shootDisplayDialog("Message","Sorry, you cannot select the same literature texts for this assessment.",{width:"300px"}):startExamExternal(179,"Option#10"))}else hideToolbar(),dispExam();else if("Proceed"==t.value){var o,a=document.getElementById("cbt_wiz_section").value,t=document.getElementById("cbt_wiz_colno").value,i=document.getElementById("cbt_wiz_opt_type").value,s=document.getElementById("cbt_wiz_qst_shuffle").value,l=[];let e=0;for(o of document.getElementsByClassName("cbt_wiz_addmore_item")){var d=o.id.split("_")[4],c=document.getElementById("cbt_wiz_addmore_stan_"+d).value,_=document.getElementById("cbt_wiz_addmore_sub_"+d).value,u=document.getElementById("cbt_wiz_addmore_top_"+d).value,d=document.getElementById("cbt_wiz_addmore_qstno_"+d).value;if("--"!=_&&"--"!=u)if(""==d.trim()){if(!window.confirm("Number of questions for "+u+" is missing. Do you wish to continue?"))return!1}else l.push({stan:c,sub:_,top:u,qstno:d}),e+=parseInt(d)}0"+t+" "+u+"",n.appendChild(p),t%10==0&&(n=document.createElement("tr"),c.appendChild(n)),t++}document.getElementById(insert_panel_parent_id).getElementsByClassName("read_ans_obj")[0].getElementsByClassName("dumb_insert")[0].appendChild(c)}loadAssocFiles(insert_panel_parent_id,0),uncoverScreen()}hideTopicIdTables(insert_panel_parent_id),hideQuestionOptions(insert_panel_parent_id),hideQuestionFooters(insert_panel_parent_id),hideQuestionHints(insert_panel_parent_id)}}};function processQstGroupTitles(t){var n;for(n of document.getElementById(t).getElementsByClassName("exam_qst_fset")){var a=n.previousElementSibling;if(null!=a&&0
',AddInsertObject(n),document.getElementById("insert_data")),a=n.value;a=a.trim(),insert_data="
"+e+";"+t+"",new_cont_id=container_id,sel_cont_id=selected_container,a=AddInsertData(a,insert_data,new_cont_id,insert_data_sel_cont),container_id=t,selected_container=container_id,setCursor(),container_id="str_cursor_str",focusCursor(),updateUndoStack(),""!=t&&(a=a+""+("")),n.innerHTML=a}function copyHR(e,t,n,a){a=a.replace("_root","");var r=(new Date).getTime()-delta_time+loop_time_padding;return r<0?alert("Please set the time on your computer before using the equation features!"):(new_hr_id=a.endsWith("1")?"hr_"+username+"_"+r+"_hr1":"hr_"+username+"_"+r+"_hr2",e=(e=(e=e.replace(a+"_root",new_hr_id+"_root")).replace(a,new_hr_id)).replace(a,new_hr_id),pasting&&(insert_data_parent=document.getElementById("insert_data"),value=(value=insert_data_parent.value).trim(),insert_data="
"+t+";"+new_hr_id+"",value=AddInsertData(value,insert_data,t,n),null!=document.getElementById(a).getAttribute("style")&&(style=document.getElementById(a).getAttribute("style"),style="",value=value+""+style),document.getElementById("insert_data").innerHTML=value)),e}function closePostPopup(e){div_id=e+"_popup",$(document.getElementById(div_id)).css("display","none")}function arrowRight(){var e,t,n=document.getElementById("str_cursor_str").parentNode;0===n.lastChild.id.indexOf("str_cursor_str")?null!=(t=n.nextElementSibling)?appendCursorToParagraph(t,!0):null!=(e=(t=n.parentNode).nextElementSibling)?appendCursorToColumn(e,!0):null!=(t=(e=t.parentNode).nextElementSibling)?appendCursorToColumn(t.getElementsByClassName("col_insert_panel")[0],!0):null!=(t=e.parentNode.parentNode.parentNode.nextElementSibling)&&appendCursorToColumn(t.getElementsByClassName("page_border")[0].getElementsByClassName("col_wrap_par")[0].getElementsByClassName("col_wrap")[0].getElementsByClassName("col_insert_panel")[0],!0):(curs=document.getElementById("str_cursor_str"),null!=(next=curs.nextElementSibling)&&(n.insertBefore(next,curs),selected_container=next.id,insert_data_sel_cont=next.id,focusCursor())),scrollCursorIntoView()}function appendCursorToParagraph(e,t=!1){insert_data_sel_cont=t?(t=e.firstElementChild,selected_container=(null!=t?e.insertBefore(document.getElementById("str_cursor_str"),t):(e.innerHTML="",e.appendChild(document.getElementById("str_cursor_str"))),"str_cursor_str"),e.id):null!=e.lastElementChild?(t=document.getElementById("str_cursor_str"),e.appendChild(t),selected_container="str_cursor_str"):(e.innerHTML="",e.appendChild(document.getElementById("str_cursor_str")),selected_container="str_cursor_str",e.id),container_id=e.id,setCursor()}function appendCursorToColumn(e,t=!1){setCurrentColumn(e.id);let n=null;null==(n=t?e.firstElementChild:e.lastElementChild)&&(e.innerHTML="",n=createParagraph(e.id,e.id),e.appendChild(n)),appendCursorToParagraph(n,t)}function arrowLeft(){var e,t;parent=document.getElementById("str_cursor_str").parentNode,0==(first=parent.firstChild).id.indexOf("str_cursor_str")?null!=(prev_p=parent.previousElementSibling)?appendCursorToParagraph(prev_p):null!=(e=(t=parent.parentNode).previousElementSibling)?appendCursorToColumn(e):null!=(t=(e=t.parentNode).previousElementSibling)?appendCursorToColumn((t=t.getElementsByClassName("col_insert_panel"))[t.length-1]):null!=(t=e.parentNode.parentNode.parentNode.previousElementSibling)&&appendCursorToColumn((t=(e=t.getElementsByClassName("page_border")[0].getElementsByClassName("col_wrap_par")[0].getElementsByClassName("col_wrap"))[e.length-1].getElementsByClassName("col_insert_panel"))[t.length-1]):(curs=document.getElementById("str_cursor_str"),null!=(prev=curs.previousElementSibling)&&(parent.insertBefore(curs,prev),prev=document.getElementById("str_cursor_str").previousElementSibling,insert_data_sel_cont=null!=prev?(selected_container=prev.id,prev.id):(container_id=document.getElementById("str_cursor_str").parentNode.id,selected_container="str_cursor_str",container_id),focusCursor())),scrollCursorIntoView()}function arrowUp(){if(curs=document.getElementById("str_cursor_str"),curs_rect=curs.getBoundingClientRect(),parent=curs.parentNode,children=parent.childNodes,el_arr=[],"str_cursor_str"!=(first=parent.firstElementChild).id){let t=!1;for(let e=children.length-1;-1curs_rect.top&&t.getBoundingClientRect().left>=curs_rect.left){if(null!=(prev=t.previousElementSibling)){next=t,parent.insertBefore(curs,next),prev=document.getElementById("str_cursor_str").previousElementSibling,selected_container=prev.id,insert_data_sel_cont=prev.id,focusCursor(),e=!0;break}alert("");break}}e||arrowRight()}else arrowRight();scrollCursorIntoView()}function setAlign(t){var e=document.getElementById("insert_data");let n=e.value;if(0"),t="";for(let e=0;e"),o=data_arr[e].substring(r+1),d_a=o.split(";"),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==n)&&(offset=(offset=data_arr[e].substring(0,r)).replace("left",a).replace("center",a).replace("right",a).replace("justify",a),data=offset+">"+o,data_arr[e]=data),""==t?data_arr[e]:t+""+data_arr[e])}}return t}function processTab(e){var t=jQuery("#dc_tool_bar").css("width");"home"==e?(jQuery(".tools_tab_div").css("display","none"),$("#home_tab").css("display","flex"),jQuery(".tools_tab_title").removeClass("active_tab"),jQuery("#home_td").addClass("active_tab")):"insert"==e?(jQuery(".tools_tab_div").css("display","none"),$("#insert_tab").css("display","flex"),jQuery(".tools_tab_title").removeClass("active_tab"),jQuery("#insert_td").addClass("active_tab")):"format_table"==e?(jQuery(".tools_tab_div").css("display","none"),$("#format_table_tab").css("display","flex"),jQuery(".tools_tab_title").removeClass("active_tab"),jQuery("#format_table_td").addClass("active_tab")):"more"==e?(jQuery(".tools_tab_div").css("display","none"),$("#more_tab").css("display","flex"),jQuery(".tools_tab_title").removeClass("active_tab"),jQuery("#more_td").addClass("active_tab")):"layout"==e&&(jQuery(".tools_tab_div").css("display","none"),$("#layout_tab").css("display","flex"),jQuery(".tools_tab_title").removeClass("active_tab"),jQuery("#layout_td").addClass("active_tab")),jQuery("#dc_tool_bar").css("width",t)}function addClassName(e,t,n){for(new_insert_data="",data_arr=document.getElementById("insert_data").value.split(data_separator),class_exists=!1,i=0;i"),(subst=(subst=data_arr[i].substring(a+1)).replace("","")).trim().toLowerCase()==n.trim().toLowerCase())?(left=data_arr[i].substring(0,a),my_ar=left.split(" "),names=my_ar[my_ar.length-1],new_names=sortClassNames(new_names=names+","+t),new_data="",new_insert_data+=""==new_insert_data?new_data:data_separator+new_data,class_exists=!0):new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i]}class_exists||(style="",new_insert_data+=""==new_insert_data?style:data_separator+style),document.getElementById("insert_data").innerHTML=new_insert_data}function addClassNameSelection(e,t,n){for(new_insert_data="",data_arr=document.getElementById("insert_data").value.split(data_separator),class_exists=!1,i=0;i");if(subst=(subst=data_arr[i].substring(a+1)).replace("",""),left=data_arr[i].substring(0,a),my_ar=left.split(" "),(names=my_ar[my_ar.length-1])==t){for(left=data_arr[i].substring(0,a),array=subst.split(";"),subst="",prop_ar=n.split(":"),m=0;m"+subst+";"+n+"",new_insert_data+=""==new_insert_data?new_data:data_separator+new_data,class_exists=!0}else new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i]}else new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i];class_exists||(style="",new_insert_data+=""==new_insert_data?style:data_separator+style),document.getElementById("insert_data").innerHTML=new_insert_data}function sortClassNames(e){return(arr=e.split(",")).sort()}function startSetFont(){setFont(),updateUndoStack()}function startSetFontSize(){setFontSize(),updateUndoStack()}function startSetFontColor(){setFontColor(),updateUndoStack()}function startSetFontWeight(){setFontWeight(),updateUndoStack()}function startSetFontStyle(){setFontStyle(),updateUndoStack()}function startSetFontUnderline(){setUnderline(),updateUndoStack()}function startSetFontStrike(){setStrike(),updateUndoStack()}function setFontSize(){for(val=document.dc_data_form.font_size_select.value,arr=font_style.split(";"),font_style="",isset=!1,i=0;i"),i=0;i"),n=data_arr[i].substring(0,t),d_a=n.split(" "),(main_id=d_a[2])==e)&&(class_name=d_a[3].replace(">","").trim());else if(e.startsWith("eq")||e.startsWith("tbl")||e.startsWith("hr")||e.startsWith("img")||e.startsWith("vid")||e.startsWith("p_")||e.startsWith("div_"))for(data_arr=value.split(""),i=0;i"),n=data_arr[i].substring(t+1),d_a=n.split(";"),chk=document.getElementById(d_a[0]),(main_id=d_a[1].substring(0,d_a[1].lastIndexOf("<")))==e)&&(n=data_arr[i].substring(0,t),d_a=n.split(" "),name=d_a[d_a.length-1].replace(">",""),class_name=name)}return class_name}function removePropertyFromChildren(e,t,n){for(new_insert_data="",data_arr=document.getElementById("insert_data").value.split(data_separator),class_exists=!1,i=0;i");for(left=data_arr[i].substring(0,a),my_ar=left.split(" "),names=my_ar[my_ar.length-1],p_children="",classname_arr=names.split(","),z=0;z",""),prop_arr=properties.split(";"),z=0;z"+new_props+"",new_insert_data+=""==new_insert_data?new_style:data_separator+new_style);else{for(children_ar=p_children.split(","),names_ar=names.split(","),new_names="",z=0;z"+properties+"",new_insert_data+=""==new_insert_data?new_style:data_separator+new_style,""!=(new_props=removePropertyFromStyle(properties,t))&&(new_style=my_ar[0]+" "+my_ar[1]+" "+p_children+">"+new_props+"",new_insert_data+=""==new_insert_data?new_style:data_separator+new_style)}else new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i]}else new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i]}else new_insert_data+=""==new_insert_data?data_arr[i]:data_separator+data_arr[i];document.getElementById("insert_data").innerHTML=new_insert_data}function getParentIDFromClassName(e){for(par_id="",dat=document.getElementById("insert_data").value.split(data_separator),y=0;y"),(lef=dat[y].substring(0,t)).replace(" ","").endsWith(e)&&(lef.startsWith(""),y=0;y"),sub=d_arr[y].substring(0,ind),ar=sub.split(" "),(cls=ar[ar.length-1])==e)&&(d_arr[y].startsWith(""),sub=d_arr[y].substring(ind+1),ar=sub.split(";"),el_id=ar[1].substring(0,ar[1].lastIndexOf("<"))));return el_id}function removePropertiesExceptAlign(e){$("#"+e).css("text-decoration","none")}function changeParagraphType(e,t,n,a){for(old_paragraph=document.getElementById(e),par=old_paragraph.parentNode,(new_paragraph=document.createElement(a)).innerHTML=old_paragraph.innerHTML,alignment=old_paragraph.getAttribute("align"),new_paragraph.setAttribute("id",t),new_paragraph.setAttribute("align",alignment),par.replaceChild(new_paragraph,old_paragraph),data=document.getElementById("insert_data").value,data_arr=data.split(data_separator),data="",x=0;x")&&(data_arr[x]=data_arr[x].replace("<"+n+" ","<"+a+" "),data_arr[x]=data_arr[x].replace("","")),data+=""==data?data_arr[x]:data_separator+data_arr[x];for(data_arr=data.split(e),x=0;x"+t+""),t=""),processArabic(e,t,n=n.concat(r.substring(0,1)),r=1"+t+""):""!==n&&(e=e.concat(n)),-1"))for(ar=e.split("
"),e="",a=0;a"+ar[a]+""):e.concat("
"+ar[a]+"
");else e="
"+e+"
";return e}catch(e){return""}}function processHtmlForSharing(){tds=document.getElementById(insert_panel_parent_id).getElementsByTagName("td");try{var n,a,r,o,s=[];for(let e=0;e").join("")).replaceAll("background-color: rgba(0, 0, 0, 0)","background-color: none")}function getParagraphsWithFullPercentHeightChildren(e){var e=e.concat("_insert_panel"),t=[];if(document.getElementById(e))for(para of document.getElementById(e).childNodes)for(child of para.childNodes)if("#text"!=child.nodeName.toLowerCase()&&"text"!=child.nodeName.toLowerCase())for(img of child.getElementsByTagName("img")){var n=getHeight(img.getAttribute("style"));n&&n.endsWith("%")&&t.push(para)}return t}function getPixelHeightFromAncestor(e,t){var n;return e.id==insert_panel_id?t:(n=jQuery(e).css("height"),jQuery(e).css("padding"),n&&null!=jQuery(e).parent().attr("id")&&n.endsWith("px")?(n=parseInt(n.replace("px","")),getPixelHeightFromAncestor(e.parentNode,tYes"),t=t.concat(""+n+""+obj.date_time+""+obj.referrer+""+obj.desc+""+obj.amount+""+e+""),n++}t=t.concat("");var a=.95*window.innerWidth,r=.9*window.innerHeight;shootDisplayDialog("Bonuses",t,{width:a+"px",height:r+"px"})}else shootDisplayDialog("Message",e.msg,{width:"250px"})}};function claimBonus(e){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/wallets/claim_bonus.php?id="+e;shootFetch({url:e})}let processClaimBonus={execute:function(e){uncoverScreen(),shootDisplayDialog("Message",e.msg,{width:"250px"})}};function getENairaWalletInfo(){coverScreen();var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src","wallets/enaira_get_wallet_info.php"),document.getElementsByTagName("head")[0].appendChild(e)}function processGetENairaWalletInfo(e){0===e.code&&($("#enaira_wallet_balance").val(e.balance),$("#enaira_wallet_alias").val(e.alias),$("#enaira_wallet_nuban").val(e.nuban),$("#enaira_wallet_email").val(e.email),$("#enaira_wallet_address").val(e.address)),uncoverScreen()}function getEUTOWalletInfo(){var e;coverScreen(),"not configured"==wallet_status?($(document.getElementById("wallet_config_form_parent")).css("display","block"),$(document.getElementById("wallet_task_panel")).css("display","none"),$(document.getElementById("wallet_display_div")).css("display","block"),$(document.getElementById("wallet_display_div_content")).css("display","block")):((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src","dc_openWallet.php"),document.getElementsByTagName("head")[0].appendChild(e))}function isAnswerSet(e){var t=exam_answers.split(",");for(i=0;i"+getDownloadMobileAppMsg());shootDisplayDialog("Message",e,{width:"360px"}),"yes"===t.start&&(document.getElementById(t.eq_id+"_but").value="Click to start",document.getElementById(t.eq_id+"_but").setAttribute("onClick","startExam('"+t.eq_id+"',"+t.exam_id+")"))}function startEditExams(){var e;isExamRunning()?alert("Sorry, you cannot open a file while you have an examination running. End all currently running examinations and try again."):""===document.getElementById("edit_exam_panel").innerHTML.trim()?(document.getElementById("dc_data_form_status").innerHTML="   Please wait...loading saved exams.",(e=document.createElement("script")).setAttribute("src","dc_start_edit_exam.php"),document.getElementsByTagName("head")[0].appendChild(e)):$(document.getElementById("edit_exam_panel_parent")).css("display","block")}function procStartEditExam(e,t){for(table="",i=0;i";table+="
"+t[i].title+"
"+t[i].subtitle+"
",document.getElementById("edit_exam_panel").innerHTML=table,$(document.getElementById("edit_exam_panel_parent")).css("display","block"),document.getElementById("dc_data_form_status").innerHTML="   Saved exams loaded."}function editExam(e){document.getElementById("dc_data_form_status").innerHTML="   Please wait...loading files.","undefined"==typeof loadCopy&&((t=document.createElement("script")).setAttribute("src",equation_dir+"edit.js"),(n=document.getElementsByTagName("head"))[0].appendChild(t));var t=document.createElement("script"),n=(t.setAttribute("src","dc_edit_exam.php?exam_id="+e),document.getElementsByTagName("head"));n[0].appendChild(t)}function procEditExam(e,t){document.getElementById("dc_data_form_status").innerHTML="   Editing "+t.subtitle+", created on "+t.post_date,document.exam_form.reset(),current_edit_exam_id=t.exam_id,document.exam_form.costperseating.value=t.costperseating,document.exam_form.attach_sub.value=t.sub_name,document.exam_form.exam_channel.value=t.channel,document.exam_form.cbt_qst_src.value=t.cbt_qst_src,2==t.cbt_qst_src?document.exam_form.cbt_qst_src_docs.value=t.cbt_qst_src_docs:3==t.cbt_qst_src&&(n=JSON.parse(t.cbt_qst_src_docs),document.exam_form.cbt_qst_src_sub.value=n.sub,document.exam_form.cbt_qst_src_top.value=n.top,document.exam_form.cbt_qst_src_standard.value=n.stan,document.exam_form.cbt_qst_src_section.value=n.sec),document.exam_form.title.value=t.title,document.exam_form.subtitle.value=t.subtitle;var n,a,r=t.group.split(",");for(let e=0;e"+h+"h:"+m+"m:"+s+"s"),$("#exam_instruction").html(''+t.instruction+""),$("#exam_start_time").text(t.start),$("#exam_stop_time").text(t.stop),document.getElementById("exam_duration").setAttribute("id","exam_duration_"+n),document.getElementById("exam_instruction").setAttribute("id","exam_instruction_"+n),document.getElementById("exam_start_time").setAttribute("id","exam_start_time_"+n),document.getElementById("exam_stop_time").setAttribute("id","exam_stop_time_"+n);t.running_mode;var r=createExamGroupNavBar(t.group,n);if($("#group_container").append(r),$("#group_container").attr("id","group_container_"+n),exam_groups.push(t.group),$("#obj_container").html(question),document.getElementById("obj_container").setAttribute("id","exam_paper_"+n+"_content"),$("#question_map_par").append(getQuestionMap(n,t.questionperuser)),document.getElementById("question_map_par").setAttribute("id","question_map_par_"+n),$("#essay_container").html(t.attach_file),document.getElementById("essay_container").setAttribute("id","essay_container_"+n),arr=question.split("\x3c!--page boundary--\x3e"),tab=(tab='')+('")+"
Page 1 of '+arr.length+"
",$("#obj_container_nav").html(tab),$("#obj_container_nav_right").html("Started"),document.getElementById("obj_container_nav").setAttribute("id","obj_container_nav_"+n),document.getElementById("obj_container_nav_right").setAttribute("id","obj_container_nav_right_"+n),$("#nav_cont_first").attr("onclick","displayFirstPage('"+n+"')"),$("#nav_cont_previous").attr("onclick","displayPreviousPage('"+n+"')"),$("#nav_cont_next").attr("onclick","displayNextPage('"+n+"')"),$("#nav_cont_last").attr("onclick","displayLastPage('"+n+"')"),$("#nav_cont_submit").attr("onclick","submitExamButton('"+n+"',"+n+",'perm')"),$("#nav_cont_share").attr("onclick","shareExamQst("+n+")"),$("#ans_essay_container").attr("onclick","answerEssay('"+n+"')"),$("#prev_exam_container").attr("onclick","dispPrevExam('"+n+"')"),$("#next_exam_container").attr("onclick","dispNextExam('"+n+"')"),$("#hide_exam_container").attr("onclick","hideExam('"+n+"')"),$("#ex_goto_form").attr("onsubmit","return goToPage(event,this,'"+n+"')"),document.getElementById("nav_cont_first").setAttribute("id","nav_cont_first_"+n),document.getElementById("nav_cont_previous").setAttribute("id","nav_cont_previous_"+n),document.getElementById("nav_cont_next").setAttribute("id","nav_cont_next_"+n),document.getElementById("nav_cont_last").setAttribute("id","nav_cont_last_"+n),document.getElementById("nav_cont_submit").setAttribute("id","nav_cont_submit_"+n),document.getElementById("nav_cont_share").setAttribute("id","nav_cont_share_"+n),document.getElementById("ans_essay_container").setAttribute("id","ans_essay_container_"+n),document.getElementById("prev_exam_container").setAttribute("id","prev_exam_container_"+n),document.getElementById("next_exam_container").setAttribute("id","next_exam_container_"+n),document.getElementById("hide_exam_container").setAttribute("id","hide_exam_container_"+n),document.getElementById("ex_goto_form").setAttribute("id","ex_goto_form_"+n),current_exams.push(n),exam_remove_qst.push(n+":"+t.remove_qst),"No"==t.show_w)for(parent=document.getElementById("exam_paper_"+n+"_content"),act_exam_wks=parent.getElementsByClassName("act_exam_wk"),i=0;i"+h+"h:"+m+"m:"+s+"s",$("#count_down_container").html(cnt_str),document.getElementById("count_down_container").setAttribute("id","count_down_container_"+n),rem_duration=t.rem_duration,curDate=new Date,curYear=curDate.getFullYear(),curMonth=curDate.getMonth()+1,curDate=curDate.getDate(),date_diff=Math.abs(new Date(curYear+"/"+curMonth+"/"+curDate)),arr=rem_duration.split(":"),h=+arr[0],m=+arr[1],s=+arr[2],dys=Math.floor(h/24),rem_hrs=h-24*dys,(end_tm=0)t.questionperdisplay&&loadExamPage(n,2,!1)}else alert(e);uncoverScreen()}function addPageBoundaries(t,n,e,a){var r=Math.ceil(e/a);let o="";for(let e=0;e'+n+"":o.concat('\x3c!--page boundary--\x3e')}return'
'+o+"
"}function getQuestionMap(t,n){var a=document.createElement("div");for(let e=0;earr.length?-1:arr.length<2?e:($(".exam_page_"+t).css("display","none"),$("#exam_page_"+t+"_"+n).css("display","inline"),null==document.getElementById("exam_page_"+t+"_"+n).firstElementChild&&loadExamPage(t,n,!0),loadExamPage(t,n+1,!1),e=document.getElementById("exam_paper_"+t+"_content").firstElementChild.innerHTML.trim())}catch(e){return-1}}function loadExamPage(e,t,n){isExamSubmitted(e)?null==document.getElementById("exam_page_"+e+"_"+t).firstElementChild&&(document.getElementById("exam_page_"+e+"_"+t).innerHTML="Sorry, this test session has ended!"):t<=document.getElementsByClassName("exam_page_"+e).length&&null==document.getElementById("exam_page_"+e+"_"+t).firstElementChild&&(e=window.location.protocol+"//"+document.domain+"/dc/dc_exam_load_page.php?exam_id="+e+"&page="+t+"&display="+n,shootFetch({url:e}))}let processLoadExamPage={execute:function(e){var t,n,a,r;"true"==e.successful?(t=e.page,n=e.exam_id,a=e.display,r=e.question,jQuery("#exam_page_"+n+"_"+t).html(r),reNumberQuestionsV2(n),"true"==a&&(jQuery(".exam_page_"+n).css("display","none"),jQuery("#exam_page_"+n+"_"+t).css("display","block")),reCheckAnswers(n),0t+1&&startExam("",a[t+1].id,"auto");break}}}function submitExamTemp(){for(data_exist=!1,ch=document.getElementById(insert_panel_id).childNodes,i=0;i").concat(getDownloadMobileAppMsg())):document.getElementById("essay_container_"+e).innerHTML=t.concat("
").concat(getDownloadMobileAppMsg()).concat(document.getElementById("essay_container_"+e).innerHTML))}function answerEssay(e){showToolbar()}function manageClassrooms(){myClassroom()}function manageExams(){myClassroom()}function myClassroom(){coverScreen(!0);var e=document.createElement("script");e.setAttribute("src","dc_classroom.php?"),document.getElementsByTagName("head")[0].appendChild(e)}function procClassroom(e,t){if(uncoverScreen(),"success"==e){for(str="",str+="",i=0;i";str+="
S/NDATETITLESUBTITLEQST SRCCHANNELGROUPSSTART TIMESTOP TIMEDURATION
"+(i+1)+""+t[i].date+""+t[i].title+""+t[i].subtitle+""+t[i].cbt_qst_src+""+t[i].channel+""+t[i].groups+""+t[i].start+""+t[i].stop+""+t[i].duration+"
",document.getElementById("result_display_div_content").innerHTML=str,$("#result_display_div").css("display","block"),$("#classroom_back_but").css("display","none")}}function managePolls(){}function getApplicants(e){coverScreen(!0);var t=document.createElement("script");t.setAttribute("src","dc_getapplicants.php?exam_id="+e),document.getElementsByTagName("head")[0].appendChild(t)}function procApplicants(e,t,n,a){if(uncoverScreen(),"success"==e){for(tab="
"+n+"
"+a+"
  <<  <  >  >>  
",tr1="",tab+=tr1,i=0;i",tab+=tr2;tr2="
S/NUSERNAMEPHONESCORESTART TIMEDURATIONTMP SCORETMP DURATIONESSAYPRINTFILESSTATUSACTIONATTEMPTCOMMENTRESET
  "+(i+1)+""+t[i].user+""+t[i].phone+""+t[i].score+""+t[i].start+""+t[i].duration+""+t[i].temp_score+""+t[i].temp_duration+"
View
Print
 "+t[i].stat+"
'+act_text+"
"+t[i].attempt+""+t[i].comment+"
Re-take
  <<  <  >  >>  
Check All
Approve
Reject
Pend
Print
Re-take
',tab,tab=tab+""+tr2+"
",$("#res_root_tab").css("display","none");n=document.getElementById("result_tab");null!=n&&document.getElementById("result_display_div_content").removeChild(n),document.getElementById("result_display_div_content").innerHTML=document.getElementById("result_display_div_content").innerHTML+tab+'
',$("#classroom_back_but").css("display","block")}else alert(e)}function proResultTabCheckAll(){var e,t;if(document.querySelector("#res_tab_check_all").checked)for(e of document.getElementById("result_tab").getElementsByClassName("res_tab_check"))e.checked,e.checked=!0;else for(t of document.getElementById("result_tab").getElementsByClassName("res_tab_check"))t.checked=!1}function backToClassrooms(){$("#res_root_tab").css("display","block"),$("#result_tab").css("display","none"),$("#classroom_back_but").css("display","none")}function transferFund(){pay1=document.wallet_transfer_form.pay_amount1.value,pay2=document.wallet_transfer_form.pay_amount2.value,pay1!=pay2?alert("Please check transfer amount entered."):$("#wallet_transfer_form").submit()}function appAction(t,e,n){var a=getSelectedApplicants();if(""==e&&""==a){let e=!1;if(!(e="Approve All"==t?window.confirm("You have chosen to approve all applicants for this test. Do you wish to continue?"):"Reject All"==t?window.confirm("You have chosen to reject all applicants for this test. Do you wish to continue?"):window.confirm("You have chosen to pend all applicants for this test. Do you wish to continue?")))return}coverScreen(),e=escape(e),t=escape(t),selected=escape(a);var r=document.createElement("script");r.setAttribute("src","dc_appaction.php?exam_id="+n+"&user="+e+"&act="+t+"&selected="+a),document.getElementsByTagName("head")[0].appendChild(r),r.onload=function(e){uncoverScreen()}}function getSelectedApplicants(){let e="";var t,n;for(t of document.getElementById("result_tab").getElementsByClassName("res_tab_check"))t.checked&&(n=t.parentNode.parentNode.getElementsByClassName("res_tab_user")[0],e=""==e?n.innerText:e+","+n.innerText);return e}function procAppAction(e,t,n){e.startsWith("success::")?(alert(e.replace("success::","")),""==t?getApplicants(n):"Pending"==document.getElementById("res_tab_stat_"+t).innerHTML||"Rejected"==document.getElementById("res_tab_stat_"+t).innerHTML?(document.getElementById("res_tab_stat_"+t).innerHTML="Approved",document.getElementById("res_tab_"+t).innerHTML="Reject",document.getElementById("res_tab_"+t).setAttribute("onclick","appAction('Reject','"+t+"',"+n+")")):(document.getElementById("res_tab_stat_"+t).innerHTML="Rejected",document.getElementById("res_tab_"+t).innerHTML="Approve",document.getElementById("res_tab_"+t).setAttribute("onclick","appAction('Approve','"+t+"',"+n+")"))):alert(e)}function viewEssay(e,t){clearScreen(),$("#dc_tool_bar").css("display","block"),document.getElementById("dc_data_form_status").innerHTML="Please wait...Loading essay by "+t,"undefined"==typeof loadCopy&&((n=document.createElement("script")).setAttribute("src",equation_dir+"edit.js"),(a=document.getElementsByTagName("head"))[0].appendChild(n));var n=document.createElement("script"),a=(n.setAttribute("src","dc_view_essay.php?exam_id="+e+"&user="+t),document.getElementsByTagName("head"));a[0].appendChild(n)}function procViewEssay(e,t){"success"===e?(""!==(act_html=t.data)&&(arr=act_html.split("SRCWID--\x3e"),arr1=arr[1].split("\x3c!--SRCWID"),act_html=arr1[0],""!==(act_data=t.insert_data)&&(act_data=(arr=act_data.split("SRCWID--\x3e"))[1]),document.getElementById("cursor_container").appendChild(document.getElementById("str_cursor_str")),document.getElementById(insert_panel_id).innerHTML=act_html,document.getElementById("insert_data").innerHTML=act_data,normalize(insert_panel_parent_id,!1),null!=(last=document.getElementById(insert_panel_id).lastChild)&&(container_id=last.id,last_child=last.lastElementChild,insert_data_sel_cont=null!=last_child?(selected_container=last_child.id,last_child.id):(last.innerHTML="",selected_container="str_cursor_str",container_id),last.appendChild(document.getElementById("str_cursor_str"))),setCursor(),updateUndoStack(),showToolbar(),alignEquation(),ids=[],$("#"+insert_panel_id+" [id]").each(function(){ids.push(this.id),loadCopy(this.id)})),document.getElementById("dc_data_form_status").innerHTML="Editing essay by "+t.user):alert(e)}function retakeExam(e,t){alert(e+" "+t)}function creditUser(e){alert(e)}function createChatDiv(e){return ar=document.getElementsByClassName(e+"_fullname"),fullname=ar[0].innerHTML,ar=document.getElementsByClassName(e+"_lv_in"),state=ar[0].innerHTML,ar=document.getElementsByClassName(e+"_wk_plc"),work=ar[0].innerHTML,div=document.createElement("div"),text="
"+fullname+"
Lives in "+state+"
Works @ "+work+"
",div.innerHTML=text,(chat_div=document.createElement("div")).setAttribute("style","overflow-x:hidden"),chat_div.appendChild(div),chat_div.setAttribute("id",e+"_chat_div"),$(chat_div).css("display","none"),document.body.appendChild(chat_div),(span=document.createElement("span")).setAttribute("id",e+"_sending"),document.getElementById("chat_status_td").appendChild(span),chat_div}function showEditProfileDisplay(){link=window.location.protocol+"//"+document_root+"dc/dc_edit_p2.php",document.getElementById("share_frame").setAttribute("src",link),showPopupDisplay("share_display_div")}function showDashboard(){link="dc_admin_v2.php?action=login",document.getElementById("share_frame").setAttribute("src",link),showPopupDisplay("share_display_div")}function borrowCourse(){alert("Sorry, borrowing of course has been suspended for now, thank you.")}function showChatDisplay(e){"mobile_app"!=user_agent&&(document.getElementById("chat_not_sp").innerHTML="0",$("#chat_not_sp").css("display","none")),$("#chat_icon_div").css("display","none"),active_chat_exists=!0,$("."+e.toLowerCase()+"_new_msg").removeClass("new_msg_active"),auto_scroll_chat=!0,$("#chat_display_div").css("display","block"),e=e.toLowerCase(),document.getElementById("act_chat_user").value=e,null!==(child=document.getElementById("chat_disp_main_td_div_cont").firstElementChild)&&($(child).css("display","none"),document.body.appendChild(child)),null!==document.getElementById(e+"_chat_div")?(document.getElementById("chat_disp_main_td_div_cont").appendChild(document.getElementById(e+"_chat_div")),$("#"+e+"_chat_div").css("display","block"),document.getElementById(e+"_chat_div").childNodes.length<20&&getChats(e,"old")):(myDiv=createChatDiv(e),$(myDiv).css("display","block"),document.getElementById("chat_disp_main_td_div_cont").appendChild(myDiv),getChats(e,"old"))}function startLecture(){(window.confirm("Do you wish to start a live lecture?")?showLectureDisplayLive:showLectureDisplay)()}function showLectureDisplay(){$(".post_tools_tab").css("display","none"),content_box=((""===document.getElementById("lecture_disp_main_td_div_cont").innerHTML.trim()||null!==document.getElementById("websdk-iframe"))&&(html=document.getElementById("content_pane").innerHTML,arr=html.split("SRCWID--\x3e"),arr1=arr[1].split("\x3c!--SRCWID"),child=arr1[0],document.getElementById("lecture_disp_main_td_div_cont").innerHTML="",html=arr1[0],resp="
"+html+"
Refresh
",document.getElementById("lecture_disp_main_td_div_cont").innerHTML=resp,normalize("lecture_disp_main_td_div_cont",!1)),document.getElementById("lecture_discussion_div").innerHTML="",document.getElementById("latest_com_div").nextElementSibling),document.getElementById("lecture_discussion_div").appendChild(content_box),$("#lecture_display_div").css("display","block"),lecture_mode=!0}function showLectureDisplayLive(){var e;$(".post_tools_tab").css("display","none"),content_box=(null===document.getElementById("websdk-iframe")&&(e=window.location.protocol+"//"+document.domain+"/dc/zoom/meeting/?channel="+escape(current_course),(iframe=document.createElement("iframe")).setAttribute("id","websdk-iframe"),iframe.setAttribute("class","youtube-videos"),iframe.setAttribute("src",e),document.getElementById("lecture_disp_main_td_div_cont").innerHTML="",document.getElementById("lecture_disp_main_td_div_cont").appendChild(iframe),html=document.getElementById("websdk-iframe").outerHTML,resp="
"+html+"
Refresh
 
",document.getElementById("lecture_disp_main_td_div_cont").innerHTML=resp),document.getElementById("lecture_discussion_div").innerHTML="",document.getElementById("latest_com_div").nextElementSibling),document.getElementById("lecture_discussion_div").appendChild(content_box),$("#lecture_display_div").css("display","block"),lecture_mode=!0}async function getZoomCredentials(e){return(await fetch(e)).json()}function showLectureDisplayRefresh(){document.getElementById("lecture_disp_main_td_div_cont").innerHTML="",closeLectureDisplay(),showLectureDisplayLive()}function getChats(e,t){(sp=document.createElement("script")).setAttribute("src","dc_getchats.php?user="+escape(e)+"&stat="+escape(t)),(parent=document.getElementsByTagName("head"))[0].appendChild(sp)}function procGetChats(e,t,n,a,r){if(0===e.indexOf("success")){for(first_el_id="",i=0;i"+r+"
"+n+"
"):(null==document.getElementById(e+"_chat_div")&&createChatDiv(e),"top"==i?(fst=document.getElementById(e+"_chat_div").firstChild,nxt=fst.nextElementSibling,document.getElementById(e+"_chat_div").insertBefore(my_div,nxt)):document.getElementById(e+"_chat_div").appendChild(my_div),"
"+r+"
"+n+"
"),my_div.innerHTML=text,normalize(o,!1)}function getPollData(){if(data="",poll_id="",poll_col_ids="",poll_title="",poll_subtitle="",poll_max_vote=0,poll_commence_d="",poll_commence_t="",poll_deadline_d="",poll_deadline_t="",0==(arr=document.getElementById(insert_panel_id).getElementsByClassName("qst_poll")).length)return"";if(1$("#comment").width()||1<$(this).val().split("\n").length?$("#comment").css("font-size","14px"):$("#comment").css("font-size","34px")}),$("#comment").on("click",function(){"Shoot something..."==$(this).val()&&($(this).text(""),$(this).css("text-align","left"))}),jQuery("#import-file-input").on("change",function(){var e=this.files[0],t=(e.type,e.size),e=(current_import_filename=e.name,new FileReader);try{if(5e6All',document.exam_form.cbt_qst_src_top.innerHTML=''):(coverScreen(),(sp=document.createElement("script")).setAttribute("src","dc_get_qst_bank_subjects.php?stan="+escape(e)),(parent=document.getElementsByTagName("head"))[0].appendChild(sp))}function processGetQuestionBankSubjects(e,t){if(uncoverScreen(),e){document.exam_form.cbt_qst_src_sub.innerHTML='';for(var n of t){var a=document.createElement("option");a.setAttribute("value",n),a.innerText=n,document.exam_form.cbt_qst_src_sub.appendChild(a)}}else shootDisplayDialog("Message",t.msg,{width:"250px"})}function getQuestionBankTopics(e){var t,e=e.value;"All"==e?document.exam_form.cbt_qst_src_top.innerHTML='':(t=document.exam_form.cbt_qst_src_standard.value,coverScreen(),(sp=document.createElement("script")).setAttribute("src","dc_get_qst_bank_topics.php?sub="+escape(e)+"&stan="+escape(t)),(parent=document.getElementsByTagName("head"))[0].appendChild(sp))}function processGetQuestionBankTopics(e,t){if(uncoverScreen(),e){document.exam_form.cbt_qst_src_top.innerHTML='';for(var n of t){var a=document.createElement("option");a.setAttribute("value",n),a.innerText=n,document.exam_form.cbt_qst_src_top.appendChild(a)}}else shootDisplayDialog("Message",t.msg,{width:"250px"})}function getReportInfo(){var e=document.create_new_report_form.create_report.value;"Create New Report"==e?document.create_new_report_form.reset():(coverScreen(),(sp=document.createElement("script")).setAttribute("src","dc_get_report_info.php?report="+escape(e)),(parent=document.getElementsByTagName("head"))[0].appendChild(sp))}function processGetReportInfo(e,t){if(uncoverScreen(),e){document.create_new_report_form.report_title.value=t.title,document.create_new_report_form.report_subtitle.value=t.subtitle,document.create_new_report_form.report_subtitle_2.value=t.subtitle2,document.create_new_report_form.report_subtitle_3.value=t.subtitle3,document.create_new_report_form.report_subtitle_4.value=t.subtitle4,document.create_new_report_form.report_access_code.value=t.access_code,document.create_new_report_form.report_template.value=t.template;var n=t.groups.split(",");for(let e=0;e'+(n=a)+"",document.createElement("a")),r=new Blob([n],{type:"text/plain"});t.href=URL.createObjectURL(r),t.download=e.concat(".kiss"),t.click(),URL.revokeObjectURL(t.href)}function getCBTSetUpInfo(){let e="{";return 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=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.concat('"cbt_qst_src":"'+document.exam_form.cbt_qst_src.value+'"')).concat(',"cbt_qst_src_docs":"'+document.exam_form.cbt_qst_src_docs.value+'"')).concat(',"exam_channel":"'+document.exam_form.exam_channel.value+'"')).concat(',"title":"'+document.exam_form.title.value+'"')).concat(',"subtitle":"'+document.exam_form.subtitle.value+'"')).concat(',"cbt_group1":"'+document.exam_form.cbt_group1.value+'"')).concat(',"cbt_group2":"'+document.exam_form.cbt_group2.value+'"')).concat(',"cbt_group3":"'+document.exam_form.cbt_group3.value+'"')).concat(',"cbt_group4":"'+document.exam_form.cbt_group4.value+'"')).concat(',"cbt_group5":"'+document.exam_form.cbt_group5.value+'"')).concat(',"instruction":"'+document.exam_form.instruction.value+'"')).concat(',"questionperuser":"'+document.exam_form.questionperuser.value+'"')).concat(',"questionperdisplay":"'+document.exam_form.questionperdisplay.value+'"')).concat(',"eligibility":"'+document.exam_form.eligibility.value+'"')).concat(',"datalink":"'+document.exam_form.datalink.value+'"')).concat(',"numberofseat":"'+document.exam_form.numberofseat.value+'"')).concat(',"costperseating":"'+document.exam_form.costperseating.value+'"')).concat(',"attach_sub":"'+document.exam_form.attach_sub.value+'"')).concat(',"timing":"'+document.exam_form.timing.value+'"')).concat(',"attach_files":"'+document.exam_form.attach_files.value+'"')).concat(',"commence_d":"'+document.exam_form.commence_d.value+'"')).concat(',"commence_t":"'+document.exam_form.commence_t.value+'"')).concat(',"deadline_d":"'+document.exam_form.deadline_d.value+'"')).concat(',"deadline_t":"'+document.exam_form.deadline_t.value+'"')).concat(',"exam_h":"'+document.exam_form.exam_h.value+'"')).concat(',"exam_m":"'+document.exam_form.exam_m.value+'"')).concat(',"submit_link":"'+document.exam_form.submit_link.value+'"')).concat(',"pub_answer":"'+document.exam_form.pub_answer.value+'"')).concat(',"score_visibility":"'+document.exam_form.score_visibility.value+'"')).concat(',"show_working":"'+document.exam_form.show_working.value+'"')).concat(',"pub_score_sheet":"'+document.exam_form.pub_score_sheet.value+'"')).concat(',"display_score":"'+document.exam_form.display_score.value+'"')).concat(',"allowed_attempts":"'+document.exam_form.allowed_attempts.value+'"')).concat(',"multi_sess":"'+document.exam_form.multi_sess.value+'"')).concat(',"remove_qst":"'+document.exam_form.remove_qst.value+'"')).concat(',"category":"'+document.exam_form.category.value+'"')).concat(',"reserve_msg":"'+document.exam_form.reserve_msg.value+'"')).concat(',"submit_msg":"'+document.exam_form.submit_msg.value+'"')).concat(',"post_back_color":"'+document.exam_form.post_back_color.value+'"')).concat(',"calc_type":"'+document.exam_form.calc_type.value+'"')).concat("}")}function getPrivileges(){let e="{";return e=(e=(e=(e=(e=e.concat('"edit_priv":"'+document.getElementById("edit_priv").innerHTML+'"')).concat(',"save_priv":"'+document.getElementById("save_priv").innerHTML+'"')).concat(',"share_priv":"'+document.getElementById("share_priv").innerHTML+'"')).concat(',"all_priv":"'+document.getElementById("all_priv").innerHTML+'"')).concat("}")}function playSound(){var e;null==document.getElementById("chat_audio")?((e=document.createElement("audio")).setAttribute("id","chat_audio"),e.setAttribute("src","tone.wav"),e.setAttribute("autoplay","true"),e.setAttribute("vol","100%"),e.setAttribute("height","0"),e.setAttribute("hidden","true"),document.getElementsByTagName("body")[0].appendChild(e)):document.getElementById("chat_audio").play()}function insertPlainText(){jQuery("#insert_text_panel").css("display","block"),repositionPlainTextEditior()}function setPlainText(){var t=document.getElementById("insert_text_panel_input").value;for(let e=0;eX",r.innerHTML="Manage Privileges",o.innerHTML="Lock Share Image",i.innerHTML="Set Redirect Link",s.innerHTML="Copy Redirect Link",l.innerHTML="Lock Share Link",c.innerHTML="Share Overlay",d.innerHTML="Set Share Title",_.innerHTML="Download PDF",u.innerHTML="Promote",n.appendChild(a),n.appendChild(r),n.appendChild(o),n.appendChild(i),n.appendChild(s),n.appendChild(l),n.appendChild(c),n.appendChild(d),n.appendChild(_),n.appendChild(u),a.setAttribute("style","text-align:right"),"content"==t?n.setAttribute("class","shoot-menu-dialog shoot-align-left-left-center-center"):n.setAttribute("class","shoot-menu-dialog shoot-align-center-center"),document.getElementById(p).appendChild(n)):jQuery("#more_"+t+"_"+e+" .shoot-menu-dialog").css("display","block"),!1}function closeGeneralMoreDialog(e,t){jQuery("#more_"+t+"_"+e+" .general-more-dialog").css("display","none")}function createSharePlatformsDialog(e,t){var n,a,r,o,i,s="share_"+t+"_dialog_"+e;return null!=document.getElementById(s)?(n=document.createElement("ul"),a=document.createElement("li"),(r=document.createElement("li")).setAttribute("onClick","shareViaTwitter("+e+",'"+t+"')"),(o=document.createElement("li")).setAttribute("onClick","shareViaFacebook("+e+",'"+t+"')"),document.createElement("li").setAttribute("onClick","shareViaInstagram("+e+",'"+t+"')"),(i=document.createElement("li")).setAttribute("onClick","shareViaWhatsApp("+e+",'"+t+"')"),a.innerHTML="X",r.innerHTML="X (Twitter)",o.innerHTML="Facebook",i.innerHTML="WhatsApp",n.appendChild(a),n.appendChild(r),n.appendChild(o),n.appendChild(i),a.setAttribute("style","text-align:right"),"content"==t?n.setAttribute("class","shoot-menu-dialog shoot-align-left-right-center-center"):n.setAttribute("class","shoot-menu-dialog shoot-align-center-center-bottom-bottom"),document.getElementById(s).appendChild(n)):jQuery("#share_"+t+"_dialog_"+e+" .shoot-menu-dialog").css("display","block"),!1}function shareViaTwitter(e,t){share("edit_"+t+"_"+e,1)}function shareViaFacebook(e,t){share("edit_"+t+"_"+e,2)}function shareViaInstagram(e,t){share("edit_"+t+"_"+e,3)}function shareViaWhatsApp(e,t){share("edit_"+t+"_"+e,4)}function managePrivileges(e,t){alert(e),alert(t)}function setShareImage(e,t){shootDisplayDriveFileChooser("preprocessSetShareImage",e+"_"+t)}let preprocessSetShareImage={execute:function(e,t){coverScreen();t=window.location.protocol+"//"+document.domain+"/dc/dc_setShareImage.php?image_id="+t[0]+"&callback_data="+escape(e);shootFetch({url:t})}},processSetShareImage={execute:function(e){uncoverScreen(),"true"==e.successful?shootDisplayDialog("Message",e.value,{width:"300px"}):shootDisplayDialog("Message",e.msg,{width:"300px"})}};function setRedirectLink(e,t){shootDisplayDialog("Set Redirect Link","",{width:"250px"}),initShoot()}function preprocessSetRedirectLink(e,t){jQuery(".set_redirect_link_progress_label").css("display","block");var n=escape(jQuery("#set_redirect_link").val()),e=window.location.protocol+"//"+document.domain+"/dc/dc_setRedirectLink.php?file_id="+e+"&file_type="+t+"&link="+n;return shootFetch({url:e}),!1}let processSetRedirectLink={execute:function(e){uncoverScreen(),"true"==e.successful?shootDisplayDialog("Message",e.value,{width:"300px"}):shootDisplayDialog("Message",e.msg,{width:"300px"})}};function copyRedirectLink(e,t){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_copyRedirectLink.php?file_id="+e+"&file_type="+t;shootFetch({url:e})}let processCopyRedirectLink={execute:function(e){var t;uncoverScreen(),"true"==e.successful?(t=document.createElement("textarea"),document.getElementsByTagName("body")[0].appendChild(t),t.innerHTML=e.value,t.select(),document.execCommand("copy"),document.getElementsByTagName("body")[0].removeChild(t),shootDisplayDialog("Message","Redirect link copied to Clipboard successfully.",{width:"300px"})):shootDisplayDialog("Message",e.msg,{width:"300px"})}};function lockShareLink(e,t){shootDisplayDialog("Lock Share Link","",{width:"250px"}),initShoot()}function preprocessLockShareLink(e,t){jQuery(".lock_share_link_progress_label").css("display","block");var n=escape(jQuery("#lock_share_link").val());let a="no",r="no",o="no",i="no";document.querySelector("#lock_share_link_tt").checked&&(a="yes"),document.querySelector("#lock_share_link_fb").checked&&(r="yes"),document.querySelector("#lock_share_link_wat").checked&&(o="yes"),document.querySelector("#lock_share_link_ins").checked&&(i="yes");e=window.location.protocol+"//"+document.domain+"/dc/dc_lockShareLink.php?file_id="+e+"&file_type="+t+"&link="+n+"&tt="+a+"&fb="+r+"&wat="+o+"&ins="+i;return shootFetch({url:e}),!1}let processLockShareLink={execute:function(e){jQuery(".lock_share_link_progress_label").css("display","none"),"true"==e.successful?shootDisplayDialog("Message",e.value,{width:"250px"}):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function setShareTitle(e,t){shootDisplayDialog("Set Share Title","
",{width:"250px"}),initShoot()}function preprocessSetShareTitle(e,t){jQuery(".set_share_title_progress_label").css("display","block");var n=escape(jQuery("#set_share_title").val()),e=window.location.protocol+"//"+document.domain+"/dc/dc_setShareTitle.php?file_id="+e+"&file_type="+t+"&title="+n;return shootFetch({url:e}),!1}let processSetShareTitle={execute:function(e){jQuery(".set_share_title_progress_label").css("display","none"),"true"==e.successful?shootDisplayDialog("Message",e.value,{width:"250px"}):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function downloadPDF(e,t){alert(e),alert(t)}function promote(e,t){e=window.location.protocol+"//"+document_root+"dc/dc_promote.php?id="+e+"&type="+t,t=document.createElement("iframe"),t.setAttribute("src",e),window.innerWidth,e=.8*window.innerHeight;shootDisplayDialog("Promote",t.outerHTML,{width:"360px",height:e+"px"})}let preprocessPromote={execute:function(){return alert("here"),!1}},processGetPromos={execute:function(s){"true"==s.successful?(jQuery(".promo-image-div").fadeTo(1e3,.1,function(){for(let e=1;e<5;e++){var t,n=s.value[e-1].crtor,a=s.value[e-1].id,r=s.value[e-1].file_type,o=s.value[e-1].content_post_id,i=s.value[e-1].images.split(",");0";var a;if(e=e.concat(t),t="

Description

"+n.value.description+"
",e=e.concat(t),t="

Platform

"+n.value.platform+"
",e=e.concat(t),t="

Platform Category

"+n.value.platform_category+"
",e=e.concat(t),t="

Max. Number of Promoters

"+n.value.maxpromoters+"
",e=e.concat(t),t="

Min. Required Followers

"+n.value.minfollowers+"
",e=e.concat(t),t="

Start Date

"+n.value.startdate+"
",e=e.concat(t),t="

Start Time

"+n.value.starttime+"
",e=e.concat(t),t="

Duration (in Days)

"+n.value.duration+(1
",e=e.concat(t),t="

Min. Re-share Per Day

"+n.value.minshares+"
",e=e.concat(t),t="

Time Between Re-Shares

"+n.value.timebetweenshares+(1
",e=e.concat(t),t="

Target Country

"+n.value.country+"
",e=e.concat(t),t="

Target State

"+n.value.state+"
",e=e.concat(t),t="

Target City/Town

"+n.value.city+"
",e=e.concat(t),t='

Link To Promotion

'+n.value.promo_link+"",e=e.concat(t),t='

Re-direct Link

'+n.value.redirect_url+"",e=e.concat(t),t="

Daily Reward

EUT"+n.value.reward+"
",e=e.concat(t),""!=n.value.youtube_video_url&&null!=n.value.youtube_video_url&&(o=n.value.youtube_video_url.replace("https://www.youtube.com/watch?v=",""),t="

 

",e=e.concat(t)),0

 

'+r.outerHTML+"
":"

 

"+r.outerHTML+"
",e=e.concat(t)}e=e.concat("
");var o=.8*window.innerHeight;shootDisplayDialog("Details - PID: "+n.value.pid_string,e,{width:"360px",height:o+"px"})}else shootDisplayDialog("Message",n.msg,{width:"250px"})}};function gotoPromoRedirectLink(e){alert(e)}function applyToPromo(e){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_applyToPromo.php?id="+e;shootFetch({url:e})}let processApplyToPromo={execute:function(e){uncoverScreen(),e.successful,shootDisplayDialog("Message",e.msg,{width:"250px"})}};function gotoPromo(e,t){shootCloseAllDialogs(),coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_gotoPromo.php?id="+e+"&file_type="+t;shootFetch({url:e})}let processGotoPromo={execute:function(e){uncoverScreen(),"true"==e.successful?(share_id=e.value,goToShared(e.value)):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function openPromotion(e){var t;1==e?(coverScreen(),e=window.location.protocol+"//"+document.domain+"/dc/dc_mytasks.php",shootFetch({url:e})):"My Tasks"==(e=document.getElementById("promotion_dropdown").value)?(coverScreen(),t=window.location.protocol+"//"+document.domain+"/dc/dc_mytasks.php",shootFetch({url:t})):"My Promotions"==e&&(coverScreen(),t=window.location.protocol+"//"+document.domain+"/dc/dc_mypromotions.php",shootFetch({url:t}))}let processMyTasks={execute:function(e){if(uncoverScreen(),"true"==e.successful){let t="";for(obj of e.value){let e="
Pending
";1==obj.status?e="
Approved
":2==obj.status&&(e="
Revoked
"),t=t.concat("")}t=t.concat("
DATEPIDTITLEFACEBOOK LINKSTWITTER LINKSINSTAGRAM LINKSACTIONSTATUS
"+obj.date_time+""+obj.pid+""+obj.title+"
"+e+"
");var n,a=.95*window.innerWidth,r=.9*window.innerHeight;null!=document.getElementById("promotions_div")?document.getElementById("promotions_div").innerHTML=t:(n="
"+t+"
",shootDisplayDialog("Promotion",n,{width:a+"px",height:r+"px"}))}else shootDisplayDialog("Message",e.msg,{width:"250px"})}},processMyPromos={execute:function(e){if(uncoverScreen(),"true"==e.successful){let t="";for(obj of e.value){let e="
Active
";1==obj.expired&&(e="
Expired
"),t=t.concat("")}t=t.concat("
DATEPIDTITLEACTIONPROMOTERSSTATUS
"+obj.datetime+""+obj.pid+""+obj.title+"    "+obj.total+""+e+"
");var n,a=.95*window.innerWidth,r=.9*window.innerHeight;null!=document.getElementById("promotions_div")?document.getElementById("promotions_div").innerHTML=t:(n="
"+t+"
",shootDisplayDialog("Promotion",n,{width:a+"px",height:r+"px"}))}else shootDisplayDialog("Message",e.msg,{width:"250px"})}};function getPromoters(e){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_getpromoters.php?pid="+e;shootFetch({url:e})}let processGetPromoters={execute:function(e){if(uncoverScreen(),"true"==e.successful){let t="",n=1;for(obj of e.value){let e="
Pending
";1==obj.status?e="
Approved
":2==obj.status&&(e="
Revoked
"),t=t.concat(""),n++}t=t.concat("
S/NAPP. TIMEUSERNAMEFB_LINKSX_LINKSINS_LINKSSTATUSREV. TIMEACTION
"+n+""+obj.app_time+""+obj.username+""+processSocialMediaLinks(obj.fb_links)+""+processSocialMediaLinks(obj.tt_links)+""+processSocialMediaLinks(obj.ins_links)+""+e+"rev time    
");var a=.9*window.innerWidth,r=.8*window.innerHeight;shootDisplayDialog("Showing Promoters for PID: "+e.pid,t,{width:a+"px",height:r+"px"})}else shootDisplayDialog("Message",e.msg,{width:"250px"})}};function approvePromoter(e){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_approvepromoter.php?app_id="+e;shootFetch({url:e})}let processApprovePromoter={execute:function(e){uncoverScreen(),"true"==e.successful?(shootDisplayDialog("Message",e.msg,{width:"250px"}),jQuery("#promoter_status_"+e.app_id).text("Approved"),jQuery("#promoter_status_"+e.app_id).css("background-color","green")):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function revokePromoter(e){coverScreen();e=window.location.protocol+"//"+document.domain+"/dc/dc_revokepromoter.php?app_id="+e;shootFetch({url:e})}let processRevokePromoter={execute:function(e){uncoverScreen(),"true"==e.successful?(shootDisplayDialog("Message",e.msg,{width:"250px"}),jQuery("#promoter_status_"+e.app_id).text("Revoked"),jQuery("#promoter_status_"+e.app_id).css("background-color","red")):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function rewardUser(e,t){var n,a,r=document.createElement("iframe");r.setAttribute("src","wallets/transfer_fund.php?u="+encodeURI(t)),"pc"==deviceType?(n=.9*window.innerWidth,a=.8*window.innerHeight,shootDisplayCoverDialog("Reward "+t,r.outerHTML,{width:n+"px",height:a+"px"})):(n=.98*window.innerWidth,a=.98*window.innerHeight,shootDisplayCoverDialog("Reward "+t,r.outerHTML,{width:n+"px",height:a+"px"}))}function viewUserDetails(e){var t,n,a=document.createElement("iframe");a.setAttribute("src",document_protocol+"://"+document_root+"/dc/dc_view_profile.php?user="+escape(e)),"pc"==deviceType?(t=.9*window.innerWidth,n=.8*window.innerHeight,shootDisplayCoverDialog(e,a.outerHTML,{width:t+"px",height:n+"px"})):(t=.98*window.innerWidth,n=.98*window.innerHeight,shootDisplayCoverDialog(e,a.outerHTML,{width:t+"px",height:n+"px"}))}function addSocialMediaLink(e,t){let n="";1==t?n="X (Twitter)":2==t?n="Facebook":3==t&&(n="Instagram"),shootDisplayDialog("Add "+n+" Link","",{width:"250px"}),initShoot()}function preprocessAddSocialMediaLink(t,n){try{jQuery(".add_media_link_progress_label").css("display","block");let e=jQuery("#media_link").val();e=0==(e=e.split(" ").join("").trim()).indexOf(""+link.substring(0,20)+" Remove":"
"+link.substring(0,20)+" Remove";return a}function removeSocialMediaLink(e,t,n){window.confirm("Are you sure you wish to remove this link?")&&(t=window.location.protocol+"//"+document.domain+"/dc/dc_removeSocialMediaLink.php?promo_tab_id="+t+"&media="+n+"&link="+encodeURI(e),shootFetch({url:t}))}let processRemoveSocialMediaLink={execute:function(e){"true"==e.successful?1==e.value.media?jQuery("#my_task_row_"+e.value.promo_tab_id+" .tt_links_div").html(processSocialMediaLinks(e.value.links,e.value.promo_tab_id,e.value.media)):2==e.value.media?jQuery("#my_task_row_"+e.value.promo_tab_id+" .fb_links_div").html(processSocialMediaLinks(e.value.links,e.value.promo_tab_id,e.value.media)):3==e.value.media&&jQuery("#my_task_row_"+e.value.promo_tab_id+" .ins_links_div").html(processSocialMediaLinks(e.value.links,e.value.promo_tab_id,e.value.media)):shootDisplayDialog("Message",e.msg,{width:"250px"})}};function embedSavedFile(){var e=opened_file_id;0==e?alert("Sorry, you have to open the file to be embedded first."):(coverScreen(),e=window.location.protocol+"//"+document.domain+"/dc/dc_embed.php?file_id="+e+"&type=document",shootFetch({url:e}))}let processEmbedSavedFile={execute:function(e){var t,n,a;uncoverScreen(),"true"==e.successful?(a=e.value.embed_id,t=e.value.type,n=e.value.filename,a='
'+n+'

Please wait...loading