educoder/app/views/exercise/index.html.erb

75 lines
4.8 KiB
Plaintext

<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
function close_searchbox(){
if($("#exercise_name_search").val() != ""){
$("#exercise_name_search").val("");
$('#exercise_search_form').submit();
}
}
function republish_exercise(exercise_id,index)
{
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>取消发布后学生答题将会被清空<br />是否确定取消发布该试卷?</p>' +
'<a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取&nbsp;&nbsp;消</a>' +
'<a href="/exercise/'+ exercise_id +'/republish_exercise?index='+ index +'" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确&nbsp;&nbsp;定</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
}
function clickCanel(){hideModal("#popbox02");}
function exercise_submit(status, exercise_id,exercise_name,index)
{
if(exercise_name == 0)
{
alert("试卷标题不能为空");
}
else
{
if (status == 1){
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您还没有设置截止时间,请先设置截止时间再发布</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="hideModal();">知道了</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
} else if(status == 2){
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您设置的截止时间已过期,请重新设置</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="hideModal();">知道了</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
} else{
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>发布后不能再对试卷进行修改<br/>是否确定发布</p>' +
'<a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取&nbsp;&nbsp;消</a>' +
'<a href="/exercise/'+ exercise_id +'/publish_exercise?index='+ index +'" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确&nbsp;&nbsp;定</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
}
}
}
function delete_exercise(id){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您是否确定删除</p><div class="cl"></div><a href="/exercise/'+ id +'" class="fr sy_btn_blue mr90 mt10" data-method="delete" data-remote="true">确定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
</script>
<div class="with85 fl">
<div class="ml15 user_bg_shadow bor-grey-e">
<div class="edu-con-top clearfix">
<p class="ml15 color-grey3 fl">试卷列表</p>
<% if @is_teacher %>
<a href="<%= new_exercise_path(:course_id => @course.id) %>" class="white-btn orange-btn fr mr20 mt3" title="新建">+&nbsp;新建</a>
<!--<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="题库选用">+&nbsp;题库选用</a>-->
<!--<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="导出成绩">导出成绩</a>-->
<% end %>
</div>
<div class="edu-class-innner-conbox">
<div class="edu-con-top clearfix" id="exercise_index_tab">
<%= render :partial => "exercise/exercise_index_tab" %>
</div>
<div id="exercise_index_list" class="mh550 clearfix">
<%= render :partial => "exercise/exercises_list" %>
</div>
</div>
</div>
</div>