});
if (type.val()) {
question.children('.q_edit_form')
- .bindQuestion(type.val(), q.qid, q.parameters)
+ .bindQuestion(type.val(), q.qid, q)
}
this.childrenContainer().children('.add_question').before(question);
$.renumberQuestions();
<div>
Ajouter une case Autre ?
<select name="q_edit[${qid}][allow_other]">
- <option value="1">Oui</option>
- <option value="" selected="selected">Non</option>
+ <option value="1" {{if allow_other}}selected="selected"{{/if}}>Oui</option>
+ <option value="" {{if !allow_other}}selected="selected"{{/if}}>Non</option>
</select>
</div>
</div>
<script id="question_multiple" type="text/x-jquery-tmpl">
<div>
<div><strong>${label}</strong></div>
- {{tmpl(answers) "#question_multiple_answer"}}
+ {{each answers}}
+ <input type="${subtype}" name="qid[${qid}][]" value="${$index}" /> ${$value}<br />
+ {{/each}}
+ {{if allow_other}}
+ <input type="${subtype}" name="qid[${qid}][other][checked]" value="1" /> Autre, préciser :
+ <input type="text" name="qid[${qid}][other][text]" />
+ {{/if}}
</div>
</script>
-
-<script id="question_multiple_answer" type="text/x-jquery-tmpl">
- <input type="checkbox" name="qid[${qid}][]" value="${$data}" /> ${$data} <br />
-</script>
{/literal}
{* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}