|
|
|
@ -429,11 +429,9 @@ module ExercisesHelper
|
|
|
|
|
answer_status = 1
|
|
|
|
|
end
|
|
|
|
|
ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id)
|
|
|
|
|
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
|
|
|
|
|
logger.info("############_________exercise_cha.challenge&.path___________###############{exercise_cha.challenge&.path}")
|
|
|
|
|
code = nil
|
|
|
|
|
if exercise_cha.challenge&.path.present?
|
|
|
|
|
cha_path = challenge_path(exercise_cha.challenge&.path)
|
|
|
|
|
logger.info("############_________cha_path___________###############{cha_path}")
|
|
|
|
|
|
|
|
|
|
game_challenge = game.game_codes.search_challenge_path(cha_path)&.first
|
|
|
|
|
if game_challenge.present?
|
|
|
|
|
game_code = game_challenge
|
|
|
|
@ -441,6 +439,9 @@ module ExercisesHelper
|
|
|
|
|
else
|
|
|
|
|
code = git_fle_content(game.myshixun.repo_path,cha_path)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
|
|
|
|
|
### Todo 实训题的_shixun_details里的代码是不是直接从这里取出就可以了?涉及到code的多个版本库的修改
|
|
|
|
|
sx_option = {
|
|
|
|
|
:exercise_question_id => q.id,
|
|
|
|
|
:exercise_shixun_challenge_id => exercise_cha.id,
|
|
|
|
@ -451,7 +452,7 @@ module ExercisesHelper
|
|
|
|
|
}
|
|
|
|
|
ExerciseShixunAnswer.create(sx_option)
|
|
|
|
|
else
|
|
|
|
|
ex_shixun_answer_content.first.update_column('score',exercise_cha_score)
|
|
|
|
|
ex_shixun_answer_content.first.update_attributes(score:exercise_cha_score.round(1),answer_text:code)
|
|
|
|
|
end
|
|
|
|
|
score5 += exercise_cha_score
|
|
|
|
|
else
|
|
|
|
@ -641,7 +642,7 @@ module ExercisesHelper
|
|
|
|
|
end
|
|
|
|
|
if student_status == 2 #当前为老师,或为学生且已提交
|
|
|
|
|
user_score_pre = exercise_answers.score_reviewed
|
|
|
|
|
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : nil
|
|
|
|
|
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if user_score.present? && (user_score > q.question_score)
|
|
|
|
|