1。作业处于匿评阶段时学生才可对作业进行评分,否则不可对作业进行评分

2。作业处于匿评阶段且匿评作业列表不为空时才给用户弹出匿评提示
3。修改已关闭匿评为匿评结束
This commit is contained in:
sw 2014-11-03 10:12:22 +08:00
parent 66641e6507
commit fbc66484a0
4 changed files with 27 additions and 12 deletions

View File

@ -41,7 +41,7 @@
<% when 1 %>
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
已关闭匿评
匿评结束
<% end %>
</span>
<%= link_to(

View File

@ -29,7 +29,8 @@
window.onready = function()
{
<% if !@is_teacher && @homework_list.count > 0%>
<% if !@is_teacher && @homework_list.count > 0 && @bid.comment_status == 1%>
//登录者不是老师且作业列表数目不为0且作业处于开启匿评阶段
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>');
showModal('ajax-modal', '480px');
$('#ajax-modal').css('height','240px');

View File

@ -34,9 +34,12 @@
<li id="tb_6" class="normaltab">
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<li id="tb_7" class="normaltab">
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<% if @bid.comment_status == 2 %>
<!-- 匿评结束后才能看到全部作业列表 -->
<li id="tb_7" class="normaltab">
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<% end %>
<li id="tb_8" class="normaltab">
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span id="jours_count" class="c_red f_12">

View File

@ -61,13 +61,24 @@
<% end %>
</li>
<% elsif is_student_batch_homework%>
<!-- 学生匿评列表,正常显示 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<!-- 学生匿评列表 -->
<% if @bid.comment_status == 1 %>
<!-- 处于开启匿评阶段,可以正常评分 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% elsif @bid.comment_status == 2%>
<!-- 处于匿评已关闭阶段,不容许评分 -->
<li class="wping">
<a>评分</a>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% end %>
<% else %>
<!-- 学生众评列表,显示为点赞 -->
<li class="wzan" id="homeworl_praise_li_<%= homework.id%>">