作品列表增加分班的过滤
This commit is contained in:
parent
f909fbb835
commit
66c1dfa77e
|
@ -9,36 +9,75 @@ class StudentWorkController < ApplicationController
|
||||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list]
|
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@order,@b_sort,@name = params[:order] || "score",params[:sort] || "desc",params[:name] || ""
|
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||||
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
|
unless @group == "0" || @group.nil?
|
||||||
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
|
group_students = CourseGroup.find_by_id(@group).users
|
||||||
if @show_all
|
if group_students.empty?
|
||||||
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
|
student_in_group = '(0)'
|
||||||
if @order == "name"
|
else
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
||||||
else
|
end
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
|
||||||
end
|
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
|
||||||
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
|
if @show_all
|
||||||
my_work = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
|
||||||
if my_work.empty?
|
|
||||||
@stundet_works = []
|
|
||||||
else
|
|
||||||
if @order == "name"
|
if @order == "name"
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||||
else
|
else
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||||
|
end
|
||||||
|
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
|
||||||
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
if my_work.empty?
|
||||||
|
@stundet_works = []
|
||||||
|
else
|
||||||
|
if @order == "name"
|
||||||
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||||
|
else
|
||||||
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else #学生
|
||||||
|
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
|
||||||
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
|
||||||
|
@is_evaluation = true
|
||||||
|
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||||
|
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else #学生
|
else
|
||||||
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
|
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
|
||||||
@stundet_works = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
|
||||||
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
|
if @show_all
|
||||||
@is_evaluation = true
|
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
|
||||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
if @order == "name"
|
||||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||||
|
else
|
||||||
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||||
|
end
|
||||||
|
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
|
||||||
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
if my_work.empty?
|
||||||
|
@stundet_works = []
|
||||||
|
else
|
||||||
|
if @order == "name"
|
||||||
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||||
|
else
|
||||||
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else #学生
|
||||||
|
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
|
||||||
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
|
||||||
|
@is_evaluation = true
|
||||||
|
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||||
|
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
@homework_commons = @course.homework_commons.order("created_at desc")
|
||||||
|
@ -170,6 +209,12 @@ class StudentWorkController < ApplicationController
|
||||||
if @score
|
if @score
|
||||||
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
||||||
@score.score = params[:score] if params[:score]
|
@score.score = params[:score] if params[:score]
|
||||||
|
if User.current.admin?
|
||||||
|
@score.reviewer_role = 1
|
||||||
|
else
|
||||||
|
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
|
||||||
|
@score.reviewer_role = get_role_by_name(role)
|
||||||
|
end
|
||||||
@is_new = false
|
@is_new = false
|
||||||
else
|
else
|
||||||
@score = StudentWorksScore.new
|
@score = StudentWorksScore.new
|
||||||
|
@ -177,8 +222,12 @@ class StudentWorkController < ApplicationController
|
||||||
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
||||||
@score.user_id = User.current.id
|
@score.user_id = User.current.id
|
||||||
@score.student_work_id = @work.id
|
@score.student_work_id = @work.id
|
||||||
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
|
if User.current.admin?
|
||||||
User.current.admin? ? @score.reviewer_role = 1 : @score.reviewer_role = get_role_by_name(role)
|
@score.reviewer_role = 1
|
||||||
|
else
|
||||||
|
role = User.current.members.where("course_id = ?",@course.id).first.roles.first.name
|
||||||
|
@score.reviewer_role = get_role_by_name(role)
|
||||||
|
end
|
||||||
@is_new = true
|
@is_new = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,10 @@ module StudentWorkHelper
|
||||||
def course_group_list course
|
def course_group_list course
|
||||||
result = []
|
result = []
|
||||||
if course.course_groups && !course.course_groups.empty?
|
if course.course_groups && !course.course_groups.empty?
|
||||||
result << l(:label_chose_group)
|
base = []
|
||||||
|
base << l(:label_chose_group)
|
||||||
|
base << 0
|
||||||
|
result << base
|
||||||
course.course_groups.each do |group|
|
course.course_groups.each do |group|
|
||||||
option = []
|
option = []
|
||||||
option << group.name
|
option << group.name
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
|
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_tit">
|
<li class=" hwork_tit">
|
||||||
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
|
<%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_time_c">
|
<li class=" hwork_time_c">
|
||||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||||
|
|
|
@ -2,46 +2,46 @@
|
||||||
<span class="c_dark f14 fb fl">学号</span>
|
<span class="c_dark f14 fb fl">学号</span>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_name f14 fb c_dark">
|
<li class=" hwork_name f14 fb c_dark">
|
||||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "name"%>
|
<% if @show_all && @order == "name"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="hwork_tit">
|
<li class="hwork_tit">
|
||||||
<span class="c_dark f14 fb fl">作品名称</span>
|
<span class="c_dark f14 fb fl">作品名称</span>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_time f14 fb c_dark">
|
<li class=" hwork_time f14 fb c_dark">
|
||||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "created_at"%>
|
<% if @show_all && @order == "created_at"%>
|
||||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="mr5 w40 ml15">
|
<li class="mr5 w40 ml15">
|
||||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "teacher_score"%>
|
<% if @show_all && @order == "teacher_score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="mr5 w40 ml20">
|
<li class="mr5 w40 ml20">
|
||||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
|
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml15 w40">
|
<li class="ml15 w40">
|
||||||
<% if @homework.homework_type == 1%>
|
<% if @homework.homework_type == 1%>
|
||||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% elsif @homework.homework_type == 2%>
|
<% elsif @homework.homework_type == 2%>
|
||||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @show_all && @order == "student_score"%>
|
<% if @show_all && @order == "student_score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml20">
|
<li class="ml20">
|
||||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "score"%>
|
<% if @show_all && @order == "score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
|
@ -2,36 +2,36 @@
|
||||||
<span class="c_dark f14 fb fl">学号</span>
|
<span class="c_dark f14 fb fl">学号</span>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_name f14 fb c_dark">
|
<li class=" hwork_name f14 fb c_dark">
|
||||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "name"%>
|
<% if @show_all && @order == "name"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="hwork_tit_une">
|
<li class="hwork_tit_une">
|
||||||
<span class="c_dark f14 fb fl">作品名称</span>
|
<span class="c_dark f14 fb fl">作品名称</span>
|
||||||
</li>
|
</li>
|
||||||
<li class=" hwork_time f14 fb c_dark">
|
<li class=" hwork_time f14 fb c_dark">
|
||||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "created_at"%>
|
<% if @show_all && @order == "created_at"%>
|
||||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="mr5 w40 ml15">
|
<li class="mr5 w40 ml15">
|
||||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "teacher_score"%>
|
<% if @show_all && @order == "teacher_score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="mr5 w40 ml20">
|
<li class="mr5 w40 ml20">
|
||||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
|
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml20">
|
<li class="ml20">
|
||||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "score"%>
|
<% if @show_all && @order == "score"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
|
@ -48,9 +48,9 @@
|
||||||
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
|
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
|
||||||
</span>
|
</span>
|
||||||
<% if @show_all%>
|
<% if @show_all%>
|
||||||
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
|
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this).val(),$(this).next().val(),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
|
||||||
<%= select_tag :late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"} %>
|
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if @is_teacher %>
|
||||||
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
|
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev().prev().val(),$(this).prev().val(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
|
||||||
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
|
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if @is_teacher%>
|
<% if @is_teacher%>
|
||||||
|
|
|
@ -861,14 +861,14 @@ function clickOK(path)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//查询
|
//查询
|
||||||
function SearchByName(obj,url,event)
|
function SearchByName(name,group,url,event)
|
||||||
{
|
{
|
||||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||||
if(keycode == '13'){
|
if(keycode == '13'){
|
||||||
location.href = url + "&name=" + obj.val();
|
location.href = url + "&name=" + name + "&group=" + group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function SearchByName_1(obj,url)
|
function SearchByName_1(name,group,url)
|
||||||
{
|
{
|
||||||
location.href = url + "&name=" + obj.val();
|
location.href = url + "&name=" + name + "&group=" + group;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue