/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ var sankoreLang = { edit: "Upraviť", display:"Zobraziť", question:"Otázka", example_question:"Sem zadajte otázku.", answer:"Toto je možná odpoveď č. ", q:"Ot", add_new_question:"Pridajte novú otázku.", options:"Možnosti", close:"Zatvoriť", delete_question:"Vymazať otázku", delete_answer:"Vymazať možnosť", right_answer:"Správna odpoveď", template_question:"Sem zadajte otázku.", template_answer:"Sem zadajte jednu odpoveď.", add_answer:"Pridať možnú odpoveď", select_text:"Vyberte správnu odpoveď", options_desc:"Môžete si vybrať jeden z troch variantov zobrazenia možností.", radio_desc:"Iba jedna správna odpoveď a možnosti zobrazené ako gombíky na rádiu.", checkbox_desc:"Viac správnych odpovedí a možnosti zobrazené ako zaškrtávacie políčka.", select_desc:"Iba jedna správna odpoveď a možnosti zobrazené v rozbaľovacom menu.", a:"Od", wgt_name: "Výber správnej odpovede", reload: "Obnoviť", slate: "bridlica", pad: "tablet", none: "žiadny", help: "Pomoc", help_content: "

Výber správnej odpovede

" + "

Výber z viacerých možností

" + "

Otázka s výberom odpovede. Cieľom je vybrať správnu odpoveď.

" + "

Tlačidlom „Obnoviť“ vrátite cvičenie do pôvodného stavu.

" + "

Po stlačení tlačidla „Upraviť“ môžete v režime úprav:

" + "" + "

Úprava cvičenia v režime úprav:

" + "" + "

Tlačidlom „Zobraziť“ sa z režimu úprav vrátite na aktivitu.

", theme: "Farebný motív" }; var questionArray; var currentQstId = ""; var lang = ""; //locale language var begin = true; function init(){ //variables var toggleFlag = false; var endFlag = false; var mode = true; questionArray = new Array(); var popupFlag = false var flagForSelect = false; $("#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) //popup message var popupText = $("
").appendTo("#data"); // adding question block var addQstDiv = $("
").appendTo("#data"); var addQstButton = $("").appendTo(qstOptions); var applyChanges = $("").appendTo(qstOptions); // var qstDelete = $("").appendTo(ansDiv); qstDiv.insertBefore("#addQstDiv"); // $("#addQsqSpan1").text(sankoreLang.q + (count + 2)); } //add answers function addAnsBlock(id, currId, text, stage, rightAns, type){ var newAnswer = $("
"); var value; var check = ""; if(stage){ value = getNeededElement(getNeededElement(questionArray, currId).answers,id).value; if(type != "2"){ if(rightAns == value) check = "checked='true'"; } else { rightAns = rightAns.replace(/,/g,""); if(rightAns.indexOf(value + " ", 0) != -1) check = "checked='true'"; } } else { value = ($("#" + currId + " .newAnswer input:checkbox").last().val()) ? parseInt($("#" + currId + " .newAnswer input:checkbox").last().val()) + 1 : 1; getNeededElement(getNeededElement(questionArray, currId).answers,id).value = value; } var count = $("#" + currId + " .newAnswer").size() + 1; var input = $("").appendTo(newAnswer); var ansSpan = $("" + sankoreLang.a + count + "").appendTo(newAnswer); var ansContent = $("
" + text + "
").appendTo(newAnswer); var ansDelete = $("