Moodle Plugins directory: OpenAI Question Generator | Moodle.org
OpenAI Question Generator
moodle-block_openai_questions
Generate Moodle questions automatically from text
This plugin allows a user to submit a paragraph of text and automatically generate Moodle questions based on the text, using OpenAI's GPT API. This is an experimental plugin that is intended more for generating test data for a course; however, if teachers do use it for real-world use, I would be very interested in hearing about it.
To get started, create an OpenAI API account here. This plugin requries a commercial subscription via a paid OpenAI account. For more information on purchasing a subscription, please see the aforementioned link. Once a paid account is created, all you need to do is add the API key to the plugin settings.
- Supports multiple question types; choose between creating True/False, Short Answer, and Multiple Choice questions
- Specify number of questions to generate from the text NOTE: Because of how GPT works, it often doesn't generate the exact number of questions that is requested. Think of this field as more of a suggestion.
- Review and edit questions before adding them to the question bank
How to use
- Add API key to plugin settings
- In a given course, add the "Open AI Questions" block to the course
- Click the link in the block to generate questions
- Paste in the source text in the textbox, select the question type, and how many questions you want to generate
- Once the questions are generated, you can edit the questions and answers before saving, and -- for multiple choice questions -- select which answer should be marked as correct
Questions are always added to the default category in the course at the moment. If no default category exists, they are added to the top category.
I noticed that first url, where we enter prompt, is "localhost/blocks/openai_questions/generate.php?id=80", where ID is of course course ID. But when questions are generated on the second page (with same URL) there's no ID in the URL. After that I'm being redirected to question bank with ID in URL "localhost/question/edit.php?courseid=80", but generated questions are missing.
I have debugging enabled, but it didn't show anything useful.
Demo video:
I tested this plugin few weeks ago. GOOD JOB !
I would like to know if you have in your plans to give the possibility to ask to write the feedbacks for goods and bads answer, with a variable tone (serious, humorous, etc )
I currently ask GPT to do it and then generate a file that I can import into Moodle, but it doesn't know how to manage the questions bank like your plugin in
Thank for your reponse
Regards
J'ai installé le plugin mais je n'arrive pas à générer les questions.
Pouvez vous m'aider
Merci
I have the same problem as @Davor Budimir.
The questions are generated, but they don't end up in the question collection.
Can you help me?
Ralph
1- if you input a text in italian, the questions and answers are arriving in English, both for multiple choice and true/false
2- all the true/false questions we are getting have True as answer.
3- the short answer questions are requiring very long texts as answers and it is impossible to get it totally right.
Is there a quick fix to solve these problems?
Paula
Here is the patch file that shows modification points to solve the problem:
https://github.com/kita-toshihiro/moodle-patches/blob/main/blocks_openai_questions_moodle45_2024121400.patch
The zip file of the modified version 1.2.0 as above is
https://github.com/kita-toshihiro/moodle-patches/raw/refs/heads/main/blocks_openai_questions_moodle45_2024121400.zip
I tested it on Moodle 4.5.