增加老师布置作业学生访问的列表
This commit is contained in:
parent
0408cc5150
commit
221276ba1f
|
@ -576,6 +576,7 @@ class CoursesController < ApplicationController
|
|||
bids = bids.like(params[:name]) if params[:name].present?
|
||||
@bids = paginateHelper bids,10
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
render :layout => 'base_courses'
|
||||
else
|
||||
render_403
|
||||
|
|
|
@ -694,16 +694,46 @@ module CoursesHelper
|
|||
end
|
||||
|
||||
def bid_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
if bid.homeworks.count >= 2
|
||||
case bid.comment_status
|
||||
when 0
|
||||
link = link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
when 1
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
when 2
|
||||
link = "<span class='fr mr10 pr_join_span ' title='匿评结束'>匿评结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
end
|
||||
link
|
||||
end
|
||||
|
||||
def student_new_homework bid
|
||||
user_homework = cur_user_homework_for_bid bid
|
||||
if user_homework && user_homework.empty?
|
||||
link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
"<span class='fr mr10 pr_join_span '>作业已交</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def student_anonymous_comment bid
|
||||
if bid.open_anonymous_evaluation == 1
|
||||
case bid.comment_status
|
||||
when 0
|
||||
# <a href="#" class="fr mr10 work_edit">关闭匿评</a>
|
||||
link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
"<span class='fr mr10 pr_join_span '>未开启匿评</span>".html_safe
|
||||
when 1
|
||||
link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
"<span class='fr mr10 pr_join_span '>正在匿评中</span>".html_safe
|
||||
when 2
|
||||
"<span class='fr mr10 pr_join_span '>匿评结束</span>".html_safe
|
||||
"<span class='fr mr10 pr_join_span '>匿评已结束</span>".html_safe
|
||||
end
|
||||
else
|
||||
"<span class='fr mr10 pr_join_span '>未启用匿评</span>".html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
<% if @is_teacher%>
|
||||
<%= bid_anonymous_comment(bid)%>
|
||||
<%= link_to(l(:button_edit),edit_bid_path(:course_id =>@course.id, :bid_id => bid.id), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment bid %>
|
||||
<%= student_new_homework bid %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p id="bid_description_<%= bid.id%>" class="news_description mt5">
|
||||
|
|
Loading…
Reference in New Issue