Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm
commit
6de2883fbd
@ -0,0 +1,18 @@
|
||||
json.question do
|
||||
json.id question.id
|
||||
json.question_number question.question_number
|
||||
json.question_title question.question_title
|
||||
json.question_type question.question_type
|
||||
json.is_necessary question.is_necessary
|
||||
if question.question_type == 2
|
||||
json.max_choices question.max_choices
|
||||
json.min_choices question.min_choices
|
||||
end
|
||||
json.answers do
|
||||
json.array! answers do | a|
|
||||
json.answer_id a.id
|
||||
json.answer_position a.choice_position
|
||||
json.answer_text a.choice_text.nil? ? "other_choices" : a.choice_text ##
|
||||
end
|
||||
end
|
||||
end
|
@ -1,16 +1,36 @@
|
||||
json.exercise do
|
||||
json.extract! @bank, :id, :name, :description, :is_public
|
||||
end
|
||||
if @bank.container_type == "Exercise"
|
||||
json.exercise do
|
||||
json.extract! @bank, :id, :name, :description, :is_public
|
||||
end
|
||||
|
||||
json.partial! "exercises/exercise_scores"
|
||||
|
||||
json.exercise_questions do
|
||||
json.array! @exercise_questions do |q|
|
||||
json.partial! "exercise_bank_questions/exercise_bank_questions",
|
||||
question: q,
|
||||
choices:q.exercise_bank_choices,
|
||||
shixun_challenges: q.exercise_bank_shixun_challenges,
|
||||
ques_position:nil,
|
||||
edit_type:nil
|
||||
end
|
||||
end
|
||||
|
||||
json.partial! "exercises/exercise_scores"
|
||||
else
|
||||
json.poll do
|
||||
json.extract! @bank, :id, :name, :description, :is_public
|
||||
end
|
||||
|
||||
json.question_types do
|
||||
json.q_counts @poll_questions_count
|
||||
json.q_singles @poll_question_singles
|
||||
json.q_doubles @poll_question_doubles
|
||||
json.q_mains @poll_question_mains
|
||||
end
|
||||
|
||||
json.exercise_questions do
|
||||
json.array! @exercise_questions do |q|
|
||||
json.partial! "exercise_bank_questions/exercise_bank_questions",
|
||||
question: q,
|
||||
choices:q.exercise_bank_choices,
|
||||
shixun_challenges: q.exercise_bank_shixun_challenges,
|
||||
ques_position:nil,
|
||||
edit_type:nil
|
||||
json.questions do
|
||||
json.array! @exercise_questions do | question|
|
||||
json.partial! "exercise_banks/poll_questions", question: question, answers: question.exercise_bank_choices
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue