/* * 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: "Modifier", display:"Afficher", question:"La question", example_question:"Ceci est un exemple de question", answer:"Ceci est une réponse possible", q:"Q", add_new_question:" Ajouter une nouvelle question ...", options:"Les options", close:"Fermer", delete_question:"Supprimer la question", delete_answer:"Supprimer la proposition", right_answer:"Bonne réponse", template_question:"Saisir la question ici ...", template_answer:"Saisir une proposition ici ...", add_answer:"Ajouter une proposition", select_text:"Choisir la bonne réponse", options_desc:"Vous pouvez choisir une de ces trois options pour l'affichage des propositions.", radio_desc:"Une seule bonne réponse avec des propositions sous forme de boutons radio.", checkbox_desc:"Plusieurs bonnes réponses avec des propositions sous forme de cases à cocher.", select_desc:"Une seule bonne réponse et les propositions sont affichées sous forme de menu déroulant.", a:"R", wgt_name: "Choisir", reload: "Recharger", slate: "ardoise", pad: "tablette", none: "aucun", help: "Aide", help_content: "

Choisir

"+ "

Question à choix multiples (QCM).

"+ "

Une question est posée avec plusieurs choix de réponses possibles. Le but est de choisir la bonne réponse.

"+ "

Le bouton “Recharger” réinitialise les exercices.

"+ "

Le bouton “Modifier” vous permet :

"+ ""+ "

En mode édition :

"+ "", theme: "Thème" }; 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 = $("