|
|
|
@ -46,7 +46,7 @@ module ExercisesHelper
|
|
|
|
|
sub_answer_score = sub_answer.first.score
|
|
|
|
|
else
|
|
|
|
|
stand_status = 0
|
|
|
|
|
sub_answer_score = 0.0
|
|
|
|
|
sub_answer_score = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
sub_score = {
|
|
|
|
@ -54,7 +54,7 @@ module ExercisesHelper
|
|
|
|
|
"q_type":s.question_type,
|
|
|
|
|
"q_position":s.question_number,
|
|
|
|
|
"stand_status":stand_status,
|
|
|
|
|
"user_score":sub_answer_score.round(1).to_s
|
|
|
|
|
"user_score":sub_answer_score.present? ? sub_answer_score.round(1).to_s : nil
|
|
|
|
|
}
|
|
|
|
|
@ex_sub_array.push(sub_score)
|
|
|
|
|
end
|
|
|
|
@ -627,7 +627,7 @@ module ExercisesHelper
|
|
|
|
|
#学生的分数状态及回答的内容
|
|
|
|
|
def user_question_answers(q,ex_answerer_id,student_status,is_teacher_or,ex_status,ques_type,ex_type)
|
|
|
|
|
answered_content = []
|
|
|
|
|
user_score = 0.0
|
|
|
|
|
user_score = nil
|
|
|
|
|
shixun_type = 0
|
|
|
|
|
question_comment = []
|
|
|
|
|
if q.question_type == 5
|
|
|
|
@ -638,7 +638,7 @@ module ExercisesHelper
|
|
|
|
|
if student_status == 2 #当前为老师,或为学生且已提交
|
|
|
|
|
user_score = exercise_answers.score_reviewed.pluck(:score).sum
|
|
|
|
|
end
|
|
|
|
|
if user_score > q.question_score
|
|
|
|
|
if user_score.present? && (user_score > q.question_score)
|
|
|
|
|
user_score = q.question_score
|
|
|
|
|
end
|
|
|
|
|
if ques_type <= 2
|
|
|
|
@ -667,7 +667,7 @@ module ExercisesHelper
|
|
|
|
|
question_comment = q.exercise_answer_comments.search_answer_comments("exercise_answer_id",q_answer_id)
|
|
|
|
|
end
|
|
|
|
|
{
|
|
|
|
|
"user_score": user_score.round(1),
|
|
|
|
|
"user_score": user_score.present? ? user_score.round(1) : nil,
|
|
|
|
|
"answered_content":answered_content,
|
|
|
|
|
"shixun_type":shixun_type,
|
|
|
|
|
"question_comment":question_comment
|
|
|
|
|