diff --git a/app/controllers/users/question_banks_controller.rb b/app/controllers/users/question_banks_controller.rb index 0dc4a3f3f..d0a331291 100644 --- a/app/controllers/users/question_banks_controller.rb +++ b/app/controllers/users/question_banks_controller.rb @@ -36,8 +36,8 @@ class Users::QuestionBanksController < Users::BaseController .group('graduation_tasks.gtask_bank_id').count when 'gtopic' then StudentGraduationTopic.joins(:graduation_topic) - .where(gtopic_banks: { gtopic_bank_id: question_bank_ids }).where('status != 0') - .group('gtopic_banks.gtopic_bank_id').count + .where(graduation_topics: { gtopic_bank_id: question_bank_ids }).where('student_graduation_topics.status = 1') + .group('graduation_topics.gtopic_bank_id').count end end diff --git a/app/views/exercise_questions/_exercise_questions.json.jbuilder b/app/views/exercise_questions/_exercise_questions.json.jbuilder index ca8ea7e6b..bf5e02b3c 100644 --- a/app/views/exercise_questions/_exercise_questions.json.jbuilder +++ b/app/views/exercise_questions/_exercise_questions.json.jbuilder @@ -49,8 +49,11 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选 if question.question_type == 2 #返回答案的文字 standard_text = standard_answers_array.first.to_i == 1 ? "正确" : "错误" else + if question.question_type == 1 && standard_answers_array.size == 1 + standard_answers_array = standard_answers_array.first.to_s.split("") + end array_text_answer = [] - standard_answers_array.each{|a| array_text_answer.push((a+64).chr)} + standard_answers_array.each{|a| array_text_answer.push((a.to_i+64).chr)} standard_text = array_text_answer.join("") end json.standard_answer_show standard_text