|
|
|
@ -201,16 +201,16 @@ class ExercisesController < ApplicationController
|
|
|
|
|
def common_header
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
begin
|
|
|
|
|
@user_left_time = nil
|
|
|
|
|
if @user_course_identity > Course::ASSISTANT_PROFESSOR
|
|
|
|
|
@is_teacher_or = 0
|
|
|
|
|
@user_exercise_answer = @exercise.check_user_answer_status(current_user)
|
|
|
|
|
@user_commit_counts = 0
|
|
|
|
|
get_exercise_left_time(@exercise,current_user)
|
|
|
|
|
@user_left_time = get_exercise_left_time(@exercise,current_user)
|
|
|
|
|
else
|
|
|
|
|
@is_teacher_or = 1
|
|
|
|
|
@user_exercise_answer = 3 #教师页面
|
|
|
|
|
@user_commit_counts = @exercise.exercise_users.where(commit_status:1).count #已提交的用户数
|
|
|
|
|
@user_left_time = nil
|
|
|
|
|
end
|
|
|
|
|
@ex_status = @exercise.get_exercise_status(current_user.id)
|
|
|
|
|
|
|
|
|
@ -1022,8 +1022,6 @@ class ExercisesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
get_exercise_left_time(@exercise,@exercise_user_current)
|
|
|
|
|
|
|
|
|
|
# ex_time = @exercise.time
|
|
|
|
|
# if ex_time > 0
|
|
|
|
|
# time_mill = ex_time * 60 #转为秒
|
|
|
|
@ -1038,10 +1036,12 @@ class ExercisesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
@t_user_exercise_status = @exercise.get_exercise_status(current_user.id)
|
|
|
|
|
|
|
|
|
|
@user_left_time = nil
|
|
|
|
|
if @user_course_identity < Course::STUDENT || (@t_user_exercise_status == 3) ||
|
|
|
|
|
(@exercise_user_current.present? && @exercise_user_current.commit_status == 1)
|
|
|
|
|
@user_exercise_status = 1 #当前用户为老师/试卷已截止/试卷已提交不可编辑
|
|
|
|
|
else
|
|
|
|
|
@user_left_time = get_exercise_left_time(@exercise,current_user)
|
|
|
|
|
@user_exercise_status = 0 #可编辑
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|