diff --git a/src/xapi/views.py b/src/xapi/views.py index 18e028a8e59be2b46e601a75ef9e0b423ff7409f..ed18d1db373f9e2eb5d28fc527f5da8a6c791b58 100644 --- a/src/xapi/views.py +++ b/src/xapi/views.py @@ -2,6 +2,7 @@ import hashlib import json import os from venv import logger +import datetime import requests from django.conf import settings @@ -33,6 +34,7 @@ with open(os.path.join(PROJECT_PATH, "static/xapi_statement.schema.json")) as f: def store_in_db(x_api_statement): collection = lrs_db["statements"] try: + x_api_statement.set("stored", datetime.datetime.now().isoformat()) # append "stored"-field - see https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#248-stored result = collection.insert_one(x_api_statement) return str(result.inserted_id) except Exception as e: