def edit_activity(request, course_slug, activity_slug):
    course = get_object_or_404(CourseOffering, slug=course_slug)
    activities = all_activities_filter(slug=activity_slug, offering=course)

    numact_choices = [(na.pk, na.name) for na in NumericActivity.objects.filter(offering=course, deleted=False)]
    examact_choices = [(0, '\u2014')] + [(na.pk, na.name) for na in Activity.objects.filter(offering=course, deleted=False)]
    if (len(activities) == 1):
        activity = activities[0]

        # extend group options
        activities_list = [(None, '\u2014'),]
        activities = all_activities_filter(offering=course)
        for a in activities:
            if a.group == True and a.id != activity.id:
                activities_list.append((a.slug, a.name))

        from_page = request.GET.get('from_page')