'Copy the structure and update the history info (edited_by, edited_on, previous_version)'

def version_structure(self, course_key, structure, user_id):

    if (course_key.branch is None):
        raise InsufficientSpecificationError(course_key)
    bulk_write_record = self._get_bulk_ops_record(course_key)
    if (bulk_write_record.active and (course_key.branch in bulk_write_record.dirty_branches)):
        return bulk_write_record.structure_for_branch(course_key.branch)
    new_structure = copy.deepcopy(structure)
    new_structure['_id'] = ObjectId()
    new_structure['previous_version'] = structure['_id']
    new_structure['edited_by'] = user_id
    new_structure['edited_on'] = datetime.datetime.now(UTC)
    new_structure['schema_version'] = self.SCHEMA_VERSION
    if bulk_write_record.active:
        bulk_write_record.set_structure_for_branch(course_key.branch, new_structure)
    return new_structure
