|
|
@ -340,12 +340,10 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
@exercise_question.question_score = question_score
|
|
|
|
@exercise_question.question_score = question_score
|
|
|
|
@exercise_question.shixun_name = shixun_name
|
|
|
|
@exercise_question.shixun_name = shixun_name
|
|
|
|
@exercise_question.save!
|
|
|
|
@exercise_question.save!
|
|
|
|
# elsif @exercise_question.question_type == Exercise::PROGRAM
|
|
|
|
elsif @exercise_question.question_type == Exercise::PROGRAM
|
|
|
|
# question_score = 0
|
|
|
|
if @exercise_question.hack.present?
|
|
|
|
# shixun_name = params[:shixun_name] || @exercise_question.shixun_name
|
|
|
|
@exercise_question.hack.update!(name: params[:question_title], description: params[:description])
|
|
|
|
# @exercise_question.question_score = question_score
|
|
|
|
end
|
|
|
|
# @exercise_question.shixun_name = shixun_name
|
|
|
|
|
|
|
|
# @exercise_question.save!
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.
|
|
|
|
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.
|
|
|
@ -753,6 +751,8 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
elsif params[:shixun_name].blank?
|
|
|
|
elsif params[:shixun_name].blank?
|
|
|
|
normal_status(-1, "实训题名称不能为空!")
|
|
|
|
normal_status(-1, "实训题名称不能为空!")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
elsif params[:question_type].to_i == 6
|
|
|
|
|
|
|
|
normal_status(-1, "编程题描述不能为空!") if params[:description].blank?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|