GET /reports/scorm/:activityId/stats
GET /reports/scorm/:activityId/stats
GET /api/reports/scorm/[activityId]/stats - Get aggregate statistics for a SCORM activity Verify authentication with Clerk Get user's profile to determine role and tenant Verify user has access (instructor or admin) Verify the activity exists and is SCORM type Role-based access: instructors can only see their own courses Get all activity progress for this SCORM activity Calculate aggregate statistics Calculate average score Calculate average time spent (from tracking_data) Calculate average completion time (time from started_at to completed_at) Convert to seconds
Endpoint
GET /reports/scorm/:activityId/stats
Authentication
This endpoint requires authentication. Include your authentication token in the request headers.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
activityId | string | Path parameter |
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 404 | HTTP_404 | Not Found |
| 400 | HTTP_400 | Bad Request |
| 403 | HTTP_403 | Forbidden |
| 500 | HTTP_500 | Internal Server Error |
| 500 | HTTP_500 | Internal Server Error |
Example Request
curl -X GET "https://api.allurelms.com/reports/scorm/activityId-value/stats" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"