|
|
|
@ -240,8 +240,9 @@ class QuestionBanksController < ApplicationController
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
new_task = GraduationTask.new
|
|
|
|
|
new_task.attributes = task.attributes.dup.except("id", "course_id", "user_id", "quotes", "graduation_task_id",
|
|
|
|
|
"course_list_id")
|
|
|
|
|
"course_list_id", "gtask_bank_id")
|
|
|
|
|
new_task.course_id = course.id
|
|
|
|
|
new_task.gtask_bank_id = task.id
|
|
|
|
|
new_task.user_id = current_user.id
|
|
|
|
|
if new_task.save!
|
|
|
|
|
new_task.create_work_list
|
|
|
|
@ -264,8 +265,10 @@ class QuestionBanksController < ApplicationController
|
|
|
|
|
def quote_gtopic_bank topic, course
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
new_topic = GraduationTopic.new
|
|
|
|
|
new_topic.attributes = topic.attributes.dup.except("id", "course_id", "user_id", "graduation_topic_id", "course_list_id")
|
|
|
|
|
new_topic.attributes = topic.attributes.dup.except("id", "course_id", "user_id", "graduation_topic_id",
|
|
|
|
|
"course_list_id", "gtopic_bank_id")
|
|
|
|
|
new_topic.course_id = course.id
|
|
|
|
|
new_topic.gtopic_bank_id = topic.id
|
|
|
|
|
new_topic.user_id = current_user.id
|
|
|
|
|
new_topic.save
|
|
|
|
|
|
|
|
|
|