1、编程作业可以开启匿评

2、取消扣分标准的显示
This commit is contained in:
sw 2015-09-11 09:59:34 +08:00
parent a94521f2e1
commit 30ebe9b2d5
3 changed files with 33 additions and 31 deletions

View File

@ -2297,25 +2297,27 @@ module ApplicationHelper
#获取匿评相关连接代码 #获取匿评相关连接代码
def homework_anonymous_comment homework def homework_anonymous_comment homework
if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 # if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") #
link = "<span class='fr mr10 pr_join_span ' title='作业截止日期之前不可以启动匿评'>启动匿评</span>".html_safe # elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
elsif homework.student_works.count >= 2 #作业份数大于2 # link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
case homework.homework_detail_manual.comment_status # else
when 1 # link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' # end
when 2
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit' if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
when 3 link = "<span class='fr mr10 pr_join_span ' title='作业截止日期之前不可以启动匿评'>启动匿评</span>".html_safe
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe elsif homework.student_works.count >= 2 #作业份数大于2
end case homework.homework_detail_manual.comment_status
else when 1
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
when 2
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
when 3
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
end end
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
else else
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
end end
link link
end end

View File

@ -98,17 +98,17 @@
<div class="cl"></div> <div class="cl"></div>
<% end%> <% end%>
<div class="mt5"> <!--div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span> <span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red"> <div class="fl mb5 c_red">
<% if homework.homework_type == 1%> <%# if homework.homework_type == 1%>
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%> <%#= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%>
<% else%> <%# else%>
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher%> <%#= scoring_rules homework.late_penalty,homework.id,@is_teacher%>
<% end%> <%# end%>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div-->
<span class="fl"><%= l(:label_end_time)%><%= homework.end_time%></span> <span class="fl"><%= l(:label_end_time)%><%= homework.end_time%></span>
<% if betweentime(homework.end_time) < 0 %> <% if betweentime(homework.end_time) < 0 %>

View File

@ -185,18 +185,18 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt5"> <!--div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span> <span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red"> <div class="fl mb5 c_red">
<% if @homework.homework_type == 1%> <%# if @homework.homework_type == 1%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%> <%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
<% else%> <%# else%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%> <%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
<% end%> <%# end%>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div-->
<span class="fl">截止时间:<%= @homework.end_time%></span> <span class="fl">截止时间:<%= @homework.end_time%></span>
<div > <div >
<% if betweentime(@homework.end_time) < 0 %> <% if betweentime(@homework.end_time) < 0 %>