Пример #1
0
    def store(self):
        if not settings.STORE_IN_LRS:
            return None
        elif IgnoredUser.objects.filter(user=self.user).exists():
            return None

        xapi = XAPIConnector()
        resp = xapi.submitStatement(self.statement())
        return resp
Пример #2
0
def store_event_in_remote_storage(event, user):
    if not settings.STORE_IN_LRS:
        return None
    elif IgnoredUser.objects.filter(user=user).exists():
        return HttpResponse(status=204)

    event["actor"] = {
        "objectType": "Agent",
        "account": {
            "homePage": "https://secure.uva.nl",
            "name": user
        }
    }
    xapi = XAPIConnector()
    resp = xapi.submitStatement(event)
    return event