From f141680cc73ca672a08c94fb6bc29242a81db93b Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:07:05 -0400 Subject: [PATCH 1/9] comment out some references to myAnalytics stream --- lib/pangea/utils/logout.dart | 4 +-- .../multiple_choice_activity.dart | 26 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/pangea/utils/logout.dart b/lib/pangea/utils/logout.dart index e2bdce074..c94cb8909 100644 --- a/lib/pangea/utils/logout.dart +++ b/lib/pangea/utils/logout.dart @@ -20,8 +20,8 @@ void pLogoutAction(BuildContext context, {bool? isDestructiveAction}) async { final matrix = Matrix.of(context); // before wiping out locally cached construct data, save it to the server - await MatrixState.pangeaController.myAnalytics - .sendLocalAnalyticsToAnalyticsRoom(); + // await MatrixState.pangeaController.myAnalytics + // .sendLocalAnalyticsToAnalyticsRoom(); await showFutureLoadingDialog( context: context, diff --git a/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart b/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart index ee892837b..3e8a9f126 100644 --- a/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart +++ b/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart @@ -2,13 +2,11 @@ import 'dart:developer'; import 'package:collection/collection.dart'; import 'package:fluffychat/pangea/choreographer/widgets/choice_array.dart'; -import 'package:fluffychat/pangea/controllers/my_analytics_controller.dart'; import 'package:fluffychat/pangea/enum/activity_type_enum.dart'; import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_model.dart'; import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_record_model.dart'; import 'package:fluffychat/pangea/widgets/practice_activity/practice_activity_card.dart'; import 'package:fluffychat/pangea/widgets/practice_activity/word_audio_button.dart'; -import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -68,18 +66,18 @@ class MultipleChoiceActivityState extends State { } // #freeze-activity - MatrixState.pangeaController.myAnalytics.setState( - AnalyticsStream( - // note - this maybe should be the activity event id - eventId: - widget.practiceCardController.widget.pangeaMessageEvent.eventId, - roomId: widget.practiceCardController.widget.pangeaMessageEvent.room.id, - constructs: currentRecordModel!.latestResponse!.toUses( - widget.practiceCardController.currentActivity!, - widget.practiceCardController.metadata, - ), - ), - ); + // MatrixState.pangeaController.myAnalytics.setState( + // AnalyticsStream( + // // note - this maybe should be the activity event id + // eventId: + // widget.practiceCardController.widget.pangeaMessageEvent.eventId, + // roomId: widget.practiceCardController.widget.pangeaMessageEvent.room.id, + // constructs: currentRecordModel!.latestResponse!.toUses( + // widget.practiceCardController.currentActivity!, + // widget.practiceCardController.metadata, + // ), + // ), + // ); // If the selected choice is correct, send the record and get the next activity if (widget.currentActivity.content.isCorrect(value, index)) { From 70d598c7b2cadfbab1f334b6c388c37f3182cf4f Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:07:25 -0400 Subject: [PATCH 2/9] bump version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 98b846ae7..444472501 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: Learn a language while texting your friends. # Pangea# publish_to: none # On version bump also increase the build number for F-Droid -version: 1.21.7+3547 +version: 1.21.8+3548 environment: sdk: ">=3.0.0 <4.0.0" From 4c51bb15f63313f424bf9e9366535b6d540a144e Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:22:04 -0400 Subject: [PATCH 3/9] turn back on analytics stream call in logout --- lib/pangea/utils/logout.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pangea/utils/logout.dart b/lib/pangea/utils/logout.dart index c94cb8909..e2bdce074 100644 --- a/lib/pangea/utils/logout.dart +++ b/lib/pangea/utils/logout.dart @@ -20,8 +20,8 @@ void pLogoutAction(BuildContext context, {bool? isDestructiveAction}) async { final matrix = Matrix.of(context); // before wiping out locally cached construct data, save it to the server - // await MatrixState.pangeaController.myAnalytics - // .sendLocalAnalyticsToAnalyticsRoom(); + await MatrixState.pangeaController.myAnalytics + .sendLocalAnalyticsToAnalyticsRoom(); await showFutureLoadingDialog( context: context, From 636fb150e8bac8e7b9f19b553a9432808a600fec Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:22:21 -0400 Subject: [PATCH 4/9] bump version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 444472501..0a45647dc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: Learn a language while texting your friends. # Pangea# publish_to: none # On version bump also increase the build number for F-Droid -version: 1.21.8+3548 +version: 1.21.9+3549 environment: sdk: ">=3.0.0 <4.0.0" From 1944c19c50f1f6356a0f71db48f81051e98eaca6 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:28:20 -0400 Subject: [PATCH 5/9] Revert "when inviting tachers to analytics room, request all particpants to ensure teacher isn't already a member" This reverts commit bc1dfc1e0e8f017c9c4032afcd4b18112042d35b. --- .../pangea_room_extension/room_analytics_extension.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/pangea/extensions/pangea_room_extension/room_analytics_extension.dart b/lib/pangea/extensions/pangea_room_extension/room_analytics_extension.dart index b44c40ece..73371b080 100644 --- a/lib/pangea/extensions/pangea_room_extension/room_analytics_extension.dart +++ b/lib/pangea/extensions/pangea_room_extension/room_analytics_extension.dart @@ -99,7 +99,7 @@ extension AnalyticsRoomExtension on Room { await analyticsRoom.requestParticipants(); } - final List participants = await analyticsRoom.requestParticipants(); + final List participants = analyticsRoom.getParticipants(); final List uninvitedTeachers = teachersLocal .where((teacher) => !participants.contains(teacher)) .toList(); @@ -110,12 +110,8 @@ extension AnalyticsRoomExtension on Room { (teacher) => analyticsRoom.invite(teacher.id).catchError((err, s) { ErrorHandler.logError( e: err, - m: "Failed to invite teacher to analytics room", + m: "Failed to invite teacher ${teacher.id} to analytics room ${analyticsRoom.id}", s: s, - data: { - "teacherId": teacher.id, - "analyticsRoomId": analyticsRoom.id, - }, ); }), ), From f6bd07400098c4a0fd9205d6ae41926af9c0ccb2 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:29:02 -0400 Subject: [PATCH 6/9] revert change to getting room participants --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0a45647dc..dba848cf1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: Learn a language while texting your friends. # Pangea# publish_to: none # On version bump also increase the build number for F-Droid -version: 1.21.9+3549 +version: 1.22.0+3550 environment: sdk: ">=3.0.0 <4.0.0" From 5b232cea69df588ca3dbec732aad4378bb8d7bc4 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:37:24 -0400 Subject: [PATCH 7/9] turn back on setState on analytics data --- .../multiple_choice_activity.dart | 26 ++++++++++--------- pubspec.yaml | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart b/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart index 3e8a9f126..ee892837b 100644 --- a/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart +++ b/lib/pangea/widgets/practice_activity/multiple_choice_activity.dart @@ -2,11 +2,13 @@ import 'dart:developer'; import 'package:collection/collection.dart'; import 'package:fluffychat/pangea/choreographer/widgets/choice_array.dart'; +import 'package:fluffychat/pangea/controllers/my_analytics_controller.dart'; import 'package:fluffychat/pangea/enum/activity_type_enum.dart'; import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_model.dart'; import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_record_model.dart'; import 'package:fluffychat/pangea/widgets/practice_activity/practice_activity_card.dart'; import 'package:fluffychat/pangea/widgets/practice_activity/word_audio_button.dart'; +import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -66,18 +68,18 @@ class MultipleChoiceActivityState extends State { } // #freeze-activity - // MatrixState.pangeaController.myAnalytics.setState( - // AnalyticsStream( - // // note - this maybe should be the activity event id - // eventId: - // widget.practiceCardController.widget.pangeaMessageEvent.eventId, - // roomId: widget.practiceCardController.widget.pangeaMessageEvent.room.id, - // constructs: currentRecordModel!.latestResponse!.toUses( - // widget.practiceCardController.currentActivity!, - // widget.practiceCardController.metadata, - // ), - // ), - // ); + MatrixState.pangeaController.myAnalytics.setState( + AnalyticsStream( + // note - this maybe should be the activity event id + eventId: + widget.practiceCardController.widget.pangeaMessageEvent.eventId, + roomId: widget.practiceCardController.widget.pangeaMessageEvent.room.id, + constructs: currentRecordModel!.latestResponse!.toUses( + widget.practiceCardController.currentActivity!, + widget.practiceCardController.metadata, + ), + ), + ); // If the selected choice is correct, send the record and get the next activity if (widget.currentActivity.content.isCorrect(value, index)) { diff --git a/pubspec.yaml b/pubspec.yaml index dba848cf1..f1b17f029 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: Learn a language while texting your friends. # Pangea# publish_to: none # On version bump also increase the build number for F-Droid -version: 1.22.0+3550 +version: 1.22.1+3551 environment: sdk: ">=3.0.0 <4.0.0" From 63cd77baf49819322ade33aa646bfd9665a192bd Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 11:58:11 -0400 Subject: [PATCH 8/9] Revert "turn off choice array animation" This reverts commit 59682599a5a6a3b5d3109cd44d1c10a512cae369. --- .../choreographer/widgets/choice_array.dart | 150 +++++++++--------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/lib/pangea/choreographer/widgets/choice_array.dart b/lib/pangea/choreographer/widgets/choice_array.dart index 549665064..32395099e 100644 --- a/lib/pangea/choreographer/widgets/choice_array.dart +++ b/lib/pangea/choreographer/widgets/choice_array.dart @@ -1,4 +1,5 @@ import 'dart:developer'; +import 'dart:math'; import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; @@ -212,99 +213,98 @@ class ChoiceAnimationWidgetState extends State with SingleTickerProviderStateMixin { late final AnimationController _controller; late final Animation _animation; - // AnimationState animationState = AnimationState.ready; + AnimationState animationState = AnimationState.ready; @override void initState() { super.initState(); - // _controller = AnimationController( - // duration: const Duration(milliseconds: 300), - // vsync: this, - // ); + _controller = AnimationController( + duration: const Duration(milliseconds: 300), + vsync: this, + ); - // _animation = widget.isGold - // ? Tween(begin: 1.0, end: 1.2).animate(_controller) - // : TweenSequence([ - // TweenSequenceItem( - // tween: Tween(begin: 0, end: -8 * pi / 180), - // weight: 1.0, - // ), - // TweenSequenceItem( - // tween: Tween(begin: -8 * pi / 180, end: 16 * pi / 180), - // weight: 2.0, - // ), - // TweenSequenceItem( - // tween: Tween(begin: 16 * pi / 180, end: 0), - // weight: 1.0, - // ), - // ]).animate(_controller); + _animation = widget.isGold + ? Tween(begin: 1.0, end: 1.2).animate(_controller) + : TweenSequence([ + TweenSequenceItem( + tween: Tween(begin: 0, end: -8 * pi / 180), + weight: 1.0, + ), + TweenSequenceItem( + tween: Tween(begin: -8 * pi / 180, end: 16 * pi / 180), + weight: 2.0, + ), + TweenSequenceItem( + tween: Tween(begin: 16 * pi / 180, end: 0), + weight: 1.0, + ), + ]).animate(_controller); widget.enableInteraction(); - // if (widget.selected && animationState == AnimationState.ready) { - // widget.disableInteraction(); - // _controller.forward(); - // setState(() { - // animationState = AnimationState.forward; - // }); - // } - // _controller.addStatusListener((status) { - // if (status == AnimationStatus.completed && - // animationState == AnimationState.forward) { - // _controller.reverse(); - // setState(() { - // animationState = AnimationState.reverse; - // }); - // } - // if (status == AnimationStatus.dismissed && - // animationState == AnimationState.reverse) { - // widget.enableInteraction(); - // setState(() { - // animationState = AnimationState.finished; - // }); - // } - // }); + if (widget.selected && animationState == AnimationState.ready) { + widget.disableInteraction(); + _controller.forward(); + setState(() { + animationState = AnimationState.forward; + }); + } + _controller.addStatusListener((status) { + if (status == AnimationStatus.completed && + animationState == AnimationState.forward) { + _controller.reverse(); + setState(() { + animationState = AnimationState.reverse; + }); + } + if (status == AnimationStatus.dismissed && + animationState == AnimationState.reverse) { + widget.enableInteraction(); + setState(() { + animationState = AnimationState.finished; + }); + } + }); } @override void didUpdateWidget(ChoiceAnimationWidget oldWidget) { super.didUpdateWidget(oldWidget); - // if (widget.selected && animationState == AnimationState.ready) { - // widget.disableInteraction(); - // _controller.forward(); - // setState(() { - // animationState = AnimationState.forward; - // }); - // } + if (widget.selected && animationState == AnimationState.ready) { + widget.disableInteraction(); + _controller.forward(); + setState(() { + animationState = AnimationState.forward; + }); + } } @override Widget build(BuildContext context) { - return widget.child; - // widget.isGold - // ? AnimatedBuilder( - // key: UniqueKey(), - // animation: _animation, - // builder: (context, child) { - // return Transform.scale( - // scale: _animation.value, - // child: child, - // ); - // }, - // child: widget.child, - // ) - // : AnimatedBuilder( - // key: UniqueKey(), - // animation: _animation, - // builder: (context, child) { - // return Transform.rotate( - // angle: _animation.value, - // child: child, - // ); - // }, - // child: widget.child, - // ); + return widget.isGold + ? AnimatedBuilder( + key: UniqueKey(), + animation: _animation, + builder: (context, child) { + return Transform.scale( + scale: _animation.value, + child: child, + ); + }, + child: widget.child, + ) + : AnimatedBuilder( + key: UniqueKey(), + animation: _animation, + builder: (context, child) { + return Transform.rotate( + angle: _animation.value, + child: child, + ); + }, + child: widget.child, + ); } @override From 6052e1618981b7fcc0f87f2412331df36fcbe75c Mon Sep 17 00:00:00 2001 From: ggurdin Date: Thu, 24 Oct 2024 12:01:05 -0400 Subject: [PATCH 9/9] bump version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index f1b17f029..10b124acf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: Learn a language while texting your friends. # Pangea# publish_to: none # On version bump also increase the build number for F-Droid -version: 1.22.1+3551 +version: 1.22.2+3552 environment: sdk: ">=3.0.0 <4.0.0"