|
|
|
@ -1084,14 +1084,23 @@ class ExercisesController < ApplicationController
|
|
|
|
|
@shixun_undo = 0
|
|
|
|
|
@ques_undo = 0
|
|
|
|
|
ex_answer_time = @exercise.time.to_i
|
|
|
|
|
if ex_answer_time > 0 #有剩余时间的时候
|
|
|
|
|
user_left_time = get_exercise_left_time(@exercise,current_user)
|
|
|
|
|
@ex_end_time = Time.now + user_left_time.to_i.seconds
|
|
|
|
|
else
|
|
|
|
|
@ex_end_time = @exercise.get_exercise_end_time(current_user.id)
|
|
|
|
|
if ex_answer_time > 0
|
|
|
|
|
exercise_end_time = @exercise.exercise_users.exercise_commit_users(current_user.id)
|
|
|
|
|
if exercise_end_time.present?
|
|
|
|
|
ex_end_times = exercise_end_time.first.start_at.nil? ? Time.now : exercise_end_time.first.start_at
|
|
|
|
|
@ex_end_time = ex_end_times + ex_answer_time.minutes
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# @ex_end_time = @exercise.get_exercise_end_time(current_user.id)
|
|
|
|
|
# if ex_answer_time > 0
|
|
|
|
|
# left_answer_time = Time.now + ex_answer_time.minutes #判断试卷的倒计时和截止时间哪个先到
|
|
|
|
|
# if left_answer_time < @ex_end_time
|
|
|
|
|
# exercise_end_time = @exercise.exercise_users.exercise_commit_users(current_user.id)
|
|
|
|
|
# if exercise_end_time.present?
|
|
|
|
|
# ex_end_times = exercise_end_time.first.start_at.nil? ? Time.now : exercise_end_time.first.start_at
|
|
|
|
|
# @ex_end_time = ex_end_times + ex_answer_time.minutes
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
@exercise_questions.each do |q|
|
|
|
|
|
if q.question_type == Exercise::PRACTICAL #当为实训题时
|
|
|
|
|
user_myshixun = q.shixun.myshixuns.search_myshixun_user(current_user.id)
|
|
|
|
|