Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder
commit
8a416ee644
@ -1,2 +1,14 @@
|
||||
module MyshixunsHelper
|
||||
|
||||
# 获取tpi的identifier,
|
||||
# identity表示用户关卡的身份
|
||||
# task_pass: 实训是否允许跳关
|
||||
def get_game_identifier task_pass, game, game_identity
|
||||
# 允许跳关、 关卡已经开启、 用户是已认证老师以上的身份
|
||||
if task_pass || game.status != 3 || game_identity <= User::EDU_CERTIFICATION_TEACHER
|
||||
game.identifier
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,12 @@
|
||||
class AddIsMdForHomeworks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
# add_column :homework_commons, :is_md, :boolean, :default => true
|
||||
# add_column :homework_banks, :is_md, :boolean, :default => true
|
||||
#
|
||||
#
|
||||
# add_column :exercise_questions,:is_md, :boolean, :default => true
|
||||
# add_column :poll_questions,:is_md, :boolean, :default => true
|
||||
#
|
||||
# add_column :exercise_bank_questions, :is_md, :boolean, :default => true
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
class MigrateCourseIsMd < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
|
||||
# HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
|
||||
#
|
||||
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework|
|
||||
#
|
||||
# end
|
||||
#
|
||||
# ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
|
||||
# PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
|
||||
# ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
|
||||
end
|
||||
end
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue