parent
7985bd3896
commit
2f67425e2a
@ -0,0 +1,16 @@
|
||||
class ChangeExercise1930Position < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
|
||||
#正式版的1930试卷的位置出现问题
|
||||
#
|
||||
ex = Exercise.find_by(id:1930)
|
||||
ex.exercise_questions.each_with_index do |q,index|
|
||||
q.update_attributes(question_number:index+1)
|
||||
end
|
||||
|
||||
ex_q_bank = ex.exercise_bank.exercise_bank_questions
|
||||
ex_q_bank.each_with_index do |q,index|
|
||||
q.update_attributes(question_number:index+1)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue