def __init__(self, moocdb, HIERARCHY_ROOT='https://'):
        self.resource_hierarchy = ResourceHierarchy(
            moocdb.csv_writers['resources'], HIERARCHY_ROOT, Resource)

        self.resource_types = DictionaryTable(moocdb, 'resource_types')
        self.resources_urls = DictionaryTable(moocdb, 'resources_urls')

        self.content_rules = {
            'video': 'lecture',
            'book': 'book',
            'problem': 'problem',
            'combinedopenended': 'problem',
            'wiki': 'wiki',
            'thread|forum|discussion': 'forum',
            'info': 'informational',
            'preview': 'testing',
            'about': 'informational',
            'progress': 'informational',
            'profile|login|account': 'profile',
            'open_ended': 'problem'
        }

        self.medium_rules = {
            'video': 'video',
            'book': 'text',
            'problem': 'text',
            'combinedopenended': 'text',
            'wiki': 'text',
            'thread|forum|discussion': 'text',
            'info': 'text',
            'about': 'text',
            'progress': 'text',
            'profile': 'text',
            'open_ended': 'text'
        }
Esempio n. 2
0
    def __init__(self, moocdb, HIERARCHY_ROOT='https://', CONFIG_PATH=''):

        self.CONTENT_RLS = CONFIG_PATH + 'content_rules.txt'
        self.MEDIUM_RLS = CONFIG_PATH + 'medium_rules.txt'

        self.resource_hierarchy = ResourceHierarchy(moocdb.resources,
                                                    HIERARCHY_ROOT, Resource)

        self.resource_types = DictionaryTable(moocdb, 'resource_types')
        self.resources_urls = DictionaryTable(moocdb, 'resources_urls')

        self.content_rules = util.load_rules(self.CONTENT_RLS, contentmedium)
        self.medium_rules = util.load_rules(self.MEDIUM_RLS, contentmedium)