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:
117 sites
204 downloads
9 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

Show comments
  • Plugins bot
    Sat, 10 June 2023, 5:10 AM
    Approval issue created: CONTRIB-9301
  • Davor Budimir
    Mon, 18 Dec 2023, 10:23 PM
    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:
  • Bryce Yoder
    Tue, 19 Dec 2023, 1:01 AM
    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, 5:51 AM
    This plugin works with Spanish text?
  • Jean-Marc Doucet
    Fri, 2 Feb 2024, 5:28 AM
    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 wink
    Thank for your reponse
    Regards
  • Mohamed ali nahali
    Fri, 15 Mar 2024, 1:27 AM
    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, 2:10 AM
    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, 7:12 PM
    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, 2:14 PM
    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?
Please login to post comments