var sankoreLang = { display: "Display", edit: "Edit", short_desc: "Listen to the sound and make the correct word.", add: "Add new block", enter: "Enter your instruction here ...", example: "example", wgt_name: "Order letters", reload: "Reload", slate: "slate", pad: "pad", none: "none", help: "Help", help_content: "

Order letters

" + "

Drag and drop labels in the correct order

" + "

Listen to the audio file and drag and drop labels in the correct order. If the result is correct, the area turns in green.

"+ "

You can also use this activity with numbers.

" + "

“Reload” button resets the exercises.

" + "

Enter the “Edit” mode to :

" + "" + "

To create a new exercise :

" + "" + "

To replace an audio file, drag a new one from your library.

" + "

To delete a whole block, click on the cross on the left.

" + "

“Display” button comes back to the activity.

", theme: "Theme" }; //main function function start(){ $("#wgt_display").text(sankoreLang.display); $("#wgt_edit").text(sankoreLang.edit); $("#wgt_name").text(sankoreLang.wgt_name); $("#wgt_reload").text(sankoreLang.reload); $("#wgt_help").text(sankoreLang.help); $("#help").html(sankoreLang.help_content); $("#style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='3']").text(sankoreLang.none); var tmpl = $("div.inline label").html(); $("div.inline label").html(sankoreLang.theme + tmpl) if(window.sankore){ if(sankore.preference("ord_let","")){ var data = jQuery.parseJSON(sankore.preference("ord_let","")); importData(data); } else showExample(); if(sankore.preference("ord_let_style","")){ changeStyle(sankore.preference("ord_let_style","")); $("#style_select").val(sankore.preference("ord_let_style","")); } else changeStyle("3") } else showExample(); //events if (window.widget) { window.widget.onleave = function(){ exportData(); sankore.setPreference("ord_let_style", $("#style_select").find("option:selected").val()); } } $("#wgt_help").click(function(){ var tmp = $(this); if($(this).hasClass("open")){ $(this).removeClass("help_pad").removeClass("help_wood") $("#help").slideUp("100", function(){ tmp.removeClass("open"); $("#data").show(); }); } else { ($("#style_select").val() == 1)?$(this).removeClass("help_pad").addClass("help_wood"):$(this).removeClass("help_wood").addClass("help_pad"); $("#data").hide(); $("#help").slideDown("100", function(){ tmp.addClass("open"); }); } }); $("#wgt_reload").click(function(){ if($("#wgt_display").hasClass("selected")){ setTimeout('$("#wgt_display").trigger("click")', 10) $("#wgt_edit").trigger("click"); } else { $("#wgt_display").trigger("click"); } }); $("#wgt_reload, #wgt_display, #wgt_edit").mouseover(function(){ exportData(); }); $("#style_select").change(function (event){ changeStyle($(this).find("option:selected").val()); }) $("#wgt_display, #wgt_edit").click(function(event){ if(this.id == "wgt_display"){ if(!$(this).hasClass("selected")){ if(window.sankore) sankore.enableDropOnWidget(false); $(this).addClass("selected"); $("#wgt_edit").removeClass("selected"); $("#parameters").css("display","none"); $(".add_block").remove(); $(".cont").each(function(){ var container = $(this); var tmp_array = []; var ans_container = container.find(".audio_answer"); container.find(".text_cont .audio_desc").removeAttr("contenteditable"); container.find(".audio_block").removeAttr("ondragenter") .removeAttr("ondragleave") .removeAttr("ondragover") .removeAttr("ondrop") container.find(".close_cont").remove(); var answer = ans_container.text(); ans_container.prev().val(answer) ans_container.remove(); var ul_cont = $("