diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index ba8b966ac..ee8a47944 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -5298,5 +5298,6 @@ "directMessageBotDesc": "Talking to humans is more fun but... AI is always ready!", "inviteYourFriends": "Invite your friends", "playWithAI": "Play with AI for now", - "courseStartDesc": "Pangea Bot is ready to go anytime!\n\n...but learning is better with friends!" + "courseStartDesc": "Pangea Bot is ready to go anytime!\n\n...but learning is better with friends!", + "activityDropdownDesc": "When you’re done with this activity, click below" } diff --git a/lib/pangea/activity_sessions/activity_session_chat/activity_stats_menu.dart b/lib/pangea/activity_sessions/activity_session_chat/activity_stats_menu.dart index b724842d0..d089dc8bf 100644 --- a/lib/pangea/activity_sessions/activity_session_chat/activity_stats_menu.dart +++ b/lib/pangea/activity_sessions/activity_session_chat/activity_stats_menu.dart @@ -62,18 +62,9 @@ class ActivityStatsMenuState extends State { Set? get _usedVocab => analytics?.constructs[room.client.userID!] ?.constructsOfType(ConstructTypeEnum.vocab) - .map((id) => id.lemma) + .map((id) => id.lemma.toLowerCase()) .toSet(); - double get _percentVocabComplete { - final vocabList = room.activityPlan?.vocab.map((v) => v.lemma) ?? []; - if (vocabList.isEmpty || _usedVocab == null) { - return 0; - } - return _usedVocab!.intersection(vocabList.toSet()).length / - vocabList.length; - } - Future _updateUsedVocab() async { final analytics = await room.getActivityAnalytics(); if (mounted) { @@ -139,7 +130,6 @@ class ActivityStatsMenuState extends State { final bool activityComplete = room.activityIsFinished; bool shouldShowEndForAll = true; bool shouldShowImDone = true; - String message = ""; if (!room.isRoomAdmin) { shouldShowEndForAll = false; @@ -154,34 +144,6 @@ class ActivityStatsMenuState extends State { //activity is finished, no buttons shouldShowImDone = false; shouldShowEndForAll = false; - message = L10n.of(context).activityComplete; - } else { - //activity is ongoing - if (_getCompletedRolesCount() == 0 || - (_getAssignedRolesCount() == 1) && (_isBotParticipant() == true)) { - //IF nobodys done or you're only playing with the bot, - //Then it should show tips about your progress and nudge you to continue/end - if ((_percentVocabComplete < .7) && (_usedVocab?.length ?? 0) < 50) { - message = L10n.of(context).haventChattedMuch; - } else { - message = L10n.of(context).haveChatted; - } - } else { - //user is in group with other users OR someone has wrapped up - if (userComplete) { - //user is done but group is ongoing, no buttons - message = L10n.of(context).userDoneAndWaiting( - _getCompletedRolesCount(), - _getAssignedRolesCount(), - ); - } else { - //user is not done, buttons are present - message = L10n.of(context).othersDoneAndWaiting( - _getCompletedRolesCount(), - _getAssignedRolesCount(), - ); - } - } } return Positioned( @@ -237,8 +199,8 @@ class ActivityStatsMenuState extends State { vocab: v, langCode: room.activityPlan!.req.targetLanguage, - isUsed: - (_usedVocab ?? {}).contains(v.lemma), + isUsed: (_usedVocab ?? {}) + .contains(v.lemma.toLowerCase()), ), ), ], @@ -247,7 +209,7 @@ class ActivityStatsMenuState extends State { ], ), Text( - message, + L10n.of(context).activityDropdownDesc, textAlign: TextAlign.center, style: const TextStyle( fontSize: 16.0,