Skip to content

Conversation

Copy link

Copilot AI commented Aug 31, 2025

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:

  • One pool shows a code block to students
  • Another pool asks follow-up questions about that same code block
  • The questions needed to be coordinated (if student gets Code A, they should get Analysis questions for Code A)

Solution

Added support for an optional group field 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:

  • Pools without a group field continue to work exactly as before
  • No changes needed to existing quizzes
  • Automatic detection - no configuration required

Multiple 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 their group field and applies the same seed to pools in the same group
  • hidePools(): Updated to automatically detect when groups are present and use the appropriate logic
  • hashString(): Helper method for consistent group-based seed generation
  • Documentation: Updated quiz schema to explain the new group field

The 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.

Copilot AI and others added 2 commits August 31, 2025 13:09
Co-authored-by: acbart <897227+acbart@users.noreply.github.com>
Co-authored-by: acbart <897227+acbart@users.noreply.github.com>
Copilot AI changed the title [WIP] Question pools that vary together Implement question pools that vary together for coordinated multi-question scenarios Aug 31, 2025
Copilot AI requested a review from acbart August 31, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question pools that vary together

2 participants