Skip to main content

Tests for Moodle

This section covers generating test questions with AI for import into Moodle and other virtual classroom platforms.

Formats importable to Moodle

Aiken format

Official documentation

  • ✅ Simple and interpretable
  • ❌ Limited to multiple choice questions
  • ❌ No penalty for wrong answer

Example:

What is the capital of France?
A. London
B. Paris
C. Berlin
D. Madrid
ANSWER: B

GIFT format

Official documentation

  • ✅ More versatile
  • ✅ Allows different scores per answer
  • ✅ Supports various question types
  • ⚠️ More complex syntax

Example:

::Capital of France::What is the capital of France?{
=Paris
~London
~Berlin
~Madrid
}

Generation with AI

Base prompt to generate tests

Generate 10 multiple choice questions in [GIFT/Aiken] format about the following topic: [TOPIC].

Requirements:
- 4 options per question
- Only one correct answer
- Variety of difficulty (easy, medium, hard)
- Incorrect options must be plausible

Custom GPT for tests

chatGPT | GPT's
👤

Create test questions in GIFT format importable to Moodle, following these rules:

  • They will always be multiple-choice questions with 4 answers and only one correct one.
  • Incorrect answers will deduct half a point unless otherwise indicated.
  • All answers must be of similar length.
  • Rigor must be prioritized. The correct answer must be the only one that is correct. The others must be manifestly incorrect.
  • Questions with incorrect answers because they are not "the best definition" of those given, "the main disadvantage" or other forms of graduation must be avoided. Incorrect answers must be manifestly incorrect to avoid ambiguities and questions must be clear.
  • None of the answers should be trivially dismissible. Avoid the usual bias that the correct question is always one of 3 similar ones and there is another more absurd one.
  • The expected difficulty level is for university master's degree students unless otherwise indicated.
  • Do not include a number before the questions, they will be shuffled.
  • Material will normally be provided to generate the questions, avoid making direct references such as "according to the notes". The questions must contain by themselves all the necessary information to answer them. Students will not be able to consult the notes during the test.
  • Be careful avoiding biases such as the correct answer being the most detailed or the longest one.

An example of the desired question format would be the following:


// question: 91483439 name: What is stratified sampling? ::What is stratified sampling?::[html]What is stratified sampling?{ ~%-50%Dividing the dataset into groups and guaranteeing that all samples of a group are in the same set (test, validation, or training). =Dividing the dataset into groups and taking a percentage of each stratum maintaining the original proportion of the classes ~%-50%Dividing the dataset into groups and increasing the presence of minority classes by duplicating or generating new samples, which can lead to a more balanced representation of classes in the test set. ~%-50%Dividing the dataset into groups and increasing the complexity of the model, which can result in a more robust model but also harder to interpret and adjust. }

🤖

// question: 67895124 name: What is a generative model in artificial intelligence? ::What is a generative model in artificial intelligence?::[html]What is a generative model in artificial intelligence?{ ~%-50%An algorithm that classifies existing data into predefined categories based on features learned during training. ~%-50%A system that optimizes sequential decisions through interaction with an environment to maximize a cumulative reward. =A type of model that learns the distribution of training data and can generate new samples similar to these. ~%-50%An approach that reduces dimensionality of complex data by transforming them into simpler representations while preserving essential information. }

// question: 38215907 name: What is the main difference between supervised and unsupervised learning? ::What is the main difference between supervised and unsupervised learning?::[html]What is the main difference between supervised and unsupervised learning?{ ~%-50%Supervised learning uses neural networks while unsupervised employs traditional statistical algorithms. =Supervised learning uses labeled data as correct examples while unsupervised works with unlabeled data. ~%-50%Supervised learning requires less computational power while unsupervised needs more powerful computers. ~%-50%Supervised learning was developed in the 2010s while unsupervised has existed since the 1980s. }

// question: 29463187 name: What is cross-validation? ::What is cross-validation?::[html]What is cross-validation?{ ~%-50%A technique to reduce model complexity by removing redundant features from the dataset. ~%-50%A method to evaluate the performance of several models simultaneously on a single training set. ~%-50%A procedure that combines predictions of several models to improve the overall accuracy of the system. =A technique that divides the data into multiple subsets to train and validate the model, using each subset as test data once. }

Utility

This prompt has been used to create a public custom GPT that generates test questions.

How to create a test wizard

Custom wizards allow complex prompts to be reused:

In ChatGPT (GPTs):

  1. Go to ChatGPT GPTs
  2. Create a new GPT
  3. In "Instructions", define the prompt to generate tests
  4. Save and share the link

In Gemini (Gems):

  1. Access Gemini Gems
  2. Create a new Gem
  3. Define similar instructions
  4. Available for users with Gemini Advanced
Careful with the prompt

In the wizard instructions, DO NOT write "Create a test question generator...". Directly type the prompt that you want to be added to each conversation, such as: "You are an expert in educational evaluation. When the user provides you with a topic, generate test questions in GIFT format..."

Import to Moodle

  1. Prepare the file with the questions in Aiken or GIFT format
  2. Go to your course's question bank
  3. Select "Import"
  4. Choose the format (Aiken or GIFT)
  5. Upload the file
  6. Check that the questions have been imported correctly

Good practices

  • Always check: AI can generate questions with errors or ambiguities
  • Difficulty varies: Explicitly ask for easy, medium and difficult questions
  • Plausible distractors: Incorrect options must be credible
  • Avoid denials: Questions with "NO" or "EXCEPT" confuse more than they evaluate
  • Test before use: Import and review in Moodle before using in a real exam