我的评分显示错误

This commit is contained in:
sw 2015-07-02 17:44:58 +08:00
parent e82c88df48
commit 194ab98361
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class StudentWorkController < ApplicationController
@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("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
end end
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品 else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
my_work = @homework.student_works.select("*,final_score - absence_penalty - late_penalty as score").where(:user_id => User.current.id) 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 my_work.empty? if my_work.empty?
@stundet_works = [] @stundet_works = []
else else