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:
260 sites
171 downloads
20 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

Amuishar los comentaris
  • Plugins bot
    Sat 10 Jun 2023, 05:10
    Approval issue created: CONTRIB-9301
  • Davor Budimir
    Mon 18 Dec 2023, 22:23
    Hi there. I just installed plugin and generated questions are not being added to the question bank. I'm using plugin 1.2.0 (2023121500) and Moodle 4.3.1 on my localhost Moodle test environment.

    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:
    Lector vidèo es a cargar.
    Durada passada 0:00
    Durada 0:00
    Cargat: 0%
    Tipe de difusion DIRÈCTE
    Temps restant 0:00
     
    1x
    • Capítols
    • descripcions desactivadas, seleccionat
    • captions and subtitles off, seleccionat
    • Bryce Yoder
      Tue 19 Dec 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
      Tue 19 Dec 2023, 05:51
      This plugin works with Spanish text?
    • Jean-Marc Doucet
      Fri 2 Feb 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 clinhada
      Thank for your reponse
      Regards
    • Mohamed ali nahali
      Fri 15 Mar 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
      Mon 15 Apr 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
      Mon 22 Apr 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
      Wed 24 Apr 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
      Tue 3 Sep 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
      Wed 23 Oct 2024, 02:51
      Is it compatible with Moodle 4.5?
    • Toshihiro KITA
      Sat 14 Dec 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
      Mon 5 May 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
      Mon 5 May 2025, 13:36
      I presume it's not compatible with Moodle V5. Please correct me if I'm wrong.
    • Al
      Mon 19 May 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.
    Please login to post comments