不限定匿评人数
This commit is contained in:
parent
ecae600546
commit
4575b8274e
|
@ -206,7 +206,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
||||||
student_work_projects.each_with_index do |pro_work, pro_index|
|
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||||
n = @homework_detail_manual.evaluation_num
|
n = @homework_detail_manual.evaluation_num
|
||||||
n = n < student_works.size ? n : student_works.size - 1
|
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
|
||||||
work_index = -1
|
work_index = -1
|
||||||
student_works.each_with_index do |stu_work, stu_index|
|
student_works.each_with_index do |stu_work, stu_index|
|
||||||
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
||||||
|
@ -223,7 +223,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
student_works.each_with_index do |work, index|
|
student_works.each_with_index do |work, index|
|
||||||
user = work.user
|
user = work.user
|
||||||
n = @homework_detail_manual.evaluation_num
|
n = @homework_detail_manual.evaluation_num
|
||||||
n = n < student_works.size ? n : student_works.size - 1
|
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
|
||||||
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
||||||
assigned_homeworks.each do |h|
|
assigned_homeworks.each do |h|
|
||||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
||||||
|
|
|
@ -2854,7 +2854,7 @@ module ApplicationHelper
|
||||||
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
|
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 && work.user_id == User.current.id #匿评作业,且作业状态不是在开启匿评之前
|
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||||
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
||||||
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束"
|
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束"
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace :homework_evaluation do
|
||||||
student_work_projects = homework_common.student_work_projects.where("student_work_id is not null")
|
student_work_projects = homework_common.student_work_projects.where("student_work_id is not null")
|
||||||
student_work_projects.each_with_index do |pro_work, pro_index|
|
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||||
n = homework_detail_manual.evaluation_num
|
n = homework_detail_manual.evaluation_num
|
||||||
n = n < student_works.size ? n : student_works.size - 1
|
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
|
||||||
work_index = -1
|
work_index = -1
|
||||||
student_works.each_with_index do |stu_work, stu_index|
|
student_works.each_with_index do |stu_work, stu_index|
|
||||||
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
||||||
|
@ -37,7 +37,7 @@ namespace :homework_evaluation do
|
||||||
student_works.each_with_index do |work, index|
|
student_works.each_with_index do |work, index|
|
||||||
user = work.user
|
user = work.user
|
||||||
n = homework_detail_manual.evaluation_num
|
n = homework_detail_manual.evaluation_num
|
||||||
n = n < student_works.size ? n : student_works.size - 1
|
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
|
||||||
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
||||||
assigned_homeworks.each do |h|
|
assigned_homeworks.each do |h|
|
||||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
||||||
|
|
Loading…
Reference in New Issue