Skip to content

Test helper: MakeAttempt does not set DifficultyWeight, masking 1.5× Text weighting #199

@davidortinau

Description

@davidortinau

Background

Surfaced during work on #191 (Wash's vocab-quiz scoring fix, PR #198).

The bug

The test helper MakeAttempt in our vocabulary progress test fixtures (e.g., MasteryAlgorithmIntegrationTests.cs, MultiDayLearningJourneyTests.cs, VocabularyProgressServiceTests.cs) does not set DifficultyWeight on the attempt object. As a result, production defaults the weight to 1.0f for both MC (recognition) and Text (production) attempts.

In production code, MC attempts use weight 1.0f and Text attempts use weight 1.5f (production-recall bonus, lines ~138–144 of VocabularyProgressService.cs).

Why this matters

Tests using MakeAttempt(WasCorrect: true, IsTextEntry: true) do NOT exercise the 1.5× weighting that real Text attempts trigger in production. That means:

  • Tests systematically underestimate streak growth from text-entry attempts (1.0× instead of 1.5×).
  • During Latter quiz rounds rapidly empty #191's fix, Wash had to pad Tier 1 fixtures from 7 MC + 2 Text to 8 MC + 2 Text because the test was producing mastery = 10/12 = 0.833 instead of the production-equivalent 10.5/12 = 0.875 (just shy of the 0.85 IsKnown floor under divisor 12).

Proposed fix

Either:

  1. Make MakeAttempt mirror production's weight defaults: DifficultyWeight = IsTextEntry ? 1.5f : 1.0f.
  2. OR pull the weight from the same source-of-truth constant the production code uses (preferred — single source).

Then revert the 7→8 MC padding in #191's fixtures (PR #198) since the original numbers will reflect production weights once the helper is fixed.

Acceptance

Cross-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions