2015-11-19 11:37:49 +08:00
|
|
|
<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(){
|
2015-11-19 14:35:51 +08:00
|
|
|
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){
|
2015-11-19 14:35:51 +08:00
|
|
|
alert("请先保存正在编辑的题目再新建。");
|
|
|
|
} else{
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC', :locals => {:exercise=>exercise}) %>");
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
}
|
2015-11-19 11:37:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function add_MCQ(){
|
2015-11-19 14:35:51 +08:00
|
|
|
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){
|
2015-11-19 14:35:51 +08:00
|
|
|
alert("请先保存正在编辑的题目再新建。");
|
|
|
|
} else{
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ', :locals => {:exercise=>exercise}) %>");
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
}
|
2015-11-19 11:37:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function add_single(){
|
2015-11-19 14:35:51 +08:00
|
|
|
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){
|
2015-11-19 14:35:51 +08:00
|
|
|
alert("请先保存正在编辑的题目再新建。");
|
|
|
|
} else{
|
|
|
|
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single', :locals => {:exercise=>exercise}) %>");
|
|
|
|
$("#poll_questions_title").focus();
|
|
|
|
}
|
2015-11-19 11:37:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|