Merge branch 'dev_course' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_course

dev_course
cxt 6 years ago
commit 953afbddaf

@ -8,7 +8,7 @@ class ExerciseAnswersController < ApplicationController
q_type = @exercise_question.question_type #试卷的类型
choice_id = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : ""
answer_text = params[:answer_text].present? ? params[:answer_text] : "" #为字符串
if q_type < 4 && choice_id.blank?
if q_type < 4 && (q_type != 1) && choice_id.blank?
normal_status(-1,"请选择序号")
else
ea = @exercise_question.exercise_answers.search_answer_users("user_id",current_user.id) #试卷的当前用户的答案

@ -50,10 +50,10 @@ class GraduationTopic < ApplicationRecord
def student_graduation_topic_status
sgt = self.student_graduation_topics
status =
if sgt.is_accepting.count == 0
2
elsif sgt.is_refused.count == self.student_graduation_topics.size
if sgt.where(status: [0, 1]).count.zero?
0
elsif sgt.is_accepting.count.zero?
2
else
1
end

Loading…
Cancel
Save