|
|
|
@ -1023,7 +1023,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
if @t_user_exercise_status == 3
|
|
|
|
|
get_each_student_exercise(@exercise.id,@exercise_questions,@exercise_current_user_id)
|
|
|
|
|
end
|
|
|
|
|
get_user_answer_status(@exercise_questions,@exercise_current_user_id)
|
|
|
|
|
get_user_answer_status(@exercise_questions,@exercise_current_user_id,@exercise,@t_user_exercise_status)
|
|
|
|
|
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
@ -1117,7 +1117,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
@student_status = 0
|
|
|
|
|
else
|
|
|
|
|
@student_status = 1
|
|
|
|
|
get_user_answer_status(@exercise_questions,@exercise_current_user_id)
|
|
|
|
|
get_user_answer_status(@exercise_questions,@exercise_current_user_id,@exercise,get_exercise_status)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -1685,11 +1685,17 @@ class ExercisesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_user_answer_status(exercise_questions,user_id)
|
|
|
|
|
def get_user_answer_status(exercise_questions,user_id,exercise,exercise_user_status)
|
|
|
|
|
@question_status = []
|
|
|
|
|
@exercise_all_questions = []
|
|
|
|
|
ex_question_random = exercise.question_random
|
|
|
|
|
question_answered = 0
|
|
|
|
|
exercise_questions.each_with_index do |q,index|
|
|
|
|
|
if ex_question_random && exercise_user_status != 3
|
|
|
|
|
ques_number = index + 1
|
|
|
|
|
else
|
|
|
|
|
ques_number = q.question_number
|
|
|
|
|
end
|
|
|
|
|
if q.question_type != 5
|
|
|
|
|
ques_vote = q.exercise_answers.search_exercise_answer("user_id",user_id)
|
|
|
|
|
else
|
|
|
|
@ -1725,12 +1731,12 @@ class ExercisesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
question_status = {
|
|
|
|
|
:ques_id => q.id,
|
|
|
|
|
:ques_number => index+1, #仅问题的显示位置变化,但是问题的question_number 不会变化,与之相关的choice/standard_answer/answer不会变化
|
|
|
|
|
:ques_number => ques_number, #仅问题的显示位置变化,但是问题的question_number 不会变化,与之相关的choice/standard_answer/answer不会变化
|
|
|
|
|
:ques_status => ques_status,
|
|
|
|
|
}
|
|
|
|
|
question_options = {
|
|
|
|
|
:question => q,
|
|
|
|
|
:ques_number => index+1,
|
|
|
|
|
:ques_number => ques_number,
|
|
|
|
|
}
|
|
|
|
|
@question_status = @question_status.push(question_status).sort_by {|k| k[:ques_number]}
|
|
|
|
|
@exercise_all_questions = @exercise_all_questions.push(question_options).sort_by {|k| k[:ques_number]}
|
|
|
|
|