Generative AI Question Bank

Question bank plugins ::: qbank_genai
Maintained by Christian GREVISSE
Automatic LLM-based generation of multiple choice questions based on files stored in a Moodle course.
Latest release:
126 sites
205 downloads
17 fans
Current versions available: 1

This Moodle plugin allows to generate multiple choice questions based on the content of a course (essentially Files) through an underlying Large Language Model (LLM) such as GPT. The generated questions are added to the question bank of the course and can of course be edited by a human afterwards and added to a quiz.

An OpenAI API key is required and can be set in the plugin settings in the Site Administration or in a course. The usage of OpenAI's API will generate costs. Users of this plugin are solely responsible for any generated cost and should closely monitor their usage!

Minimum PHP version: 8.1

Potential privacy issues

Content selected by the user is sent to a third-party LLM. In particular, selected resource files will be sent from Moodle to OpenAI for processing in the Assistants API.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7

Contributors

Christian GREVISSE (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Christian GREVISSE
    Tue, 29 Oct 2024, 10:33 PM
    Dear Joanna,

    Sorry to hear about these issues, which indeed go beyond this plugin. I have noticed this behavior of the Assistants API of OpenAI not being able to extract file content with some of my test files as well, but wasn't able so far to determine a pattern. Have you tried maybe to export your file to a different file format? Let's hope this will be solved by OpenAI themselves, though.

    As for the failed tasks, the Moodle documentation states that "The task will be retried after 1 minute. If the task keeps failing, the retry algorithm will add more time between each successive attempts up to a max of 24 hours.". I believe there is currently no way in Moodle to remove failed adhoc tasks from the queue unless going through a database manipulation, but I might be wrong.

    I will try to remove the superfluous empty question categories in case of a failure in an upcoming release.

    Best,

    Christian
  • Mizuki Katayama
    Mon, 11 Nov 2024, 2:47 PM
    I tried generating questions from the Japanese PDF, and all the questions that were generated were in English.
    Are there any plans to add Japanese support in the future?
    I think there is a lot of demand for it in Japan too.

    Thanks,
    Mizuki
  • Christian GREVISSE
    Tue, 12 Nov 2024, 4:57 AM
    Dear Mizuki,

    Thanks for pointing this out! This is something that could be adjusted in the prompt. I plan on having user-editable prompts in upcoming releases.

    Best,

    Christian
  • Adren Fu
    Wed, 13 Nov 2024, 2:12 PM
    does this plugin work for Course format in quiz mode?
  • Nicolay Adamchuk
    Fri, 13 Dec 2024, 5:42 PM
    Hi Christian,
    The plugin was installed and launched. However, after clicking the Generate Questions button, it returns to its original position. For a moment (and then immediately disappears) I noticed the message "This page should automatically redirect. If notting is happening please use the continue link below". It is impossible to click CONTINUE. The message disappears.
    Help solve the problem, please.
    Moodle version 4.5, plugin version 0.1.4

  • Christian GREVISSE
    Sun, 15 Dec 2024, 1:53 AM
    Dear Adren,

    I'm not quite sure what you mean.

    Dear Nicolay,

    I'm unable to reproduce your issue. Could you please open a ticket on the GitHub repository?

    Best,

    Christian
  • Nicolay Adamchuk
    Sun, 15 Dec 2024, 3:15 PM
    Hi,
    Sorry, but I'm not a developer and I don't use GitHub (in this case). I'm just a user. Please watch the video (by reference).

    https://drive.google.com/file/d/10Z0QKa8c1ei9zxK7PIMHqZbfFUCCRNcC/view?usp=sharing

    Best regards,
    Nicolay
  • Christian GREVISSE
    Sun, 15 Dec 2024, 7:48 PM
    Hi Nicolay,

    Thank you for the video. The shown behavior is normal. Once the ongoing background tasks are done, questions should appear in a new dedicated category in the question bank of your course.

    What surprises me is that you still have ongoing tasks from 2 days ago. Check in the ad-hoc tasks / ongoing tasks / task log in the site administration for errors. Did you set an OpenAI API key ?

    Best,

    Christian
  • Nicolay Adamchuk
    Mon, 16 Dec 2024, 4:03 PM
    Hi, Christian
    Yes, indeed. There was an error in the key. Thanks for your help.

    I would like to clarify:
    the plugin uses only the resource file?
    file format - only doc (docx)?
    pdf and txt are not supported?
    by default 10 questions are created (type multiple choice)?

    Best regards,
    Nicolay
  • Christian GREVISSE
    Mon, 16 Dec 2024, 4:52 PM
    Hi Nicolay,

    Supported file formats of OpenAI's Assistant API can be found here: https://platform.openai.com/docs/assistants/tools/file-search#supported-files

    The prompt is for the moment hard-coded and produces 10 questions by default. In upcoming versions of the plugin, the prompt will become adaptable.

    Best,

    Christian
  • siming xia
    Tue, 21 Jan 2025, 12:32 AM
    Can this plugin support calling other big language models?
  • Christian GREVISSE
    Tue, 21 Jan 2025, 2:12 AM
    Hi Siming,

    For the moment, it is limited to OpenAI's API, using GPT-4o.

    Best,

    Christian
  • Julian Ridden
    Thu, 17 Apr 2025, 11:08 AM
    Trying this in a clean Moodle 5 install and fear I may be jumping the gun.

    Getting the error: Adhoc task failed: qbank_genai\task\generation_task,Error writing to database

    Any ideas?
  • Christian GREVISSE
    Sun, 20 Apr 2025, 4:55 AM
    Dear Julian,

    Thank you for raising this point! Indeed, an adaptation was needed regarding the feature of shared question banks introduced in Moodle 5.0. Let me know if this works for you.

    Best,

    Christian
  • Elavarasan MS
    Wed, 23 Apr 2025, 5:02 PM
    Hi Christian,
    The "qbank_genai“ Plugin is not functioning as expected in Moodle 4.5.2.

    Steps to Reproduce:
    01. Log in to Moodle v4.5.2.
    02. Select any existing course.
    03. Enable "Edit Mode."
    04. Click "Add an activity or resource."
    05. Choose the "File" option, update the necessary details, and upload a file (e.g., text.pdf).
    06. Click "Save and display."
    07. Disable "Edit Mode."
    08. Within the course, select the "More” Dropdown and choose "Generate Questions."
    09. Select the uploaded file and click "Generate Questions." button


    Issue:
    1. The status shows "The following generation tasks are ongoing" indefinitely and never completes.
    2. Upon checking, the status indicates "error" with 9 tasks failing.
    3. Only option is delete the record via database system.
    DELETE FROM mdl_task_adhoc WHERE id=80;

    Note: Verified the OpenAI API key and have sufficient fund so no issues on the API keys.

    Logs:
    Please find the detailed logs attached for your review and guidance.

    Details
    Fail delay: 1 day - Remove temporary write access from controlled links (repository_onedrive\remove_temp_access_task)
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 11
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 12
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 13
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 17
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 18
    Fail delay: 1 day - mod_forum\task\send_user_notifications ID = 19

    Thanks
1 2
Please login to post comments