q = { qid: id };
}
var question = $("#q_edit_new").tmpl(q);
- question
+ var type = question
.children('select[name$="[type]"]')
.change(function () {
var type = $(this).val();
}
return true;
});
+ if (type.val()) {
+ question.children('.q_edit_form')
+ .bindQuestion(type.val(), q.qid);
+ }
this.childrenContainer().children('.add_question').before(question);
$.renumberQuestions();
return question;
type: $(this).val(),
disabled: "disabled"
}));
- });
+ })
+ .change();
return this;
},
var question = this.question();
var answer = $("#q_edit_multiple_answer").tmpl({ qid: question.qid() });
question.childrenContainer().children('.add_answer').after(answer);
+ question.multiple_selectSubtype().change();
return answer;
}
});
<script id="q_edit_multiple_answer" type="text/x-jquery-tmpl">
<div>
- <span class="q_edit_answer_box">
- </span>
+ <span class="q_edit_answer_box"></span>
RĂ©ponse : <input type="text" name="q_edit[${qid}][answer][][value]" value="${value}" />
</div>
</script>