1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
function addQuestion(n)
{
var numQuestion = document.getElementById("numQuestion" + n).value;
var newDiv = document.createElement("div");
document.getElementById("Q" + n).appendChild(newDiv);
newDiv.innerHTML += "" +
"<div id=\"question" + n + numQuestion + "\">"+
" <div id=\"questionDiv\">"+
" <table><tr style=\"background-color:#eeeeee;\"><td style=\"width:50px;\">Question</td>"+
" <td style=\"width:150px;\"><form id=\"form" + n + numQuestion + "\">Type :"+
" <select name=\"typeQuestion\" onchange=\"mngQTypes(this, " + n + numQuestion + ", " + numQuestion + ", " + n + ");\">"+
" <option></option>"+
" <option>Choix unique</option>"+
" <option>texte</option>"+
" <option>Choix multiple</option>"+
" </select></form>"+
" </td>"+
" <td style=\"width:300px;\"><a href=\"images/logo.png\" rel=\"lytebox\" title=\"Image Description\">Image #1</a>"+
" </td>"+
" <td style=\"width:20px;\"><input id=\"sButton\" type=\"button\" value=\"x\" onclick=\"deleteQuestion('" + n + numQuestion + "', '" + n + "');\">"+
" </td></tr><tr>"+
" <td colspan=\"2\"><div id=\"image" + n + numQuestion + "\" style=\"text-align:center;\"></div>"+
" </td>"+
" <td colspan=\"2\">"+
" <a id=\"abind\" onclick=\"document.getElementById('image" + n + numQuestion + "').innerHTML = '';\">Cacher</a>"+
" <a id=\"abind\" onclick=\"afficherImage(ImageCreationResult, '" + n + numQuestion + "');\">Apercu Image</a>"+
" <div id=\"marqueurquestion" + n + numQuestion + "\" style=\"display:none;\">OUI</div>"+
" </td></tr><tr><td colspan=\"4\">Votre question : <input id=\"TEXT" + n + numQuestion + "\" type=\"text\" size=\"50\">"+
" </td></tr><tr>"+
" <td colspan=\"4\"><div id=\"" + n + numQuestion + "\"></div>"+
" </td></tr></table></div></div>";
numQuestion++;
document.getElementById("numQuestion" + n).value = numQuestion;
} |