Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ services:
- ${PORT-8000}:8000
environment:
- MOODLE_URL=${MOODLE_URL}
- ALLOW_ORIGINS=${ALLOW_ORIGINS}
- LOG_LEVEL=${LOG_LEVEL}
restart: unless-stopped
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"method": "GET",
"description": "Get completion status for activities in a course",
"query_params": [
{
"name": "courseid",
"type": "int",
"required": true,
"description": "Course ID"
},
{
"name": "userid",
"type": "int",
"required": false,
"description": "User ID (defaults to current user if not specified)"
}
],
"responses": {
"200": {
"description": "List of activities with completion status",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"statuses": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cmid": {
"type": "integer",
"description": "Course module ID"
},
"modname": {
"type": "string",
"description": "Module name (e.g., resource, assign, quiz, label, url, feedback)"
},
"instance": {
"type": "integer",
"description": "Instance ID"
},
"state": {
"type": "integer",
"description": "Completion state (0=incomplete, 1=complete, 2=complete with pass)"
},
"timecompleted": {
"type": "integer",
"description": "Timestamp when completed (0 if not completed)"
},
"tracking": {
"type": "integer",
"description": "Completion tracking type (1=manual, 2=automatic)"
},
"overrideby": {
"type": ["integer", "null"],
"description": "User ID who overrode completion (null if not overridden)"
},
"valueused": {
"type": "boolean",
"description": "Whether this completion is used for course completion"
},
"hascompletion": {
"type": "boolean",
"description": "Whether the activity has completion enabled"
},
"isautomatic": {
"type": "boolean",
"description": "Whether completion is automatic"
},
"istrackeduser": {
"type": "boolean",
"description": "Whether the user is tracked for completion"
},
"uservisible": {
"type": "boolean",
"description": "Whether the activity is visible to the user"
},
"details": {
"type": "array",
"description": "Array of completion rule details",
"items": {
"type": "object",
"properties": {
"rulename": {
"type": "string",
"description": "Name of the completion rule (e.g., completionview, completionsubmit)"
},
"rulevalue": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "Status of the rule (0=not met, 1=met)"
},
"description": {
"type": "string",
"description": "Description of the rule"
}
}
}
}
}
},
"isoverallcomplete": {
"type": "boolean",
"description": "Whether the activity is overall complete"
}
}
}
},
"warnings": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"example": {
"statuses": [
{
"cmid": 115312,
"modname": "resource",
"instance": 55202,
"state": 1,
"timecompleted": 1692954398,
"tracking": 2,
"overrideby": null,
"valueused": false,
"hascompletion": true,
"isautomatic": true,
"istrackeduser": true,
"uservisible": true,
"details": [
{
"rulename": "completionview",
"rulevalue": {
"status": 1,
"description": "Anzeigen"
}
}
],
"isoverallcomplete": true
},
{
"cmid": 116438,
"modname": "assign",
"instance": 5916,
"state": 0,
"timecompleted": 0,
"tracking": 2,
"overrideby": null,
"valueused": false,
"hascompletion": true,
"isautomatic": true,
"istrackeduser": true,
"uservisible": true,
"details": [
{
"rulename": "completionview",
"rulevalue": {
"status": 1,
"description": "Anzeigen"
}
},
{
"rulename": "completionsubmit",
"rulevalue": {
"status": 0,
"description": "Abgabe einreichen"
}
}
],
"isoverallcomplete": false
},
{
"cmid": 116443,
"modname": "label",
"instance": 24959,
"state": 1,
"timecompleted": 1692955648,
"tracking": 1,
"overrideby": null,
"valueused": true,
"hascompletion": true,
"isautomatic": false,
"istrackeduser": true,
"uservisible": true,
"details": [],
"isoverallcomplete": true
}
],
"warnings": []
}
}
}
},
"422": {
"description": "Invalid Request",
"content": {
"application/json": {
"schema": {
"type": "object"
},
"example": {
"error": "invalidparameter",
"errorcode": "invalidparameter"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"method": "GET",
"description": "Get course completion status for a user",
"query_params": [
{
"name": "courseid",
"type": "int",
"required": true,
"description": "Course ID"
},
{
"name": "userid",
"type": "int",
"required": false,
"description": "User ID (defaults to current user if not specified)"
}
],
"responses": {
"200": {
"description": "Course completion status information",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"completionstatus": {
"type": "object",
"properties": {
"completed": {
"type": "boolean",
"description": "Whether the course is completed"
},
"aggregation": {
"type": "integer",
"description": "Completion aggregation method"
},
"completions": {
"type": "array",
"description": "List of completion criteria",
"items": {
"type": "object",
"properties": {
"type": {
"type": "integer",
"description": "Completion criteria type"
},
"title": {
"type": "string",
"description": "Criteria title"
},
"status": {
"type": "string",
"description": "Completion status (complete/incomplete)"
},
"complete": {
"type": "boolean",
"description": "Whether this criteria is complete"
},
"timecompleted": {
"type": "integer",
"description": "Timestamp when completed"
},
"details": {
"type": "object",
"description": "Additional criteria details"
}
}
}
}
}
},
"warnings": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"example": {
"completionstatus": {
"completed": false,
"aggregation": 1,
"completions": [
{
"type": 4,
"title": "Activity completion",
"status": "incomplete",
"complete": false,
"timecompleted": 0,
"details": {
"rulename": "Complete all activities",
"rulevalue": {
"required": 5,
"completed": 3
}
}
},
{
"type": 6,
"title": "Manual completion",
"status": "incomplete",
"complete": false,
"timecompleted": 0,
"details": {}
}
]
},
"warnings": []
}
}
}
},
"422": {
"description": "Invalid Request",
"content": {
"application/json": {
"schema": {
"type": "object"
},
"example": {
"error": "invalidparameter",
"errorcode": "invalidparameter"
}
}
}
}
}
}
Loading
Loading