|
|
|
@ -1342,6 +1342,7 @@ class ExerciseController < ApplicationController
|
|
|
|
|
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.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
|
|
|
|
|
end
|
|
|
|
|
redirect_to student_exercise_list_exercise_path(@exercise)
|
|
|
|
@ -1376,6 +1377,8 @@ class ExerciseController < ApplicationController
|
|
|
|
|
@exercise.exercise_users.where(:user_id => params[:user_id]).update_all(:score => nil, :start_at => nil, :end_at => nil, :status => nil, :commit_status => 0, :objective_score => -1, :subjective_score => -1)
|
|
|
|
|
ExerciseAnswer.where(:user_id => params[:user_id], :exercise_question_id => @exercise.exercise_questions.pluck(:id)).destroy_all
|
|
|
|
|
ExerciseShixunAnswer.where(:user_id => params[:user_id], :exercise_question_id => @exercise.exercise_questions.pluck(:id)).destroy_all
|
|
|
|
|
ExerciseUserQuestion.where(:exercise_id => @exercise.id, :exercise_user_id =>
|
|
|
|
|
@exercise.exercise_users.where(:user_id => params[:user_id]).pluck(:id)).destroy_all
|
|
|
|
|
end
|
|
|
|
|
redirect_to student_exercise_list_exercise_path(@exercise)
|
|
|
|
|
end
|
|
|
|
|