dev_local
cxt 6 years ago
parent 0468c13017
commit 6d851f80d2

@ -1342,6 +1342,7 @@ class ExerciseController < ApplicationController
if exercise_user if exercise_user
exercise_user.update_attributes(:score => nil, :start_at => nil, :end_at => nil, :status => nil, :commit_status => 0, :objective_score => -1, :subjective_score => -1) exercise_user.update_attributes(:score => nil, :start_at => nil, :end_at => nil, :status => nil, :commit_status => 0, :objective_score => -1, :subjective_score => -1)
exercise_user.user.exercise_answer.where(:exercise_question_id => @exercise.exercise_questions.map(&:id)).destroy_all exercise_user.user.exercise_answer.where(:exercise_question_id => @exercise.exercise_questions.map(&:id)).destroy_all
exercise_user.exercise_user_questions.destroy_all
exercise_user.user.exercise_shixun_answers.where(:exercise_question_id => @exercise.exercise_questions.map(&:id)).destroy_all exercise_user.user.exercise_shixun_answers.where(:exercise_question_id => @exercise.exercise_questions.map(&:id)).destroy_all
end end
redirect_to student_exercise_list_exercise_path(@exercise) redirect_to student_exercise_list_exercise_path(@exercise)

Loading…
Cancel
Save