dev_course
SylorHuang 6 years ago
parent 4278f728c1
commit 9c1ab34519

@ -107,10 +107,10 @@ class ExerciseAnswersController < ApplicationController
normal_status(-1,"该课堂不存在!")
elsif @exercise_user.blank?
normal_status(-1,"试卷用户不存在!")
elsif @exercise_user_status == 3 || @exercise_user.commit_status == 1
elsif @exercise_user.commit_status == 1
normal_status(-1,"已提交/已结束的试卷不允许修改!")
else
if @exercise.time > 0 && @exercise_user.start_at.present? && ((@exercise_user.start_at + (@exercise.time.to_i + 1).minutes) < Time.now)
if (@exercise_user_status == 3 && @exercise_user.commit_status == 0) || (@exercise.time > 0 && @exercise_user.start_at.present? && ((@exercise_user.start_at + (@exercise.time.to_i + 1).minutes) < Time.now))
objective_score = calculate_student_score(@exercise,current_user)[:total_score]
subjective_score = @exercise_user.subjective_score < 0.0 ? 0.0 : @exercise_user.subjective_score
total_score = objective_score + subjective_score

@ -1632,12 +1632,6 @@ class ExercisesController < ApplicationController
normal_status(404,"答题用户不存在")
elsif @exercise.get_exercise_status(current_user.id) != 2 || @answer_committed_user.commit_status == 1 #
normal_status(-1,"提交错误,试卷已截止/用户已提交!")
# elsif @exercise.time > 0
# user_start_at = @answer_committed_user.start_at
# exercise_time = @exercise.time.to_i
# if (user_start_at + exercise_time.minutes) < Time.now
# normal_status(-1,"限时试卷已结束,已自动提交!")
# end
end
end

Loading…
Cancel
Save