|
|
|
@ -6920,6 +6920,7 @@ def quote_resource_bank resource, course
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def quote_homework_bank homework, course
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
new_homework = HomeworkCommon.new(:name => homework.name, :user_id => User.current.id, :description => homework.description, :homework_type => homework.homework_type, :late_penalty => 5,
|
|
|
|
|
:course_id => course.id, :teacher_priority => 1, :anonymous_comment => 1, :quotes => 0, :is_open => 0, :homework_bank_id => homework.id, :score_open => 1,
|
|
|
|
|
:anonymous_appeal => 0, :is_public => 0, :reference_answer => homework.reference_answer, :answer_public => 1, :allow_late => 1)
|
|
|
|
@ -6981,9 +6982,11 @@ def quote_homework_bank homework, course
|
|
|
|
|
QuestionBank.where(:container_id => homework.id, :container_type => ["Common", "Shixun", "Group"]).update_all(:quotes => homework.quotes)
|
|
|
|
|
end
|
|
|
|
|
return new_homework
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def quote_exercise_bank exercise, course
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
new_exercise = Exercise.new(:exercise_name => exercise.name, :exercise_description => exercise.description, :user_id => User.current.id, :is_public => 0,
|
|
|
|
|
:exercise_status => 1, :show_result => 1, :course_id => course.id, :time => -1, :exercise_bank_id => exercise.id)
|
|
|
|
|
|
|
|
|
@ -7031,9 +7034,11 @@ def quote_exercise_bank exercise, course
|
|
|
|
|
QuestionBank.where(:container_id => exercise.id, :container_type => "Exercise").update_all(:quotes => exercise.quotes)
|
|
|
|
|
end
|
|
|
|
|
return new_exercise
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def quote_poll_bank poll, course
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
new_poll = Poll.new(:polls_name => poll.name, :polls_description => poll.description, :user_id => User.current.id, :is_public => 0,
|
|
|
|
|
:polls_status => 1, :show_result => 1, :polls_type => 'Course', :course_id => course.id, :exercise_bank_id => poll.id)
|
|
|
|
|
|
|
|
|
@ -7062,6 +7067,7 @@ def quote_poll_bank poll, course
|
|
|
|
|
QuestionBank.where(:container_id => poll.id, :container_type => "Poll").update_all(:quotes => poll.quotes)
|
|
|
|
|
end
|
|
|
|
|
return new_poll
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def major_level_option
|
|
|
|
|