feat(GenerateMcqMrqQuestion): add generate MCQ/MRQ questions with AI #8019
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new feature for generating multiple-choice (MCQ) and multiple-response (MRQ) questions using a language model (LLM), along with associated updates to the backend and frontend to support this functionality.
Frontend Enhancements for Question Generation:
GenerateMcqMrqQuestionPage.tsx
to allow users to generate both MCQ and MRQ question in a similar page layout.GenerateMcqMrqExportDialog.tsx
for users to easily confirm question details before exporting.Backend Enhancements for Question Generation:
generate
action inapp/controllers/course/assessment/question/multiple_responses_controller.rb
to handle question generation requests, validate parameters, and return formatted responses.Course::Assessment::Question::MrqGenerationService
to encapsulate the logic for generating MCQ/MRQ questions using LLM prompts and parsing responses.API and Frontend Updates:
create
andupdate
methods inMcqMrqAPI
to return aRedirectWithEditUrl
object, which includes both a redirect URL and an optional edit URL.generate
method inMcqMrqAPI
to call the backend'sgenerate
action for question generation.GenerateTabs
component in the frontend to improve UI responsiveness and display metadata for generated questions.Controller Improvements:
create
andupdate
actions inapp/controllers/course/assessment/question/multiple_responses_controller.rb
to includeredirectEditUrl
in the JSON response for easier navigation to the edit page.View Enhancements:
show.json.jbuilder
to include URLs for generating MCQ and MRQ questions in the assessment view._question_assessment.json.jbuilder
.