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

33 lines
1.4 KiB
Plaintext
Raw Normal View History

2017-03-03 14:43:51 +08:00
<div class="ur_buttons" style="width: 143px;">
<a class="btn_blue_64_width mr10" onclick="exercise_submit();">保存</a>
<a class="btn_blue_64_width" onclick="exercise_save();">立即发布</a>
2016-01-20 16:03:28 +08:00
</div>
<script type="text/javascript">
2017-03-03 14:43:51 +08:00
function exercise_submit() {
2016-01-20 16:03:28 +08:00
var question_form = $("form.new_exercise_question");
if($("#polls_head_edit").is(":visible")){
2017-03-03 14:43:51 +08:00
notice_box("请先保存测验标题及测验基本信息。");
} else if($("#show_exercise_time").html().trim() == ""){
notice_box("请先设置测验的截止时间");
}
else if(question_form.length > 0) {
2017-03-03 14:43:51 +08:00
notice_box("请先保存正在编辑的题目。");
2016-01-20 16:03:28 +08:00
} else{
2017-03-03 14:43:51 +08:00
window.location.href = '<%= exercise_url(@exercise) %>';
}
}
function exercise_save() {
var question_form = $("form.new_exercise_question");
if($("#polls_head_edit").is(":visible")){
notice_box("请先保存测验标题及测验基本信息。");
} else if($("#show_exercise_time").html().trim() == ""){
notice_box("请先设置测验的截止时间");
}
else if(question_form.length > 0) {
notice_box("请先保存正在编辑的题目。");
} else{
$.get('<%= publish_exercise_exercise_path(@exercise) %>');
2016-01-20 16:03:28 +08:00
}
}
2015-11-19 17:18:58 +08:00
</script>