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

55 lines
4.1 KiB
Plaintext
Raw Normal View History

2015-11-25 15:02:32 +08:00
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
$(function(){
2016-07-22 15:32:37 +08:00
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
2015-11-25 15:02:32 +08:00
});
2015-11-26 15:21:46 +08:00
function republish_exercise(exercise_id,index)
2015-11-25 15:02:32 +08:00
{
2016-11-17 17:04:00 +08:00
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);
2015-11-25 15:02:32 +08:00
}
function clickCanel(){hideModal("#popbox02");}
2016-11-17 17:04:00 +08:00
function exercise_submit(status, exercise_id,exercise_name,index)
2015-11-25 15:02:32 +08:00
{
if(exercise_name == 0)
{
alert("试卷标题不能为空");
}
else
{
2016-11-17 17:04:00 +08:00
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);
}
2015-11-25 15:02:32 +08:00
}
}
2016-11-17 17:04:00 +08:00
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);
}
2015-11-25 15:02:32 +08:00
</script>
2016-07-22 15:32:37 +08:00
<div class="courseRSide fl" id="homework_page_right">
2015-11-25 15:02:32 +08:00
<div class="polls_content02" id="exercise" style="width: 730px;">
<%= render :partial => 'exercises_list'%>
2016-07-22 15:32:37 +08:00
</div><!--问卷内容end-->
</div>