修改下试卷1936的迁移文件

dev_hs
SylorHuang 5 years ago
parent 45985cbd0e
commit 5ab3cd6bc4

@ -3,7 +3,7 @@ class ChangeExericse1936Scores < ActiveRecord::Migration[5.2]
#1936的试卷成绩有问题。 #1936的试卷成绩有问题。
# #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts
ex_special = Exercise.find_by_id(1936) ex_special = Exercise.find_by_id(1936)
ex_special_users = ex_special.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",Time.now - 2.months) ex_special_users = ex_special&.exercise_users&.exercise_user_committed&.where("end_at is not null and end_at > ?",Time.now - 2.months)
if ex_special.present? && ex_special_users.exists? if ex_special.present? && ex_special_users.exists?
ex_special_users.each do |ex_user| ex_special_users.each do |ex_user|
calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score] calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score]

Loading…
Cancel
Save