Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/importers/assignment_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def self.import_from_migration(hash, context, migration, item = nil, quiz = nil)
if new_record || item.deleted? || master_migration
restore_lti_models(item) if item.deleted?
item.workflow_state = if item.can_unpublish?
hash[:workflow_state] || "published"
hash[:workflow_state] || "unpublished"
else
"published"
end
Expand Down
11 changes: 11 additions & 0 deletions spec/models/content_migration/course_copy_assignments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@
end
end

it "copies assignments as unpublished" do
from_assign = @copy_from.assignments.create!(title: "published assignment")
from_assign.publish!
expect(from_assign).to be_published

run_course_copy

to_assign = @copy_to.assignments.where(migration_id: mig_id(from_assign)).first!
expect(to_assign).to be_unpublished
end

it "links assignments to account rubrics and outcomes" do
account = @copy_from.account
lo = create_outcome(account)
Expand Down