Implement question pools that vary together for coordinated multi-question scenarios #70
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 implements the ability for question pools in quizzes to "vary together" based on a shared group identifier, enabling multi-question scenarios that span related pools.
Problem
Previously, question pools were completely independent. This made it impossible to create scenarios where:
Solution
Added support for an optional
groupfield in question pools. Pools sharing the same group name will use identical seeds for question selection, ensuring their random choices are coordinated.Key Features:
Grouped Pool Coordination:
{ "pools": [ { "name": "CodeDisplayPool", "questions": ["CodeA", "CodeB", "CodeC"], "amount": 1, "group": "scenario1" }, { "name": "AnalysisPool", "questions": ["AnalysisA", "AnalysisB", "AnalysisC"], "amount": 1, "group": "scenario1" } ] }Students who receive "CodeA" will always receive "AnalysisA", ensuring questions make contextual sense together.
Backward Compatibility:
groupfield continue to work exactly as beforeMultiple Groups:
A single quiz can have multiple independent groups of coordinated pools, plus individual pools that remain independent.
Implementation Details
hidePoolsGroups(): New method that groups pools by theirgroupfield and applies the same seed to pools in the same grouphidePools(): Updated to automatically detect when groups are present and use the appropriate logichashString(): Helper method for consistent group-based seed generationgroupfieldThe implementation uses the existing random selection utilities and maintains all current pool randomness modes (SEED, ATTEMPT, NONE).
Fixes #69.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.