fix length bug for _ _ _
This commit is contained in:
parent
d2b8dd6570
commit
47195f272b
File diff suppressed because one or more lines are too long
@ -328,14 +328,14 @@ function saveQuestions() {
|
||||
var objToSave = [];
|
||||
$.each($("#fragenListe").find("li"), function() {
|
||||
var oneQ = {
|
||||
"frage" : replaceSomeCharactersInHtml($(this).find(".questionIn").val()),
|
||||
"kuerzel" : replaceSomeCharactersInHtml($(this).find(".questionKIn").val()),
|
||||
"frage" : $(this).find(".questionIn").val(),
|
||||
"kuerzel" : $(this).find(".questionKIn").val(),
|
||||
"antworten" : []
|
||||
};
|
||||
$.each($(this).find(".antTr"),function() {
|
||||
oneQ["antworten"].push({
|
||||
"antwort" : replaceSomeCharactersInHtml($(this).find(".antwortInp").val()),
|
||||
"anz" : replaceSomeCharactersInHtml($(this).find(".anz").val())
|
||||
"antwort" : $(this).find(".antwortInp").val(),
|
||||
"anz" : $(this).find(".anz").val()
|
||||
});
|
||||
});
|
||||
objToSave.push(oneQ);
|
||||
@ -345,26 +345,6 @@ function saveQuestions() {
|
||||
wsSend("fileOp","write###fragen.txt###"+jsonQues);
|
||||
}
|
||||
|
||||
function replaceSomeCharactersInHtml(str) {
|
||||
str = str.replace(/Ü/g, "Ü");
|
||||
str = str.replace(/ü/g, "ü");
|
||||
str = str.replace(/Ö/g, "Ö");
|
||||
str = str.replace(/ö/g, "ö");
|
||||
str = str.replace(/Ä/g, "Ä");
|
||||
str = str.replace(/ä/g, "ä");
|
||||
return str;
|
||||
}
|
||||
|
||||
function replaceSomeCharactersInStd(str) {
|
||||
str = str.replace(/Ü/g, "Ü");
|
||||
str = str.replace(/ü/g, "ü");
|
||||
str = str.replace(/Ö/g, "Ö");
|
||||
str = str.replace(/ö/g, "ö");
|
||||
str = str.replace(/Ä/g, "Ä");
|
||||
str = str.replace(/ä/g, "ä");
|
||||
return str;
|
||||
}
|
||||
|
||||
function addNewQuestion(frage) {
|
||||
var newQHtml = $('<li style="list-style-type: none; padding: 5px; border: 1px solid black; margin-right: 80px; position: relative;"><i style="cursor:pointer; position: absolute; right: 5px;" class="fa fa-trash-o trash"></i><table>'+
|
||||
'<tr>'+
|
||||
@ -386,11 +366,11 @@ function addNewQuestion(frage) {
|
||||
'</tr><tr>'+
|
||||
'</table></li>');
|
||||
if(frage != null) {
|
||||
newQHtml.find(".questionIn").val(replaceSomeCharactersInStd(frage["frage"]));
|
||||
newQHtml.find(".questionKIn").val(replaceSomeCharactersInStd(frage["kuerzel"]));
|
||||
newQHtml.find(".questionIn").val(frage["frage"]);
|
||||
newQHtml.find(".questionKIn").val(frage["kuerzel"]);
|
||||
for(var i=0;i<frage["antworten"].length;i++) {
|
||||
$(newQHtml.find(".antwortInp")[i]).val(replaceSomeCharactersInStd(frage["antworten"][i]["antwort"]));
|
||||
$(newQHtml.find(".anz")[i]).val(replaceSomeCharactersInStd(frage["antworten"][i]["anz"]));
|
||||
$(newQHtml.find(".antwortInp")[i]).val(frage["antworten"][i]["antwort"]);
|
||||
$(newQHtml.find(".anz")[i]).val(frage["antworten"][i]["anz"]);
|
||||
}
|
||||
}
|
||||
newQHtml.find(".trash").click(function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user