'Export all of this course\'s assets to the output_directory. Export all of the assets\'
attributes to the policy file.
Args:
course_key (CourseKey): the :class:`CourseKey` identifying the course
output_directory: the directory under which to put all the asset files
assets_policy_file: the filename for the policy file which should be in the same
directory as the other policy files.'

def export_all_for_course(self, course_key, output_directory, assets_policy_file):

    policy = {}
    (assets, __) = self.get_all_content_for_course(course_key)
    for asset in assets:
        self.export(asset['asset_key'], output_directory)
        for (attr, value) in asset.iteritems():
            if (attr not in ['_id', 'md5', 'uploadDate', 'length', 'chunkSize', 'asset_key']):
                policy.setdefault(asset['asset_key'].name, {})[attr] = value
    with open(assets_policy_file, 'w') as f:
        json.dump(policy, f, sort_keys=True, indent=4)
