课程内老师可以对作业进行编辑、删除、开启匿评
This commit is contained in:
parent
f04e0c5f84
commit
281e97e468
|
@ -2297,13 +2297,6 @@ module ApplicationHelper
|
|||
|
||||
#获取匿评相关连接代码
|
||||
def homework_anonymous_comment homework
|
||||
# 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 = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
|
||||
elsif homework.student_works.count >= 2 #作业份数大于2
|
||||
|
@ -2324,14 +2317,18 @@ module ApplicationHelper
|
|||
def student_new_homework homework
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil?
|
||||
link_to l(:label_commit_homework), new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
"<span class='fr mr10 pr_join_span '>#{l(:label_edit_homework)}</span>".html_safe
|
||||
elsif homework.homework_type == 2 #编程作业不能修改作品
|
||||
"<span class='fr mr10 pr_join_span ' title='编程作业不可修改作品'>作品已交</span>".html_safe
|
||||
link_to "作品已交", "javascript:void(0);", :class => 'fr mr10 pr_join_span c_white', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_type == 2 #编程作业修改作品
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1
|
||||
link_to "作品已交", "javascript:void(0);", :class => 'fr mr10 pr_join_span c_white', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
else
|
||||
link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit c_blue'
|
||||
link_to "修改作品", edit_student_work_path(work.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
|
||||
</p>
|
||||
<% if @is_teacher%>
|
||||
<%#= homework_anonymous_comment(homework)%>
|
||||
<%#= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
|
||||
<%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<%= homework_anonymous_comment(homework)%>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
|
||||
<%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment homework %>
|
||||
<%= student_new_homework homework %>
|
||||
|
|
|
@ -852,4 +852,6 @@ a:hover.c_grey{ color:#333;}
|
|||
.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.last_time{width:auto; text-align:right; margin-right:70px;}
|
||||
.link_file_box{ width:360px;}
|
||||
a.postOptionLink{float: right;color: #64bdd9;display: block;padding: 1px 5px;border: 1px solid #64bdd9;width: initial;}
|
||||
a:hover.postOptionLink {color: #fff;background: #64bdd9;}
|
||||
|
||||
|
|
|
@ -623,8 +623,8 @@ a.postReplyCancel:hover {color:#ffffff;}
|
|||
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}
|
||||
.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;}
|
||||
.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
|
||||
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
|
||||
a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;}
|
||||
/*a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}*/
|
||||
/*a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;}*/
|
||||
.homepagePostReplyPortrait {float:left; width:45px;}
|
||||
.homepagePostReplyDes {float:left; width:620px; margin-left:15px;}
|
||||
.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;}
|
||||
|
|
Loading…
Reference in New Issue