parent
a94521f2e1
commit
30ebe9b2d5
|
@ -2297,25 +2297,27 @@ module ApplicationHelper
|
|||
|
||||
#获取匿评相关连接代码
|
||||
def homework_anonymous_comment homework
|
||||
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.student_works.count >= 2 #作业份数大于2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
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
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
# if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业
|
||||
#
|
||||
# elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
|
||||
# link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
|
||||
# else
|
||||
# link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
# end
|
||||
|
||||
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.student_works.count >= 2 #作业份数大于2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
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
|
||||
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
|
||||
link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
|
||||
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
|
||||
link
|
||||
end
|
||||
|
|
|
@ -98,17 +98,17 @@
|
|||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
||||
<div class="mt5">
|
||||
<!--div class="mt5">
|
||||
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
|
||||
<div class="fl mb5 c_red">
|
||||
<% if homework.homework_type == 1%>
|
||||
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%>
|
||||
<% else%>
|
||||
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher%>
|
||||
<% end%>
|
||||
<%# if homework.homework_type == 1%>
|
||||
<%#= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%>
|
||||
<%# else%>
|
||||
<%#= scoring_rules homework.late_penalty,homework.id,@is_teacher%>
|
||||
<%# end%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div-->
|
||||
|
||||
<span class="fl"><%= l(:label_end_time)%>:<%= homework.end_time%></span>
|
||||
<% if betweentime(homework.end_time) < 0 %>
|
||||
|
|
|
@ -185,18 +185,18 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5">
|
||||
<!--div class="mt5">
|
||||
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
|
||||
<div class="fl mb5 c_red">
|
||||
<% if @homework.homework_type == 1%>
|
||||
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
|
||||
<% else%>
|
||||
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
|
||||
<% end%>
|
||||
<%# if @homework.homework_type == 1%>
|
||||
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
|
||||
<%# else%>
|
||||
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
|
||||
<%# end%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div-->
|
||||
<span class="fl">截止时间:<%= @homework.end_time%></span>
|
||||
<div >
|
||||
<% if betweentime(@homework.end_time) < 0 %>
|
||||
|
|
Loading…
Reference in New Issue