How to Use Google Gemini to Create Moodle Question Banks from Any Worksheet


Got a fill-in-the-blanks worksheet with an answer key? You can use Google Gemini to instantly convert it into a ready-to-import Moodle question bank — no coding, no manual entry. This tutorial shows you exactly how, step by step.

You will need:

  • A fill-in-the-blanks worksheet in Word format (.docx) with an answer key included
  • Access to Google Gemini (gemini.google.com)
  • A Moodle (Sleedu) course to import the questions into

Part A — Generate the Questions with Google Gemini

Step 1: Open Google Gemini and paste the prompt

Go to gemini.google.com and sign in with your Google account. Copy and paste the prompt below into the chat box, then press Enter to send it.

Prompt pasted into Gemini

Paste the full prompt into Gemini and send it

📋 COPY THIS PROMPT
I am uploading a fill-in-the-blanks worksheet with an answer key. Convert every fill-in-the-blank question into an individual Moodle 5.2 Cloze (Embedded Answers) XML question. Follow these rules exactly: FORMAT: – Output a single Moodle XML file ready to import via Question bank → Import → Moodle XML format. – Each blank on the worksheet becomes its own separate <question type=”cloze”> entry — do NOT group multiple blanks into one question. – Use this Cloze syntax for each blank: {1:SHORTANSWER:=correct_answer} – All answers must be case-insensitive (use SHORTANSWER, not SHORTANSWER_C). – Where reasonable, include common alternative spellings or synonyms using: {1:SHORTANSWER:=answer1~=%100%answer2~=%100%answer3} – If a question has two blanks on the same line (e.g., “PPE stands for ___ ___ Equipment”), keep them in one question with two Cloze fields. QUESTION STRUCTURE: – Each question’s <name> should follow this pattern: “[Topic] – Q[number]: [short description of the answer]” Example: Lab Safety – Q14: Waft – Each question’s <questiontext> must include: 1. A bold section header matching the worksheet (e.g., <strong>Section 4 — Handling Chemicals</strong>) 2. The question number 3. The full sentence with the Cloze blank embedded – Wrap all questiontext content in <![CDATA[ ]]> – Use format=”html” for questiontext XML STRUCTURE: – Start with <?xml version=”1.0″ encoding=”UTF-8″?> – Wrap everything in <quiz> tags – Include a <question type=”category”> at the top to create a category. Name it based on the worksheet topic. – Each question must include: <name>, <questiontext>, <generalfeedback>, <penalty>0.3333333</penalty>, <hidden>0</hidden>, <idnumber></idnumber> – The generalfeedback should say: “Review the [topic] Study Notes — Section [X] for the correct answer.” ANSWERS: – Use the answer key provided in the worksheet. Do not guess or change answers. – For number answers (e.g., “15”), also accept the spelled-out version (e.g., “fifteen”). – For hyphenated answers (e.g., “broken-glass”), also accept without the hyphen (“broken glass”). Do not include any explanation or commentary. Output only the complete XML file content.

Step 2: Gemini confirms it understands

Gemini will respond with a confirmation that it has the Moodle Cloze rules ready and will show you the XML structure it will use. It will ask you to provide the worksheet.

Gemini acknowledges the prompt and shows XML structure

Gemini confirms it understands the format and is ready for your worksheet

Step 3: Upload your worksheet

Click the attachment icon (paperclip) in the Gemini chat box and upload your fill-in-the-blanks worksheet (.docx file). Add a short message like “Here is the worksheet with answer key” and press Enter.

Make sure your worksheet includes:

  • Numbered fill-in-the-blank questions with clear blanks (underlines)
  • An answer key with the correct answer for each numbered question
Uploading the worksheet file to Gemini

Upload your .docx worksheet and send it

Step 4: Download the generated XML

Gemini will generate the complete Moodle XML file. You will see XML code in the response. Click the download button (down arrow icon) at the top of the code block to save it as an .xml file to your computer.

If there is no download button, click the copy button instead, then open a plain text editor (like Notepad), paste the code, and save it as a .xml file (not .txt).

Gemini generates the XML code

Gemini outputs the complete Moodle XML — download or copy it


Part B — Import into Moodle (Sleedu)

Step 5: Go to your course Question Bank

Log into your Moodle site (Sleedu). Open your course, click More in the top navigation, and select Question banks.

More menu with Question banks selected

More → Question banks

Step 6: Open your question bank

Click on your course question bank to open it.

Question banks list

Click your course question bank to open it

Step 7: Go to Import

Click the Questions dropdown and select Import.

Import selected from dropdown

Select “Import” from the Questions dropdown

Step 8: Select Moodle XML format and upload the file

On the Import page:

  • Under File format, select Moodle XML format
  • Check Get category from file — this will automatically create a category based on the name Gemini put in the XML
  • Click Choose a file and select the .xml file you downloaded from Gemini
  • Click Import
Import settings with Moodle XML format selected

Select Moodle XML format, check Get category from file, and upload your XML

Step 9: Verify your questions

After importing, Moodle shows a summary. Your questions are now in the question bank under a new category, ready to add to any quiz.

44 questions successfully imported

All questions imported successfully into their own category


💡 Tips for Best Results

  • Always include the answer key in the same document as the worksheet. Gemini needs it to set the correct answers.
  • Number your questions clearly (1, 2, 3…) so Gemini can match each blank to its answer.
  • Use clear blanks — underlines (____________) work best. Gemini looks for these to know where the Cloze fields go.
  • Review the XML before importing. Open the file in a text editor and spot-check a few answers against your answer key.
  • If Gemini makes a mistake, just tell it: “Question 14 should be ‘waft’ not ‘fan’ — fix it.” It will regenerate.
  • This works with any subject. History, science, ELA, math vocabulary — any worksheet with blanks and an answer key.
  • Save the prompt. Bookmark this page or copy the prompt into a Google Doc so you can reuse it every time you create a new worksheet.

Leave a Reply

Discover more from Win Elements

Subscribe now to keep reading and get access to the full archive.

Continue reading