普通作业接口调整

sso^2
cxt 5 years ago
parent 8dfbe577ad
commit eb790bdf99

@ -171,10 +171,10 @@ module HomeworkCommonsHelper
{status: status, time: time} {status: status, time: time}
end end
# 作品数统计type 1 已提交 0 未提交 # 作品数统计type 1 已提交 0 未提交 2 所有
def studentwork_count homework_common, type, member def studentwork_count homework_common, type, member
student_works = homework_common.teacher_works(member) student_works = homework_common.teacher_works(member)
type == 1 ? student_works.where("work_status != 0").size : student_works.where(work_status: 0).size type == 2 ? student_works.size : (type == 1 ? student_works.where("work_status != 0").size : student_works.where(work_status: 0).size)
end end
# 上次查重的时间 # 上次查重的时间

@ -27,6 +27,7 @@ json.homeworks @homework_commons.each do |homework|
unless curr_status[:status].include?("未发布") unless curr_status[:status].include?("未发布")
json.commit_count studentwork_count homework, 1, @member json.commit_count studentwork_count homework, 1, @member
json.uncommit_count studentwork_count homework, 0, @member json.uncommit_count studentwork_count homework, 0, @member
json.all_count studentwork_count homework, 2, @member
end end
if homework.homework_type == "practice" if homework.homework_type == "practice"

Loading…
Cancel
Save