def _create_activity_formdatadict(activity):
    if not [activity for activity_type in ACTIVITY_TYPES if isinstance(activity, activity_type)]:
        return
    data = dict()
    data['name'] = activity.name
    data['short_name'] = activity.short_name
    data['status'] = activity.status
    data['due_date'] = activity.due_date
    data['percent'] = activity.percent
    data['url'] = ''
    if 'url' in activity.config:
        data['url'] = activity.config['url']
    data['showstats'] = True
    if 'showstats' in activity.config:
        data['showstats'] = activity.config['showstats']
    data['showhisto'] = True
    if 'showhisto' in activity.config:
        data['showhisto'] = activity.config['showhisto']
    if 'calculation_leak' in activity.config:
        data['calculation_leak'] = activity.config['calculation_leak']

    for (k, v) in list(GROUP_STATUS_MAP.items()):
        if activity.group == v:
            data['group'] = k
    if isinstance(activity, NumericActivity):
        data['max_grade'] = activity.max_grade
    if isinstance(activity, CalNumericActivity):
        data['formula'] = activity.formula
    if isinstance(activity, CalLetterActivity):
        data['numeric_activity'] = activity.numeric_activity_id
        data['exam_activity'] = activity.exam_activity_id
    return data