# Moodle

> Read Moodle courses, users, enrolments, activities, assignments, grades, forums, calendars and completion.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/moodle

## Actions

### Get activity completion

Get activity completion.

**Inputs**

- Course (`course_id`, number, required): Course. At least 1.
- User ID (`learner_id`, number, required): User ID. At least 1.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "statuses": []
  }
}
```

### Get calendar events

Get calendar events.

**Inputs**

- Course ids (`course_ids`, list): Course ids.
- Start (`start`, date and time): Start.
- End (`end`, date and time): End.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "events": []
  }
}
```

### Get course completion

Get course completion.

**Inputs**

- Course (`course_id`, number, required): Course. At least 1.
- User ID (`learner_id`, number, required): User ID. At least 1.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "completionstatus": {
      "completed": false
    }
  }
}
```

### Get course contents

Get course contents.

**Inputs**

- Course (`course_id`, number, required): Course. At least 1.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### Get courses by field

Get courses by field.

**Inputs**

- Search field (`search_field`, text, required): Search field. One of: `id`, `ids`, `shortname`, `idnumber`, `category`.
- Value (`value`, text, required): Value.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "courses": []
  }
}
```

### Get grade items

Get grade items.

**Inputs**

- Course (`course_id`, number, required): Course. At least 1.
- Learner id (`learner_id`, number): Learner id. At least 1.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "usergrades": []
  }
}
```

### Get site info

Get site info.

**Inputs**: None.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "functions": [],
    "sitename": "example",
    "userid": 1,
    "username": "example"
  }
}
```

### Get users

Get users.

**Inputs**

- Search field (`search_field`, text, required): Search field. One of: `id`, `username`, `idnumber`, `email`.
- Values (`values`, list, required): Values.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List assignment grades

List assignment grades.

**Inputs**

- Assignment ids (`assignment_ids`, list, required): Assignment ids.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "assignments": []
  }
}
```

### List assignment submissions

List assignment submissions.

**Inputs**

- Assignment ids (`assignment_ids`, list, required): Assignment ids.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "assignments": []
  }
}
```

### List assignments

List assignments.

**Inputs**

- Courses (`course_ids`, list): Courses.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "courses": []
  }
}
```

### List categories

List categories.

**Inputs**: None.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List courses

List courses.

**Inputs**: None.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List discussion posts

List discussion posts.

**Inputs**

- Discussion id (`discussion_id`, number, required): Discussion id. At least 1.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "posts": []
  }
}
```

### List enrolled users

List enrolled users.

**Inputs**

- Course (`course_id`, number, required): Course. At least 1.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List forum discussions

List forum discussions.

**Inputs**

- Forum id (`forum_id`, number, required): Forum id. At least 1.
- Page (`page`, number): Page. At least 0.
- Perpage (`perpage`, number): Perpage. From 1 to 100.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "discussions": []
  }
}
```

### List forums

List forums.

**Inputs**

- Courses (`course_ids`, list): Courses.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List quizzes

List quizzes.

**Inputs**

- Courses (`course_ids`, list): Courses.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "quizzes": []
  }
}
```

### List user courses

List user courses.

**Inputs**

- User ID (`learner_id`, number, required): User ID. At least 1.

**Outputs**

- `data` (list): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": []
}
```

### List user quiz attempts

List user quiz attempts.

**Inputs**

- Quiz id (`quiz_id`, number, required): Quiz id. At least 1.
- Learner id (`learner_id`, number): Learner id. At least 1.
- Status (`status`, text): Status. One of: `all`, `finished`, `unfinished`.

**Outputs**

- `data` (object): The service response, including pagination metadata when present.

**Example output**

```json
{
  "data": {
    "attempts": []
  }
}
```
