Example #1
0
def updated_grant_with_activity(updated_grant, profile):
    kwargs = {
        'created_on': datetime(2018, 12, 28, 14, 22, 35, tzinfo=UTC),
        'profile': profile,
        'grant': updated_grant,
        'activity_type': 'update_grant',
    }
    activity = Activity(**kwargs)
    activity.save(update=False)
    return updated_grant
Example #2
0
def new_contribution_with_activity(new_contribution, profile):
    kwargs = {
        'created_on': datetime(2018, 12, 29, 14, 22, 35, tzinfo=UTC),
        'profile': profile,
        'subscription': new_contribution,
        'activity_type': 'new_grant_contribution',
    }
    activity = Activity(**kwargs)
    activity.save(update=False)
    return new_contribution
Example #3
0
def cancelled_subscription_with_activity(cancelled_subscription, profile):
    kwargs = {
        'created_on': datetime(2018, 12, 31, 14, 22, 35, tzinfo=UTC),
        'profile': profile,
        'subscription': cancelled_subscription,
        'activity_type': 'killed_grant_contribution',
    }
    activity = Activity(**kwargs)
    activity.save(update=False)
    return cancelled_subscription
Example #4
0
def generate_assessments(user, n):
    """
    generate a assessment activities for user
    """
    activity = "http://www.example.com/fake/assessment/%d" % (randint(1,1000),)
    value = round(gauss(50,15))

    act = Activity(user=user,
                   type="http://adlnet.gov/expapi/activities/assessment",
                   verb="http://adlnet.gov/expapi/verbs/completed",
                   activity=activity,
                   value=value,
                   name="Fake",
                   description="Fake Assessment")
    act.save()