试卷的锁标志的修改

dev_course
SylorHuang 5 years ago
parent 80a4cc48bb
commit 0a7715cbc5

@ -260,6 +260,7 @@ module ExercisesHelper
def exercise_index_show(exercise,course,is_teacher_or,user) def exercise_index_show(exercise,course,is_teacher_or,user)
# exercise_all_users = exercise.exercise_users # exercise_all_users = exercise.exercise_users
# lock_icon 0不出现锁1和2均出现锁。但是1仅表示私有可点击2表示私有且不点击
ex_show_text = [] ex_show_text = []
if course.is_end #课堂停止后,试卷显示为已结束 if course.is_end #课堂停止后,试卷显示为已结束
@ -280,6 +281,7 @@ module ExercisesHelper
else else
ex_show_text ex_show_text
end end
if is_teacher_or == 1 if is_teacher_or == 1
exercise_users_list = exercise.all_exercise_users(user.id) #当前老师所在班级的全部学生 exercise_users_list = exercise.all_exercise_users(user.id) #当前老师所在班级的全部学生
unreview_count = exercise_users_list.exercise_unreview.size unreview_count = exercise_users_list.exercise_unreview.size
@ -288,7 +290,7 @@ module ExercisesHelper
exercise_publish_time = ex_pb_time[:publish_time] exercise_publish_time = ex_pb_time[:publish_time]
exercise_end_time = ex_pb_time[:end_time] exercise_end_time = ex_pb_time[:end_time]
current_status = 3 current_status = 3
lock_icon = 1 #不显示锁图标 lock_icon = 1
if exercise_status == 1 if exercise_status == 1
ex_show_text.push("未发布") ex_show_text.push("未发布")
elsif exercise_status == 3 elsif exercise_status == 3
@ -302,7 +304,7 @@ module ExercisesHelper
exercise_publish_time = ex_pb_time[:publish_time] exercise_publish_time = ex_pb_time[:publish_time]
exercise_end_time = ex_pb_time[:end_time] exercise_end_time = ex_pb_time[:end_time]
current_status = exercise.check_user_answer_status(user) current_status = exercise.check_user_answer_status(user)
lock_icon = 1 #不显示锁图标 lock_icon = 1
if current_status == 4 if current_status == 4
ex_show_text.push("未提交") ex_show_text.push("未提交")
end end
@ -314,14 +316,18 @@ module ExercisesHelper
unreview_count = nil unreview_count = nil
if exercise.is_public if exercise.is_public
current_status = exercise.check_user_answer_status(user) current_status = exercise.check_user_answer_status(user)
lock_icon = 1 #非课堂成员,但是试卷为公开的,不加 lock_icon = 0 #不出现
if current_status == 4 if current_status == 4
ex_show_text.push("未提交") ex_show_text.push("未提交")
end end
else else
current_status = 4 current_status = 4
lock_icon = 0 #显示锁图标 lock_icon = 2
end
end end
if (course.is_public == 1) && exercise.is_public
lock_icon = 0
end end
if exercise_status > 1 if exercise_status > 1
@ -332,8 +338,6 @@ module ExercisesHelper
if exercise_status == 2 && exercise_end_time.present? if exercise_status == 2 && exercise_end_time.present?
ex_left_time = how_much_time(exercise_end_time) ex_left_time = how_much_time(exercise_end_time)
# elsif exercise_status == 3 && course.end_date.present?
# ex_left_time = how_much_time(course.end_date.to_time)
else #已截止后不显示时间 else #已截止后不显示时间
ex_left_time = nil ex_left_time = nil
end end

Loading…
Cancel
Save