From 1e8f496718954b856002670b3ad55f2b9cbc7770 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 14 Jul 2016 10:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=20=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=9C=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/controllers/student_work_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a9d84c2d9..479aec3ce 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -968,7 +968,7 @@ class CoursesController < ApplicationController @homework = HomeworkCommon.find params[:homework] #order("#{@order} #{@b_sort}" - @student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc"),@name + @student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc").has_committed,@name @works_hash = {} diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index bc1b97a2f..45b54cf0a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -271,7 +271,7 @@ class StudentWorkController < ApplicationController all_studentwork = find_all_student_work_by_homeid() - @work_count = all_studentwork.count + @work_count = all_studentwork.has_committed.count end #代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言 @@ -282,7 +282,7 @@ class StudentWorkController < ApplicationController @homework = HomeworkCommon.find params[:homework] - all_studentwork = find_all_student_work_by_homeid() + all_studentwork = find_all_student_work_by_homeid().has_committed if all_studentwork == nil resultObj[:status] = -2