From f35f9a8dbe3b6e4999885d3cd1d16ae120a209ee Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 11 Oct 2019 16:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=95=E5=8D=B7=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E7=AB=AF=E6=97=B6=E9=97=B4=E5=92=8C=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index f9d9531f1..ac86467f1 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1103,6 +1103,7 @@ class ExercisesController < ApplicationController ActiveRecord::Base.transaction do begin can_commit_exercise = false + user_left_time = nil if @user_course_identity > Course::ASSISTANT_PROFESSOR #为学生时 if params[:commit_method].to_i == 2 #自动提交时 user_left_time = get_exercise_left_time(@exercise,current_user) @@ -1131,7 +1132,7 @@ class ExercisesController < ApplicationController CommitExercsieNotifyJobJob.perform_later(@exercise.id, current_user.id) normal_status(0,"试卷提交成功!") else - normal_status(-1,"提交失败,未到截止时间!") + normal_status(-2,"#{user_left_time.to_i}") end else normal_status(-1,"提交失败,当前用户不为课堂学生!")