generate question types for each lo and manually choose question type… - #91
Open
graceQUE03 wants to merge 6 commits into
Open
generate question types for each lo and manually choose question type…#91graceQUE03 wants to merge 6 commits into
graceQUE03 wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bloom-level question type selection
Lets instructors control, per Bloom's Taxonomy level on a granular learning objective, which question type(s) get generated and how many of each, instead of the previous single "total question count" per objective with the type resolved implicitly from a course-wide Bloom→type preference.
Summary
On the Question Generation → Create Objectives step, each granular objective's Bloom chips (Remember, Understand, Apply, Analyze, Evaluate, Create) now expand into a per-type breakdown when clicked: Multiple Choice, Fill-in-the-Blank, Calculation, Open-Ended, each with its own
-/count/+stepper. The AI objective-generation pipeline also proposes an initial breakdown per Bloom level, which the instructor can review and adjust before generating questions.UI changes
client/src/pages/question-generation/BloomTypePanel.jsx(new): the per-Bloom-level type breakdown panel. Renders the four question types horizontally, each with its own count stepper (max 3 per type).ObjectiveGroupCard.jsx: clicking a selected Bloom chip now opens/ closes itsBloomTypePanelinstead of deselecting the level. Multiple panels can be open at once, stacking in the order they were opened. A small×on the chip removes the level (replacing the old click-to-deselect). Once an item has any per-type counts, its total "Questions" count becomes a derived, read-only badge instead of the old manual stepper.ObjectivesStep.jsx: newremoveBloomChip(level removal, prunes its type counts) andchangeTypeCount(per bloomLevel/questionType count, recomputes the item's derived total) state functions. Loads/saves the newquestionTypesfield alongsidebloomTaxonomieswherever granular objectives are read from or written to the API.QuestionGeneration.jsx:validateStep1now also blocks advancing if a selected Bloom level has a type breakdown with a zero total.AIGenerateModal.jsx: passes the AI's suggestedquestionTypesthrough when saving a generated objective.Backward compatible by default: granular objectives with no `questionTypes (anything created before this change) keep rendering with the original single "Questions" stepper.
Data model
New field
questionTypeson a granular objective, added alongside the existingbloomTaxonomiesarray (not replacing it) — a flat array of{ bloomLevel, questionType, count }triples:{ "text": "Explain the role of enzymes in catalysis.", "bloomTaxonomies": ["Understand", "Apply"], "questionTypes": [ { "bloomLevel": "Understand", "questionType": "multiple-choice", "count": 2 }, { "bloomLevel": "Apply", "questionType": "calculation", "count": 1 } ] }A flat array (rather than an object keyed by Bloom level) was chosen because it maps directly onto JSON Schema structured output and is trivial to validate/group client-side.
Backend changes
src/constants/llm-schemas.js:OBJECTIVES_SCHEMAgainsquestionTypeson each granular objective (enum-constrainedbloomLevelandquestionType,count1–3).src/constants/app-constants.js— both objective-generation prompts (OBJECTIVE_GENERATION_AUTO_PROMPT,OBJECTIVE_GENERATION_MANUAL_PROMPT) gained an instruction + guidance table asking the model to recommend question type(s) and counts per Bloom level, plus a matching self-check.src/controllers/rag-llm.js(generateLearningObjectivesHandler): cleans/validates the LLM'squestionTypesoutput (drops entries with an invalid bloom level or type; any Bloom level left with none gets a default type via the existingDEFAULT_BLOOM_TYPE_PREFERENCES, so the UI never shows an empty breakdown for a selected level).src/services/objective.js:createObjective/updateObjectivepersistquestionTypeson the granular objective document (Mongo,grasp_objectivecollection), same treatment asbloomTaxonomies.Wiring into actual question generation
generateQuestionsWithRagHandler(POST /api/rag-llm/generate-questions-with-rag) now accepts an optionalquestionTypesarray. When present, it expands the triples into an explicit(bloomLevel, questionType)work list, and replaces the old "round-robin Bloom levels for N questions, resolve type via course preference" logic for that request. When absent, generation falls back to the previous behavior unchanged.client/src/pages/question-generation/generationApi.js(generateQuestions) passes a granular item'squestionTypesthrough when present.sample response from LLM