OpenAI Question Generator

Blocks ::: block_openai_questions
Maintained by Bryce Yoder
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.
Latest release:
270 sites
167 downloads
21 fans
Current versions available: 2

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.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Bryce Yoder (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Тафсирҳо инъикос карда шаванд
  • Bryce Yoder
    Сшб 19 Дек 2023, 01:01
    Hi Davor, I haven't been able to reproduce this on Moodle 4.3. Can you open an issue on the GitHub repo and include your browser and version? Additionally, if possible, it would be helpful to include your network log and especially the response from the api/question.php endpoint. Finally, make sure that the questions aren't being added to a different question category -- please check the default and top categories for the course.
  • Brandom Martinez
    Сшб 19 Дек 2023, 05:51
    This plugin works with Spanish text?
  • Jean-Marc Doucet
    Ҷмъ 2 Фев 2024, 05:28
    Hi @Bryce,
    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
  • Mohamed ali nahali
    Ҷмъ 15 Мар 2024, 01:27
    Bonjour
    J'ai installé le plugin mais je n'arrive pas à générer les questions.
    Pouvez vous m'aider
    Merci
  • Ralph Ballier
    Дшб 15 Апр 2024, 02:10
    Hi Bryce,

    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
  • Ralph Ballier
    Дшб 22 Апр 2024, 19:12
    I found the questions: they are in the "top" ("Oberste" in german) one, but that doesn't seem to be the right place.
  • Merlin Chan
    Чшб 24 Апр 2024, 14:14
    Thanks Bryce Yoder! Such a great plugins! We already installed the OpenAI Chat Block in our platform with Azure OpenAI API, and want to adopt this one too. Can this block_openai_questions support Azure OpenAI API too?
  • paula de waal
    Сшб 3 Сен 2024, 02:27
    Hi! I like a lot the idea of selecting the outputs before sending them to the question bank. There are only 3 problem for us (gpt4):
    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
  • Dr. Nellie Deutsch
    Чшб 23 Окт 2024, 02:51
    Is it compatible with Moodle 4.5?
  • Toshihiro KITA
    Шнб 14 Дек 2024, 00:40
    I tested the ver. 1.2.0 and found it did not work in the case wwwroot is like https://foo.bar/moodle (not like https://foor.bar).
    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.
  • Al
    Дшб 5 Май 2025, 06:59
    Hi
    Please can you change your supported version to moodle 4.5 or 5, so that when we install moodle each week, it auto installs, this would save a lot of time. Thank you.
  • Dr. Nellie Deutsch
    Дшб 5 Май 2025, 13:36
    I presume it's not compatible with Moodle V5. Please correct me if I'm wrong.
  • Al
    Дшб 19 Май 2025, 05:47
    Hi Guys, if you could bump the version supported number to 4.5 it would be much appreciated, as it will then install automatically when we upgrade. Sorry to nag you, thank you.
  • Al
    Пшб 7 Авг 2025, 04:30
    Hi
    I hope you are well, it's been ages. Block Open AI appears to work on Moodle 5. Could you update the supported extension on your end to Moodle 5 so that it installs automatically each week when we update our Moodle instance? It saves us so much time. Cheers.
  • Devin Black
    Ҷмъ 22 Авг 2025, 17:26
    I am getting an error: "openai_questions/generate.php was not found on this server". What am I missing?
1 2
Please login to post comments