35 lines
1.6 KiB
Plaintext
35 lines
1.6 KiB
Plaintext
|
<%= form_for("",
|
||
|
:html => { :multipart => true },
|
||
|
:url => {:controller => 'exercise',
|
||
|
:action => 'commit_exercise'
|
||
|
},:remote=>true ) do |f| %>
|
||
|
<div class="ur_buttons">
|
||
|
<a class="ur_button_submit" onclick="poll_submit();"> 提交 </a>
|
||
|
<div class="polls_cha">
|
||
|
<input name="exercise[show_result]" value="" type="checkbox">
|
||
|
<label for="">允许学生查看测验结果</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
function poll_submit() {
|
||
|
var question_form = $("form.new_exercise_question");
|
||
|
<% current_score = get_current_score exercise %>
|
||
|
if($("#polls_head_edit").is(":visible")){
|
||
|
alert("请先保存测验标题及测验基本信息。");
|
||
|
} else if(question_form.length > 0) {
|
||
|
alert("请先保存正在编辑的题目。");
|
||
|
} else{
|
||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'exercise_submit_info', locals: { :score => current_score,:is_remote => false}) %>');
|
||
|
showModal('ajax-modal', '310px');
|
||
|
$('#ajax-modal').css('height','120px');
|
||
|
$('#ajax-modal').siblings().remove();
|
||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||
|
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||
|
$('#ajax-modal').parent().removeClass("alert_praise");
|
||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||
|
}
|
||
|
}
|
||
|
</script>
|