# Import from Moodle XML or JSON

> Upload a Moodle XML question bank export or JSON question files into EduBase, see how each Moodle question type is converted, and what to check afterwards.

EduBase imports questions from a Moodle XML file, the format Moodle exports its question banks in, and from JSON files with EduBase's own question fields. Both go through the same upload window as Excel and EDU files: up to 500 questions in one upload, into a folder of **My Quiz questions** or straight into a Quiz set.

## Upload the file

1. Open the folder of **My Quiz questions** you want the questions in, or the Quiz set (**Tasks → add questions**).
2. Choose **new question → Upload as file**.
3. Under **File**, choose the `.xml` or `.json` file, or a `.zip` with several of them, and choose **Upload**.

![The Upload questions window: supported formats XLSX, CSV, EDU, ZIP and Moodle XML, the File field, the limit of 500 questions and 20 MB, and the documentation, sample Excel and sample EDU buttons](https://help.edubase.net/assets/screens/questions/import-moodle-json/01-upload-window.webp)
/// caption
**My Quiz questions → Moodle import → new question → Upload as file**
///

The window lists XLSX, CSV, EDU, ZIP and Moodle XML; JSON files are accepted as well. After the upload, a message reports how many questions were imported and how many were skipped because of errors. See [Import questions in bulk](https://help.edubase.net/questions/import/) for what happens to an upload in general.

## How Moodle questions are converted

| Moodle type | EduBase type |
|---|---|
| Multiple choice with one correct answer | Single choice |
| True/False | Single choice with the options "true" and "false" |
| Short answer | Generic (exact match) if the Moodle question ignores case, Text otherwise |
| Numerical, Calculated | Numerical; the wildcards of a calculated question become [parameters](https://help.edubase.net/questions/parameterized/) |
| Essay | Free text (scored by hand) |
| Matching | Pairing |
| Description | Reading |

Not imported: Moodle multiple-answer questions, where each correct answer is worth part of the grade, and Cloze (embedded answers), Select missing words and the drag-and-drop types. Rebuild these by hand, for example as [multiple-choice questions](https://help.edubase.net/questions/types-choice/) or [hotspot questions](https://help.edubase.net/questions/types-hotspot/).

Also carried over:

- The question text, with images embedded in the export and LaTeX formulas.
- The **default mark** as the question's points.
- The Moodle category: its last level becomes the **Category**, the two levels above it its parent categories.
- The Moodle **ID number** as the **External ID**: uploading the same export again updates these questions instead of adding copies.
- The question's Moodle name, as a private note in the editor.

In the demo, a statistics teacher moves a Moodle category of eight questions: six arrive, the multiple-answer question and the Cloze question do not.

![The folder Moodle import after the upload: six questions, among them a free-text, a pairing, two single choice, a numerical and a generic question, each with its Moodle ID number as external ID](https://help.edubase.net/assets/screens/questions/import-moodle-json/02-imported.webp)
/// caption
**My Quiz questions → Moodle import**
///

## Check after a Moodle import

- **Short answer questions**: whether they should ignore case and punctuation (type **Text**) or need an exact match (**Generic**).
- **Numerical questions**: the Moodle tolerance is not imported; set the [tolerance](https://help.edubase.net/questions/scoring/) again.
- **Penalty**: Moodle's penalty for each retry becomes penalty points for a wrong answer, which works differently; check the **Penalty points** under **Answering and Scoring**.
- **Missing questions**: compare the number of questions with the Moodle category, and rebuild those that were not imported.

## JSON files

A JSON file holds one question as an object, with the same field names as an [EDU file](https://help.edubase.net/questions/edu-format/) or an Excel column, such as `TYPE`, `QUESTION`, `ANSWER` and `OPTIONS`:

```json
{
  "TYPE": "NUMERICAL",
  "QUESTION": "What is the median of 3, 7, 8, 12 and 20?",
  "ANSWER": "8",
  "POINTS": "2",
  "CATEGORY": "Descriptive statistics",
  "EXTERNAL_ID": "STAT1-MEDIAN-02"
}
```

To import many questions, put one JSON file per question in a ZIP. A JSON file that holds a list of questions imports nothing. Questions [exported](https://help.edubase.net/questions/export/) from EduBase as JSON import the same way, and the API takes the same fields in `POST /question`.

## Limits

- Up to 500 questions per upload; split larger Moodle banks into several exports.
- Moodle quiz settings, attempts and results are not part of a question bank export and do not come across.
- A Moodle question without a default mark is imported with 0 points. Moodle's own exports always include it.

## Related

- [Move a question bank from Moodle](https://help.edubase.net/guides/migrate-from-moodle/)
- [Import questions in bulk](https://help.edubase.net/questions/import/)
- [The EDU text format](https://help.edubase.net/questions/edu-format/)
- [Export questions](https://help.edubase.net/questions/export/)
- [Question types at a glance](https://help.edubase.net/questions/types/)
