You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#coding=utf-8
|
|
|
|
# 执行示例 bundle exec rake excellent_course_exercise:student_answer args=149,2903
|
|
|
|
desc "同步精品课的学生试卷数据"
|
|
|
|
namespace :excellent_course_exercise do
|
|
|
|
task :student_answer => :environment do
|
|
|
|
|
|
|
|
course = Course.find_by(id: 2933)
|
|
|
|
|
|
|
|
participant_count = 1042
|
|
|
|
pass_count = 823
|
|
|
|
|
|
|
|
members_1 = course.students.order("id asc").limit(987)
|
|
|
|
members_2 = course.students.order("id asc").limit(1042)
|
|
|
|
members_1 = course.students.order("id asc").limit(322)
|
|
|
|
|
|
|
|
exercise_1884 = course.exercises.find_by(id: 1884)
|
|
|
|
members_1.each_with_index do |member, index|
|
|
|
|
if index < 821
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|