Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
jingquan huang 5 years ago
commit 804e9c87b6

@ -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

@ -40,8 +40,8 @@ json.exercise_questions do
question_info = get_exercise_question_info(question,@exercise,@exercise_user_current,@ex_answerer.id)
# json.q_position q[:ques_number] #问题的序号,当问题为随机时,重新更新后的问题序号
if @t_user_exercise_status == 3
this_answer_status = "0.0"
user_score = "0.0"
this_answer_status = 0
user_score = nil
if all_question_status.size > 0
this_ques_status = all_question_status.detect {|f| f[:q_id] == question.id}
this_answer_status = this_ques_status[:stand_status]

Loading…
Cancel
Save