wip
This commit is contained in:
27
listings/aggregation-job.py
Normal file
27
listings/aggregation-job.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pandas as pd
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
def calculate_kpis(events_df, date_range):
|
||||
"""Berechnet KPIs aus Telemetrie-Events für einen bestimmten Zeitraum."""
|
||||
|
||||
# Filtere Events nach Zeitraum
|
||||
mask = (events_df['timestamp'] >= date_range[0]) & \
|
||||
(events_df['timestamp'] <= date_range[1])
|
||||
period_events = events_df[mask]
|
||||
|
||||
# Berechne Erfolgsquote
|
||||
total_attempts = len(period_events[period_events['verb'] == 'attempted'])
|
||||
successful_attempts = len(period_events[period_events['verb'] == 'passed'])
|
||||
|
||||
success_rate = 0
|
||||
if total_attempts > 0:
|
||||
success_rate = successful_attempts / total_attempts * 100
|
||||
|
||||
# Berechne Durchschnittliche Bearbeitungszeit
|
||||
avg_duration = period_events['duration'].mean()
|
||||
|
||||
return {
|
||||
'success_rate': success_rate,
|
||||
'avg_duration': avg_duration,
|
||||
'total_attempts': total_attempts
|
||||
}
|
||||
52
listings/xapi-example.json
Normal file
52
listings/xapi-example.json
Normal file
@@ -0,0 +1,52 @@
|
||||
[
|
||||
{
|
||||
"id": "8c3f8f3e-7b2d-4b0e-9a1a-2f1a0b6b9c01",
|
||||
"actor": {
|
||||
"objectType": "Agent",
|
||||
"account": { "homePage": "https://example.edu", "name": "pseudonym-123" }
|
||||
},
|
||||
"verb": {
|
||||
"id": "http://adlnet.gov/expapi/verbs/attempted",
|
||||
"display": { "de-DE": "versuchte" }
|
||||
},
|
||||
"object": {
|
||||
"id": "https://example.edu/activity/task-42",
|
||||
"definition": { "name": { "de-DE": "Aufgabe 42" } }
|
||||
},
|
||||
"context": {
|
||||
"platform": "serious-game-web",
|
||||
"registration": "2d9a3f49-8a9d-4c54-8f5e-1f3b3b3d8a11",
|
||||
"contextActivities": {
|
||||
"parent": [{ "id": "https://example.edu/module/mod-3" }]
|
||||
},
|
||||
"extensions": {
|
||||
"https://example.edu/xapi/ext/attempt_id": "a-00017",
|
||||
"https://example.edu/xapi/ext/item_id": "task-42"
|
||||
}
|
||||
},
|
||||
"timestamp": "2026-01-24T10:15:30Z"
|
||||
},
|
||||
{
|
||||
"id": "b91e2d3a-4d3f-4f8f-8a0d-7d6c2e6f1b22",
|
||||
"actor": {
|
||||
"objectType": "Agent",
|
||||
"account": { "homePage": "https://example.edu", "name": "pseudonym-123" }
|
||||
},
|
||||
"verb": {
|
||||
"id": "http://adlnet.gov/expapi/verbs/passed",
|
||||
"display": { "de-DE": "bestand" }
|
||||
},
|
||||
"object": { "id": "https://example.edu/activity/task-42" },
|
||||
"result": {
|
||||
"success": true,
|
||||
"score": { "scaled": 0.9 },
|
||||
"duration": "PT45S"
|
||||
},
|
||||
"context": {
|
||||
"platform": "serious-game-web",
|
||||
"registration": "2d9a3f49-8a9d-4c54-8f5e-1f3b3b3d8a11",
|
||||
"extensions": { "https://example.edu/xapi/ext/attempt_id": "a-00017" }
|
||||
},
|
||||
"timestamp": "2026-01-24T10:16:15Z"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user