|
|
@ -2278,7 +2278,9 @@ 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 homework.student_works.count >= 2 #作业份数大于2
|
|
|
|
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
|
|
|
|
case homework.homework_detail_manual.comment_status
|
|
|
|
when 1
|
|
|
|
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'
|
|
|
|
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'
|
|
|
|