获取调查问卷对象。
com.jspxcms.ext.web.directive.QuestionDirective
获取当前站点最新一条调查问卷对象:
[@Question;question]
[#if question??]
<form action="${ctx}/questions/${question.id}/answer" method="post" id="questionForm">
<h2><a href="${ctx}/questions/${question.id}">${question.title}</a></h2>
[#list question.items as item]
<p>${item_index+1}、${item.title}</p>
<ul>
[#if !item.essay]
[#list item.options as option]
<li><label><input type="[#if item.maxSelected==1]radio[#else]checkbox[/#if]" name="item_${item.id}" value="${option.id}"/> ${option.title}</label></li>
[/#list]
[#else]
<textarea name="input_${item.id}"></textarea>
[/#if]
</ul>
[/#list]
<input type="hidden" name="status_504" value="您已经参与过调查"/>
<input type="hidden" name="redirectUrl" value="${ctx}/questions/${question.id}/result"/>
<div>
<input type="submit" value="提交"/>
<a href="${ctx}/questions/${question.id}/result">查看结果</a>
</div>
</form>
<script>
$(function() {
$("#questionForm").validate();
});
</script>
[#else]
<div>没有投票</div>
[/#if]
[/@Question]