Facilitation saisie questions/quiz (rang affiché)
This commit is contained in:
parent
25efc8ae7b
commit
86c5be23be
@ -188,7 +188,7 @@ const initialise = async () =>
|
|||||||
addElement(divQuestions, "h4", txtQuestion.introTitle);// remplace l'existant dans divQuestions
|
addElement(divQuestions, "h4", txtQuestion.introTitle);// remplace l'existant dans divQuestions
|
||||||
let listQuestions="";
|
let listQuestions="";
|
||||||
for(let i in Questions)
|
for(let i in Questions)
|
||||||
listQuestions+="<li>"+Questions[i].Question.text+" | <a href='#updateQuestion"+Questions[i].Question.id+"' id='#updateQuestion"+Questions[i].Question.id+"' >"+txt.updateBtnTxt+"</a> | <a href='#deleteQuestion"+Questions[i].Question.id+"' id='#deleteQuestion"+Questions[i].Question.id+"' >"+txt.deleteBtnTxt+"</a></li>";
|
listQuestions+="<li>"+Questions[i].Question.rank+" - "+Questions[i].Question.text+" | <a href='#updateQuestion"+Questions[i].Question.id+"' id='#updateQuestion"+Questions[i].Question.id+"' >"+txt.updateBtnTxt+"</a> | <a href='#deleteQuestion"+Questions[i].Question.id+"' id='#deleteQuestion"+Questions[i].Question.id+"' >"+txt.deleteBtnTxt+"</a></li>";
|
||||||
if(listQuestions==="")
|
if(listQuestions==="")
|
||||||
listQuestions="<li>"+txtQuestion.introNoQuestion+"</li>";
|
listQuestions="<li>"+txtQuestion.introNoQuestion+"</li>";
|
||||||
addElement(divQuestions, "ul", listQuestions, "", ["information"], "", false);// à intégrer dans le DOM pour pouvoir ajouter des addEventListener ensuite
|
addElement(divQuestions, "ul", listQuestions, "", ["information"], "", false);// à intégrer dans le DOM pour pouvoir ajouter des addEventListener ensuite
|
||||||
@ -208,10 +208,6 @@ const initialise = async () =>
|
|||||||
sendQuestionForm();
|
sendQuestionForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(config.nbQuestionsMax);
|
|
||||||
console.log(Questions.length);
|
|
||||||
|
|
||||||
|
|
||||||
if(config.nbQuestionsMax > Questions.length || config.nbQuestionsMax===0)
|
if(config.nbQuestionsMax > Questions.length || config.nbQuestionsMax===0)
|
||||||
{
|
{
|
||||||
@ -225,7 +221,7 @@ const initialise = async () =>
|
|||||||
hideAllForms();
|
hideAllForms();
|
||||||
formQuestion.style.display="block";
|
formQuestion.style.display="block";
|
||||||
formQuestion.elements["QuestionnaireId"].value=formQuestionnaire.elements["id"].value;
|
formQuestion.elements["QuestionnaireId"].value=formQuestionnaire.elements["id"].value;
|
||||||
formQuestion.elements["rank"].value=config.Question.rank.defaultValue;
|
formQuestion.elements["rank"].value=(Questions.length===0) ? config.Question.rank.defaultValue : Questions.length+1;
|
||||||
window.location.assign("#questions");
|
window.location.assign("#questions");
|
||||||
setAttributesToInputs(config.Question, formQuestion);
|
setAttributesToInputs(config.Question, formQuestion);
|
||||||
});
|
});
|
||||||
@ -691,9 +687,6 @@ const initialise = async () =>
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
sendQuestionForm();
|
sendQuestionForm();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user