From f486269ee14f7c8829584e03151a971bd44393bc Mon Sep 17 00:00:00 2001 From: Ava Shilling <165050625+avashilling@users.noreply.github.com> Date: Wed, 28 Jan 2026 15:39:38 -0500 Subject: [PATCH] chore: don't give normalization errors or single choices --- .../analytics_practice_session_repo.dart | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/pangea/analytics_practice/analytics_practice_session_repo.dart b/lib/pangea/analytics_practice/analytics_practice_session_repo.dart index 9117c0d16..c12b82d3c 100644 --- a/lib/pangea/analytics_practice/analytics_practice_session_repo.dart +++ b/lib/pangea/analytics_practice/analytics_practice_session_repo.dart @@ -159,7 +159,8 @@ class AnalyticsPracticeSessionRepo { if (feature == MorphFeaturesEnum.Unknown || feature == MorphFeaturesEnum.Poss || feature == MorphFeaturesEnum.Reflex || - feature == MorphFeaturesEnum.PrepCase) { + feature == MorphFeaturesEnum.PrepCase || + feature == MorphFeaturesEnum.NumType) { continue; } @@ -281,7 +282,11 @@ class AnalyticsPracticeSessionRepo { if (igcMatch!.match.offset == 0 && igcMatch.match.length >= stepText.trim().characters.length) { - // Skip if the grammar error spans the entire step + continue; + } + + if (igcMatch.match.isNormalizationError()) { + // Skip normalization errors continue; } @@ -296,9 +301,10 @@ class AnalyticsPracticeSessionRepo { ) .toList(); - // Skip if no valid tokens found for this grammar error - if (choiceTokens.isEmpty) continue; - + // Skip if no valid tokens found for this grammar error, or only one answer + if (choiceTokens.length <= 1) { + continue; + } String? translation; try { translation = await event.requestRespresentationByL1();