|
|
@ -167,10 +167,13 @@ module ExercisesHelper
|
|
|
|
ex_score = ex&.question_score
|
|
|
|
ex_score = ex&.question_score
|
|
|
|
full_scores = effictive_users.search_exercise_answer("score",ex_score).count #满分人数
|
|
|
|
full_scores = effictive_users.search_exercise_answer("score",ex_score).count #满分人数
|
|
|
|
no_full_scores = effictive_users.exercise_no_full_scores(ex_score).count #部分分数人数
|
|
|
|
no_full_scores = effictive_users.exercise_no_full_scores(ex_score).count #部分分数人数
|
|
|
|
all_zero_scores = effictive_users.search_exercise_answer("score",0.0).count #包含为0分的,及未评阅的
|
|
|
|
zero_scores = effictive_users.search_exercise_answer("score",0.0).count #包含为0分的,及未评阅的
|
|
|
|
review_scores = ex.exercise_answer_comments.count #主观题的评阅数量
|
|
|
|
# review_scores = ex.exercise_answer_comments.count #主观题的评阅数量
|
|
|
|
un_review_scores = effictive_users_count - review_scores #未评阅数
|
|
|
|
un_review_scores = effictive_users_count - full_scores - no_full_scores - zero_scores #未评阅数
|
|
|
|
zero_scores = all_zero_scores - un_review_scores #已评阅,且答案未0分的人数
|
|
|
|
if un_review_scores < 0
|
|
|
|
|
|
|
|
un_review_scores = 0
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
# zero_scores = all_zero_scores - un_review_scores #已评阅,且答案未0分的人数
|
|
|
|
main_scores_array = [full_scores,no_full_scores,zero_scores,un_review_scores]
|
|
|
|
main_scores_array = [full_scores,no_full_scores,zero_scores,un_review_scores]
|
|
|
|
main_scores_array.each_with_index do |s,index|
|
|
|
|
main_scores_array.each_with_index do |s,index|
|
|
|
|
if index == 0
|
|
|
|
if index == 0
|
|
|
@ -642,8 +645,12 @@ module ExercisesHelper
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if student_status == 2 #当前为老师,或为学生且已提交
|
|
|
|
if student_status == 2 #当前为老师,或为学生且已提交
|
|
|
|
user_score_pre = exercise_answers.score_reviewed
|
|
|
|
user_score_pre = exercise_answers.score_reviewed
|
|
|
|
|
|
|
|
if ques_type == 4 && user_score_pre.blank? #主观题时,且没有大于0的分数时,为空
|
|
|
|
|
|
|
|
user_score = nil
|
|
|
|
|
|
|
|
else
|
|
|
|
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
|
|
|
|
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if user_score.present? && (user_score > q.question_score)
|
|
|
|
if user_score.present? && (user_score > q.question_score)
|
|
|
|
user_score = q.question_score
|
|
|
|
user_score = q.question_score
|
|
|
|