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

33 lines
1.4 KiB
Plaintext

<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>
</div>
<script type="text/javascript">
function exercise_submit() {
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{
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) %>');
}
}
</script>