|  |  | @ -25,83 +25,118 @@ namespace :exercise_publish do | 
			
		
	
		
		
			
				
					
					|  |  |  |     end |  |  |  |     end | 
			
		
	
		
		
			
				
					
					|  |  |  |   end |  |  |  |   end | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   # def calculate_student_score(exercise, user) |  |  |  |   #计算试卷的总分和试卷的答题状态 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score = 0 |  |  |  |   # def calculate_student_score(exercise,user) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score1 = 0 |  |  |  |   #   score1 = 0.0 #选择题/判断题 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score2 = 0 |  |  |  |   #   score2 = 0.0 #填空题 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score3 = 0 |  |  |  |   #   score5 = 0.0  #实训题 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score4 = 0 |  |  |  |   #   ques_stand = []  #问题是否正确 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   exercise_qustions = exercise.exercise_questions |  |  |  |   #   exercise_questions = exercise.exercise_questions | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   exercise_qustions.each do |question| |  |  |  |   #   exercise_questions.each do |q| | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #     if question.question_type != 5 |  |  |  |   #     if q.question_type != 5 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #       answer = question.exercise_answers.where("#{ExerciseAnswer.table_name}.user_id = #{user.id}") |  |  |  |   #       answers_content = q.exercise_answers.search_answer_users("user_id",user.id)  #学生的答案 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #       if question.question_type == 3 |  |  |  |   #     else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         standard_answer =[] |  |  |  |   #       answers_content = q.exercise_shixun_answers.search_shixun_answers("user_id",user.id)  #学生的答案 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         question.exercise_standard_answers.each do |answer| |  |  |  |   #     end | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #           standard_answer << answer.answer_text.strip.downcase |  |  |  |   #     if q.question_type <= 2  #为选择题或判断题时 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         end |  |  |  |   #       answer_choice_array = [] | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       answers_content.each do |a| | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         answer_choice_array.push(a.exercise_choice.choice_position)  #学生答案的位置 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       user_answer_content = answer_choice_array.sort | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort  #该问题的标准答案,可能有多个 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       if user_answer_content == standard_answer  #答案一致,多选或单选才给分,答案不对不给分 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         if standard_answer.count > 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #           multi_each_score = (q.question_score / standard_answer.count)   #当多选答案正确时,每个answer的分数均摊。 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #           multi_each_score = 0.0 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         answers_content.update_all(:score => multi_each_score) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         score1 = score1 + q.question_score | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     elsif q.question_type == 3   #填空题 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       null_standard_answer = q.exercise_standard_answers | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       standard_answer_array = null_standard_answer.select(:exercise_choice_id,:answer_text) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       standard_answer_ids = standard_answer_array.pluck(:exercise_choice_id).reject(&:blank?).uniq   #标准答案的exercise_choice_id数组 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       standard_answer_count = standard_answer_ids.count | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       if standard_answer_count > 0  #存在标准答案时才有分数 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         each_standard_score = (q.question_score.to_f / standard_answer_count).round(1) #每一空的得分 | 
			
		
	
		
		
			
				
					
					|  |  |  |   #       else |  |  |  |   #       else | 
			
		
	
		
		
			
				
					
					|  |  |  |   #         standard_answer = question.exercise_standard_answers.first |  |  |  |   #         each_standard_score = 0.0 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #       end |  |  |  |   #       end | 
			
		
	
		
		
			
				
					
					|  |  |  |   # |  |  |  |   #       if q.is_ordered | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #       unless answer.empty? |  |  |  |   #         answers_content.each do |u| | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         # 问答题有多个答案 |  |  |  |   #           i_standard_answer = standard_answer_array.where(exercise_choice_id:u.exercise_choice_id).pluck(:answer_text).reject(&:blank?).map!(&:downcase)   #该选项的全部标准答案 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         if question.question_type == 3 && !standard_answer.empty? |  |  |  |   #           if i_standard_answer.include?(u.answer_text.downcase)  #该空的标准答案包含用户的答案才有分数 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #           if standard_answer.include?(answer.first.answer_text.strip.downcase) |  |  |  |   #             u.update_attribute("score",each_standard_score) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #             score1 = score1+ question.question_score unless question.question_score.nil? |  |  |  |   #             score2 = score2 + each_standard_score | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #           end |  |  |  |   #           end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #         elsif question.question_type == 1 && !standard_answer.nil? |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #             score2 = score2 + question.question_score unless question.question_score.nil? |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #         end |  |  |  |   #         end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #         elsif question.question_type == 2 && !standard_answer.nil? |  |  |  |   #       else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #           arr = get_mulscore(question, user) |  |  |  |   #         st_answer_text = standard_answer_array.pluck(:answer_text).reject(&:blank?).map!(&:downcase) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #           if arr.to_i == standard_answer.exercise_choice_id |  |  |  |   #         answers_content.each do |u| | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #             score3 = score3 + question.question_score unless question.question_score.nil? |  |  |  |   #           u_answer_text = u.answer_text.downcase | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #           if st_answer_text.include?(u_answer_text)   #只要标准答案包含用户的答案,就有分数。同时,下一次循环时,就会删除该标准答案。防止用户的相同答案获分 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             u.update_attribute("score",each_standard_score) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             score2 = score2 + each_standard_score | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             st_answer_text.delete(u_answer_text) | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           end |  |  |  |   #           end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #         end |  |  |  |   #         end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #       end |  |  |  |   #       end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #     else |  |  |  |   #     elsif q.question_type == 5   #实训题时,主观题这里不评分 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #       question.exercise_shixun_challenges.each do |exercise_cha| |  |  |  |   #       q.exercise_shixun_challenges.each do |exercise_cha| | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #         game = Game.where(:user_id => user.id, :challenge_id => exercise_cha.challenge_id).first |  |  |  |   #         game = Game.user_games(user.id,exercise_cha.challenge_id).first  #当前用户的关卡 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #         if game.present? |  |  |  |   #         if game.present? | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           exercise_cha_score = 0 |  |  |  |   #           exercise_cha_score = 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           answer_status = 0 |  |  |  |   #           answer_status = 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           cha_path = exercise_cha.challenge.path.present? ? exercise_cha.challenge.path.split(";") : [] |  |  |  |   #           cha_path = challenge_path exercise_cha.challenge.path | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #           challeng_path = cha_path.reject(&:blank?)[0].try(:strip) |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #           if game.status == 2 && game.final_score >= 0 |  |  |  |   #           if game.status == 2 && game.final_score >= 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |   #             exercise_cha_score = exercise_cha.question_score |  |  |  |   #             exercise_cha_score = game.real_score exercise_cha.question_score #每一关卡的得分 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #             answer_status = 1 |  |  |  |   #             answer_status = 1 | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           end |  |  |  |   #           end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           if exercise_cha.exercise_shixun_answers.where(:user_id => user.id).empty? |  |  |  |   #           if exercise_cha.exercise_shixun_answers.search_shixun_answers("user_id",user.id).blank?  #把关卡的答案存入试卷的实训里 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #             if GameCode.where(:game_id => game.try(:id), :path => challeng_path).first.present? |  |  |  |   #             game_challenge = game.game_codes.search_challenge_path(cha_path).first | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #               game_code = GameCode.where(:game_id => game.try(:id), :path => challeng_path).first |  |  |  |   #             if game_challenge.present? | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #               game_code = game_challenge | 
			
		
	
		
		
			
				
					
					|  |  |  |   #               code = game_code.try(:new_code) |  |  |  |   #               code = game_code.try(:new_code) | 
			
		
	
		
		
			
				
					
					|  |  |  |   #             else |  |  |  |   #             else | 
			
		
	
		
		
			
				
					
					|  |  |  |   #               begin |  |  |  |   #               code = git_fle_content(exercise_cha.shixun.repo_path,cha_path) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #                 g = Gitlab.client |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 Rails.logger.info "commit_exercise_path---- #{challeng_path}" |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 if game.present? |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                   code = g.files(game.myshixun.gpid, challeng_path, "master").try(:content) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 else |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                   code = g.files(question.shixun.gpid, challeng_path, "master").try(:content) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 end |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 code = tran_base64_decode64(code) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #               rescue Exception => e |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 @error_messages = e.message |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #                 Rails.logger.info "commit_exercise---- #{@error_messages}" |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   #               end |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #             end |  |  |  |   #             end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #             ExerciseShixunAnswer.create(:exercise_question_id => question.id, :exercise_shixun_challenge_id => exercise_cha.id, :user_id => user.id, |  |  |  |   #             sx_option = { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #                                         :score => exercise_cha_score, :answer_text => code, :status => answer_status) |  |  |  |   #                 :exercise_question_id => q.id, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   # |  |  |  |   #                 :exercise_shixun_challenge_id => exercise_cha.id, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #                 :user_id => user.id, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #                 :score => exercise_cha_score, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #                 :answer_text => code, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #                 :status => answer_status | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             ex_shixun_answer = ExerciseShixunAnswer.new(sx_option) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #             ex_shixun_answer.save! | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           end |  |  |  |   #           end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #           score4 += exercise_cha_score |  |  |  |   #           score5 += exercise_cha_score | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   #         end |  |  |  |   #         end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #       end |  |  |  |   #       end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #     end |  |  |  |   #     end | 
			
		
	
		
		
			
				
					
					|  |  |  |   #   end |  |  |  |   #     user_scores = answers_content.score_reviewed.pluck(:score).sum | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   #   score = score1 + score2 + score3 + score4 |  |  |  |   #     if user_scores > 0 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       stand_answer = 1 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       stand_answer = 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     ques_option = { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         "q_id":q.id,   #该问题的id | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         "q_type":q.question_type, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         "q_position":q.question_number, #该问题的位置 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         "stand_status":stand_answer,  #该问题是否正确,1为正确,0为错误 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #         "user_score":user_scores  #每个问题的总得分 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #     ques_stand.push(ques_option) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #   end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #   total_score = score1 + score2 + score5 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #   { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       "total_score":total_score, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #       "stand_status":ques_stand | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   #   } | 
			
		
	
		
		
			
				
					
					|  |  |  |   # end |  |  |  |   # end | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   task :publish => :environment do |  |  |  |   task :publish => :environment do | 
			
		
	
	
		
		
			
				
					|  |  | @ -169,6 +204,9 @@ namespace :exercise_publish do | 
			
		
	
		
		
			
				
					
					|  |  |  |   end |  |  |  |   end | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   task :end => :environment do |  |  |  |   task :end => :environment do | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     # include ExercisesHelper | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     # include ApplicationController | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now) |  |  |  |     exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now) | 
			
		
	
		
		
			
				
					
					|  |  |  |     exercises.each do |exercise| |  |  |  |     exercises.each do |exercise| | 
			
		
	
		
		
			
				
					
					|  |  |  |       course = exercise.course |  |  |  |       course = exercise.course | 
			
		
	
	
		
		
			
				
					|  |  | @ -180,7 +218,7 @@ namespace :exercise_publish do | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           s_score = calculate_student_score(exercise, exercise_user.user)[:total_score] |  |  |  |           s_score = calculate_student_score(exercise, exercise_user.user)[:total_score] | 
			
		
	
		
		
			
				
					
					|  |  |  |           exercise_user.update_attributes(:objective_score => s_score, :score => (s_score + (exercise_user.subjective_score && exercise_user.subjective_score > 0 ? exercise_user.subjective_score : 0))) |  |  |  |           exercise_user.update_attributes(:objective_score => s_score, :score => (s_score + (exercise_user.subjective_score && exercise_user.subjective_score > 0 ? exercise_user.subjective_score : 0))) | 
			
		
	
		
		
			
				
					
					|  |  |  |           if exercise_user.user.exercise_answer.where(:exercise_question_id => exercise.exercise_questions.where(:question_type => 4).map(&:id)).empty? |  |  |  |           if exercise_user.user.exercise_answers.where(:exercise_question_id => exercise.exercise_questions.where(:question_type => 4).map(&:id)).empty? | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             exercise_user.update_attributes(:subjective_score => 0) |  |  |  |             exercise_user.update_attributes(:subjective_score => 0) | 
			
		
	
		
		
			
				
					
					|  |  |  |           end |  |  |  |           end | 
			
		
	
		
		
			
				
					
					|  |  |  |         end |  |  |  |         end | 
			
		
	
	
		
		
			
				
					|  |  | @ -201,11 +239,12 @@ namespace :exercise_publish do | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           s_score = calculate_student_score(exercise, exercise_user.user)[:total_score] |  |  |  |           s_score = calculate_student_score(exercise, exercise_user.user)[:total_score] | 
			
		
	
		
		
			
				
					
					|  |  |  |           exercise_user.update_attributes(:objective_score => s_score, :score => (s_score + (exercise_user.subjective_score && exercise_user.subjective_score > 0 ? exercise_user.subjective_score : 0))) |  |  |  |           exercise_user.update_attributes(:objective_score => s_score, :score => (s_score + (exercise_user.subjective_score && exercise_user.subjective_score > 0 ? exercise_user.subjective_score : 0))) | 
			
		
	
		
		
			
				
					
					|  |  |  |           if exercise_user.user.exercise_answer.where(:exercise_question_id => exercise.exercise_questions.where(:question_type => 4).map(&:id)).empty? |  |  |  |           if exercise_user.user.exercise_answers.where(:exercise_question_id => exercise.exercise_questions.where(:question_type => 4).map(&:id)).empty? | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             exercise_user.update_attributes(:subjective_score => 0) |  |  |  |             exercise_user.update_attributes(:subjective_score => 0) | 
			
		
	
		
		
			
				
					
					|  |  |  |           end |  |  |  |           end | 
			
		
	
		
		
			
				
					
					|  |  |  |         end |  |  |  |         end | 
			
		
	
		
		
			
				
					
					|  |  |  |       end |  |  |  |       end | 
			
		
	
		
		
			
				
					
					|  |  |  |     end |  |  |  |     end | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     logger.info("") | 
			
		
	
		
		
			
				
					
					|  |  |  |   end |  |  |  |   end | 
			
		
	
		
		
			
				
					
					|  |  |  | end |  |  |  | end | 
			
		
	
	
		
		
			
				
					|  |  | 
 |