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 = [];
|
var objToSave = [];
|
||||||
$.each($("#fragenListe").find("li"), function() {
|
$.each($("#fragenListe").find("li"), function() {
|
||||||
var oneQ = {
|
var oneQ = {
|
||||||
"frage" : replaceSomeCharactersInHtml($(this).find(".questionIn").val()),
|
"frage" : $(this).find(".questionIn").val(),
|
||||||
"kuerzel" : replaceSomeCharactersInHtml($(this).find(".questionKIn").val()),
|
"kuerzel" : $(this).find(".questionKIn").val(),
|
||||||
"antworten" : []
|
"antworten" : []
|
||||||
};
|
};
|
||||||
$.each($(this).find(".antTr"),function() {
|
$.each($(this).find(".antTr"),function() {
|
||||||
oneQ["antworten"].push({
|
oneQ["antworten"].push({
|
||||||
"antwort" : replaceSomeCharactersInHtml($(this).find(".antwortInp").val()),
|
"antwort" : $(this).find(".antwortInp").val(),
|
||||||
"anz" : replaceSomeCharactersInHtml($(this).find(".anz").val())
|
"anz" : $(this).find(".anz").val()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
objToSave.push(oneQ);
|
objToSave.push(oneQ);
|
||||||
@ -345,26 +345,6 @@ function saveQuestions() {
|
|||||||
wsSend("fileOp","write###fragen.txt###"+jsonQues);
|
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) {
|
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>'+
|
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>'+
|
'<tr>'+
|
||||||
@ -386,11 +366,11 @@ function addNewQuestion(frage) {
|
|||||||
'</tr><tr>'+
|
'</tr><tr>'+
|
||||||
'</table></li>');
|
'</table></li>');
|
||||||
if(frage != null) {
|
if(frage != null) {
|
||||||
newQHtml.find(".questionIn").val(replaceSomeCharactersInStd(frage["frage"]));
|
newQHtml.find(".questionIn").val(frage["frage"]);
|
||||||
newQHtml.find(".questionKIn").val(replaceSomeCharactersInStd(frage["kuerzel"]));
|
newQHtml.find(".questionKIn").val(frage["kuerzel"]);
|
||||||
for(var i=0;i<frage["antworten"].length;i++) {
|
for(var i=0;i<frage["antworten"].length;i++) {
|
||||||
$(newQHtml.find(".antwortInp")[i]).val(replaceSomeCharactersInStd(frage["antworten"][i]["antwort"]));
|
$(newQHtml.find(".antwortInp")[i]).val(frage["antworten"][i]["antwort"]);
|
||||||
$(newQHtml.find(".anz")[i]).val(replaceSomeCharactersInStd(frage["antworten"][i]["anz"]));
|
$(newQHtml.find(".anz")[i]).val(frage["antworten"][i]["anz"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newQHtml.find(".trash").click(function() {
|
newQHtml.find(".trash").click(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user