用户试卷自动提交的测试

competitions
SylorHuang 5 years ago
parent 3ceba29352
commit e1bea29dcb

@ -1102,10 +1102,10 @@ class ExercisesController < ApplicationController
ActiveRecord::Base.transaction do
begin
can_commit_exercise = false
Rails.logger.info("######____________params[:commit_method]_________################{params[:commit_method]}")
if (@user_course_identity > Course::ASSISTANT_PROFESSOR) && params[:commit_method].present? #为学生时
if @user_course_identity > Course::ASSISTANT_PROFESSOR #为学生时
if params[:commit_method].to_i == 2 #自动提交时
user_left_time = get_exercise_left_time(@exercise,current_user)
Rails.logger.info("######__________auto_commit_user_left_time_________################{user_left_time}")
if user_left_time.to_i <= 0
can_commit_exercise = true
end
@ -1130,10 +1130,10 @@ class ExercisesController < ApplicationController
CommitExercsieNotifyJobJob.perform_later(@exercise.id, current_user.id)
normal_status(0,"试卷提交成功!")
else
normal_status(-1,"提交失败,请重试!")
normal_status(-1,"提交失败,未到截止时间!")
end
else
normal_status(-1,"提交失败,请重试!")
normal_status(-1,"提交失败,当前用户不为课堂学生!")
end
rescue Exception => e
uid_logger_error(e.message)

Loading…
Cancel
Save