socialforge/app/views/exercise/_new_question.html.erb

45 lines
2.0 KiB
Plaintext
Raw Normal View History

<ul class="tabs_list">
<li class="tab_item02 mr118"> <a title="单选题" class="tab_icon icon_radio" onclick="add_MC();"> 新建单选题 </a> </li>
<li class="tab_item02 mr118"> <a title="多选题" class=" tab_icon icon_checkbox" onclick="add_MCQ();"> 新建多选题 </a> </li>
<li class="tab_item02 "> <a title="单行主观" class="tab_icon icon_text" onclick="add_single();"> 新建填空题 </a> </li>
</ul>
<div class="cl"></div>
<script type="text/javascript">
function add_MC(){
var forms = $("form.new_exercise_question");
2015-11-20 21:50:27 +08:00
if($("#polls_head_edit").is(":visible")){
alert("请先保存测验标题及测验基本信息。");
}else if(forms.length > 0){
alert("请先保存正在编辑的题目再新建。");
} else{
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC', :locals => {:exercise=>exercise}) %>");
$("#poll_questions_title").focus();
}
}
function add_MCQ(){
var forms = $("form.new_exercise_question");
2015-11-20 21:50:27 +08:00
if($("#polls_head_edit").is(":visible")){
alert("请先保存测验标题及测验基本信息。");
}else if(forms.length > 0){
alert("请先保存正在编辑的题目再新建。");
} else{
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ', :locals => {:exercise=>exercise}) %>");
$("#poll_questions_title").focus();
}
}
function add_single(){
var forms = $("form.new_exercise_question");
2015-11-20 21:50:27 +08:00
if($("#polls_head_edit").is(":visible")){
alert("请先保存测验标题及测验基本信息。");
}else if(forms.length > 0){
alert("请先保存正在编辑的题目再新建。");
} else{
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single', :locals => {:exercise=>exercise}) %>");
$("#poll_questions_title").focus();
}
}
</script>