How to Move a Fixed Quiz Question from a Sandbox Site to Your Live Site
Learn how to efficiently transfer a corrected quiz question from a Moodle sandbox site to a live site using Moodle XML format. This guide helps avoid unnecessary edits and maintains the integrity of the live quiz.
Moodle version: 4.5 Estimated time: 6 minutes Difficulty: Intermediate
Why you'd use this
You've corrected a quiz question on your sandbox (test) Moodle site and now need to apply the same fix to the live site without redoing the work. The cleanest way is to export the single question from the sandbox's question bank and import it into the live site then swap it into the live quiz. This avoids touching unrelated questions and avoids any risk of editing directly in production.
Before you start
Permissions required:
- Teacher or Manager role on both the sandbox site and the live site, with access to the Question bank in the relevant course on each
- Capability to export and import questions (included in the standard Teacher role by default)
You'll need:
- The corrected question already saved in the sandbox site's question bank
- The name of the question and the category it lives in on the sandbox
- The name of the course and quiz on the live site where the question needs to go
- A few minutes when the live quiz is not actively being taken by students, ideally
Not sure if you have the right permissions? On each site, open any course you teach and look in the course's secondary navigation for a Question bank link. If you can see it and click into it, you have what you need. If not, ask your Moodle administrator.
⚠️ Before you start — about live attempts: If students have already attempted the quiz on the live site, swapping in a corrected question can affect their grades. Read the warning at Step 7 before going live with the change.
💡 About this approach: This guide uses Moodle XML format to export and import a single question (or small group of questions). It avoids course-level backup/restore, which moves far more than you need. If you're moving many questions or a whole question category, a course backup may be faster — see Related guides.
Step-by-step
Step 1: On the sandbox site, open the Question bank
Log in to your sandbox Moodle. Open the course that contains the corrected question. In the course's secondary navigation, click Question bank. By default this opens the Questions view.
Step 2: Find the corrected question and note its category
Use the Category dropdown at the top to navigate to the category containing your question, or use the search/filter to find it by name. Write down the category name you'll want to put the question into a matching category on the live site.
Step 3: Switch to the Export view
On the Question bank page, open the dropdown menu near the top (in Moodle 4.5 this is the Question bank dropdown listing Questions, Categories, Import, Export, etc.) and choose Export.
Step 4: Configure the export
On the Export questions to file page:
- For File format, select Moodle XML format.
- Under General, set Export category to the category containing your corrected question.
- Leave Write category to file and Write context to file at their defaults (ticked is fine).
💡 Tip: This will export all questions in that category, not just the one you fixed. That's usually fine — on import, you can choose which category to land them in and you can ignore questions you don't need. If you only want the one question, see Common problems below for a workaround.
Step 5: Download the export file
Click the Export questions to file button at the bottom. Moodle generates a .xml file and offers it for download. Save it somewhere you'll find again e.g. your Desktop. Name it clearly, like quiz-question-fix-2026-05-20.xml.
Step 6: On the live site, open the Question bank and pick a category
Log in to your live Moodle (in a separate browser tab is easiest). Open the course containing the live quiz. Go to Question bank, then use the Category dropdown to select the category where the corrected question should live. Ideally this matches the category name from the sandbox.
Step 7: Import the question file
⚠️ Warning: live quiz with attempts: If the live quiz has student attempts, importing creates a new question rather than overwriting the existing one. You will then need to swap it into the quiz (Step 9) and decide whether to regrade past attempts. Do not assume importing automatically updates the question already in the quiz, it does not.
From the Question bank dropdown, choose Import. On the import page:
- For File format, select Moodle XML format.
- Under General, set Import category to the category you selected in Step 6 (or tick Get category from file if you want Moodle to use the category name from the XML).
- Drag your
.xmlfile into the Import questions from file area, or click Choose a file and upload it. - Click the Import button at the bottom.
Moodle shows a summary of imported questions. Click Continue.
Step 8: Preview the imported question on the live site
Back in the Question bank, find the newly imported question (it'll have the same name as on the sandbox). Click the preview (magnifying glass) icon and confirm the corrected wording, answers, and feedback all look right.
Step 9: Swap the question into the live quiz
Open the live quiz, then click the Questions tab.
- Find the old, uncorrected version of the question in the quiz.
- Click the delete (bin) icon next to it to remove it from the quiz. (This removes it from the quiz only the question still exists in the question bank.)
- Click Add > from question bank.
- Tick the corrected, imported question and click Add selected questions to the quiz.
- Drag the new question into the same position the old one occupied so the question order stays consistent.
⚠️ Reminder: Removing the old question from the quiz does not affect past student attempts — Moodle keeps the snapshot used at attempt time. But the gradebook column for that question may behave differently going forward. See Step 10.
Step 10: (If the quiz has past attempts) Regrade
If students have already attempted this quiz on the live site, open the quiz's Results tab and use the Regrade all attempts option. This recalculates grades using the corrected question. Confirm when prompted and wait for the regrade to finish.
Check it worked
Open the live quiz and click the Questions tab the corrected question should be in place, with the old version gone. Click its preview icon to confirm the wording matches what you fixed on the sandbox. If you regraded, go to Results > Grades and check that affected students' marks have updated as expected.
Common problems
- The export file contains questions I don't want to import, On the live site's import step, Moodle imports everything in the file. The simplest workaround: after import, just delete the unwanted new questions from the live question bank. Alternatively, on the sandbox, move the single corrected question into a new temporary category before exporting, so only that one question is in the file.
- The imported question appears as a duplicate alongside the old one, That's expected. Importing never overwrites an existing question; it always creates a new one. Use Step 9 to swap the old version out of the quiz.
- "Format not recognised" or import errors, Confirm you selected Moodle XML format on both export and import. Other formats (GIFT, Aiken, etc.) won't round-trip cleanly for all question types.
- The question imports but images/media are missing, Embedded images are included in the XML for most question types, but very large images or files attached via the file picker can occasionally fail. Open the imported question and check the Question text field; re-upload any missing images directly.
- My sandbox is on a different Moodle version than live, Exporting from a newer version and importing into an older one can fail or lose features. If the sandbox is 4.5 and live is older, compatibility with your live version's question import. Generally, same-version or sandbox-older-than-live is safe; sandbox-newer-than-live is risky.
Looking to enhance your Moodle experience? EssingtonITS offers expert IT services to optimise your learning platforms. For tailored Moodle hosting and support, explore our dedicated e-learning services at myelms.co.uk. Let us help you achieve seamless and efficient e-learning solutions.
Moodle is a registered trademark of Moodle Pty Ltd. This channel is independently operated by EssingtonITS and is not affiliated with or endorsed by Moodle.
person people found this useful.