新建测验样式调整

This commit is contained in:
Tim 2015-11-25 15:02:32 +08:00
parent d1f16a0851
commit bd7ee66e77
3 changed files with 153 additions and 146 deletions

View File

@ -1,61 +1,63 @@
<%# has_commit = has_commit_poll?(poll.id ,User.current)%>
<% exercise_name = exercise.exercise_name.empty? ? l(:label_poll_new) : exercise.exercise_name%>
<% if @is_teacher%>
<li title="<%= exercise.exercise_name %>">
<div style="width: 310px;float: left;">
<%# if has_commit %>
<%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
<%# else %>
<%#= link_to poll_name, exercise_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
<%# end %>
<%= link_to exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue" %>
</div>
</li>
<% if exercise.exercise_status == 1%>
<li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li>
<% else %>
<li><%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fl ml10"%></li>
<% end%>
<% if exercise.exercise_status == 1 %>
<li><a href="javascript:" class="pollsbtn btn_pu fl ml5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>);">发布试卷</a></li>
<% elsif exercise.exercise_status == 2%>
<li><a href="javascript:" class="pollsbtn btn_de fl ml5" onclick="republish_exercise(<%= exercise.id%>);">取消发布</a></li>
<% else%>
<li class="pollsbtn fl ml10 pollsbtn_grey" style="margin-left: 5px;" >发布试卷</li>
<% end%>
<%= link_to(l(:button_delete), exercise,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
<% if exercise.exercise_status == 1 %>
<li><%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml5"%></li>
<% else%>
<li class="polls_de_grey fr ml5" title="未发布的试卷才能进行编辑">编辑</li>
<% end%>
<%# if exercise.exercise_status == 2 %>
<!--<li><a class="polls_de fr ml5" onclick="" href="javascript:">关闭</a></li>-->
<%# else %>
<!--<li class="polls_de_grey fr ml5" title="发布的问卷才能进行关闭">关闭</li>-->
<%# end%>
<%# if exercise.exercise_status == 1%>
<!--<li class="polls_de_grey fr ml5">导出</li>-->
<%# elsif exercise.exercise_status == 2 || exercise.exercise_status == 3 %>
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
<%# end%>
<li class="polls_date fr"><%= format_date exercise.created_at.to_date%></li>
<% else%>
<% if exercise.exercise_status == 2%>
<%# if has_commit%>
<!--li><%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
<li class="pollsbtn_tip fl ml5">已答</li-->
<%#else%>
<%= link_to exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
<%#end%>
<% end%>
<li class="polls_date fr mr10"><%= format_date exercise.created_at.to_date%></li>
<%# has_commit = has_commit_poll?(poll.id ,User.current)%>
<% exercise_name = exercise.exercise_name.empty? ? l(:label_poll_new) : exercise.exercise_name%>
<% if @is_teacher%>
<li title="<%= exercise.exercise_name %>">
<div style="width: 310px;float: left;">
<%# if has_commit %>
<%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
<%# else %>
<%#= link_to poll_name, exercise_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
<%# end %>
<%= link_to exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue" %>
</div>
</li>
<%= link_to(l(:button_delete), exercise,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
<% if exercise.exercise_status == 1 %>
<li><%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml5"%></li>
<% else%>
<li class="polls_de_grey fr ml5" title="未发布的试卷才能进行编辑">编辑</li>
<% end%>
<%# if exercise.exercise_status == 2 %>
<!--<li><a class="polls_de fr ml5" onclick="" href="javascript:">关闭</a></li>-->
<%# else %>
<!--<li class="polls_de_grey fr ml5" title="发布的问卷才能进行关闭">关闭</li>-->
<%# end%>
<%# if exercise.exercise_status == 1%>
<!--<li class="polls_de_grey fr ml5">导出</li>-->
<%# elsif exercise.exercise_status == 2 || exercise.exercise_status == 3 %>
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
<%# end%>
<li class="polls_date fr"><%= format_date exercise.created_at.to_date%></li>
<% if exercise.exercise_status == 1 %>
<li><a href="javascript:" class="pollsbtn btn_pu fr mr5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>);">发布试卷</a></li>
<% elsif exercise.exercise_status == 2%>
<li><a href="javascript:" class="pollsbtn btn_de fr mr5" onclick="republish_exercise(<%= exercise.id%>);">取消发布</a></li>
<% else%>
<li class="pollsbtn fr mr10 pollsbtn_grey" style="margin-left: 5px;" >发布试卷</li>
<% end%>
<% if exercise.exercise_status == 1%>
<li class="pollsbtn fr mr10 pollsbtn_grey">统计结果</li>
<% else %>
<li><%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%></li>
<% end%>
<% else%>
<% if exercise.exercise_status == 2%>
<%# if has_commit%>
<!--li><%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
<li class="pollsbtn_tip fl ml5">已答</li-->
<%#else%>
<%= link_to exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
<%#end%>
<% end%>
<li class="polls_date fr mr10"><%= format_date exercise.created_at.to_date%></li>
<% end%>

View File

@ -1,25 +1,25 @@
<div class="polls_head">
<h2>所有试卷
<span><%= @obj_count%></span>
</h2>
<% if @is_teacher%>
<%#= link_to "导入", other_poll_poll_index_path(:polls_group_id => @course.id), :remote=>true,:class => "newbtn"%>
<%= link_to "新建试卷 ", new_exercise_path(:course_id => @course.id), :class => "newbtn" %>
<% end%>
</div>
<div class="cl"></div>
<div id="polls_list" class="polls_list">
<% @exercises.each do |exercise|%>
<ul id="exercises_<%= exercise.id %>" class="polls_list_ul">
<%= render :partial => 'exercise', :locals => {:exercise => exercise} %>
</ul>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
<div class="polls_head" style="width:730px;">
<h2>所有试卷
<span><%= @obj_count%></span>
</h2>
<% if @is_teacher%>
<%#= link_to "导入", other_poll_poll_index_path(:polls_group_id => @course.id), :remote=>true,:class => "newbtn"%>
<%= link_to "新建试卷 ", new_exercise_path(:course_id => @course.id), :class => "newbtn" %>
<% end%>
</div>
<div class="cl"></div>
<div id="polls_list" class="polls_list">
<% @exercises.each do |exercise|%>
<ul id="exercises_<%= exercise.id %>" class="polls_list_ul">
<%= render :partial => 'exercise', :locals => {:exercise => exercise} %>
</ul>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div><!--列表end-->

View File

@ -1,63 +1,68 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
function republish_exercise(exercise_id)
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>取消发布后学生答题将会被清空<br />是否确定取消发布该测验?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/exercise/"+ exercise_id +"/republish_exercise' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a 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");
}
function clickCanel(){hideModal("#popbox02");}
function exercise_submit(exercise_id,exercise_name)
{
if(exercise_name == 0)
{
alert("试卷标题不能为空");
}
else
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>测验发布后将不能对测验进行修改,<br />是否确定发布该测验?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/exercise/"+ exercise_id +"/publish_exercise' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
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>
<div class="polls_content02" id="exercise">
<%= render :partial => 'exercises_list'%>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
$(function(){
$("#RSide").css("width","730px");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#Container").css("width","1000px");
});
function republish_exercise(exercise_id)
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>取消发布后学生答题将会被清空<br />是否确定取消发布该测验?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/exercise/"+ exercise_id +"/republish_exercise' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a 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");
}
function clickCanel(){hideModal("#popbox02");}
function exercise_submit(exercise_id,exercise_name)
{
if(exercise_name == 0)
{
alert("试卷标题不能为空");
}
else
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>测验发布后将不能对测验进行修改,<br />是否确定发布该测验?</p>" +
"<div class='polls_btn_box'>" +
"<a href='/exercise/"+ exercise_id +"/publish_exercise' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
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>
<div class="polls_content02" id="exercise" style="width: 730px;">
<%= render :partial => 'exercises_list'%>
</div><!--问卷内容end-->