bring back set analytics in updateChoice
This commit is contained in:
parent
6265d6636d
commit
6d7ef49d91
3 changed files with 18 additions and 18 deletions
|
|
@ -187,10 +187,10 @@ class PracticeActivityModel {
|
|||
// moving from multiple_choice to content as the key
|
||||
// this is to make the model more generic
|
||||
// here for backward compatibility
|
||||
final Map<String, dynamic>? content =
|
||||
final Map<String, dynamic>? contentMap =
|
||||
(json['content'] ?? json["multiple_choice"]) as Map<String, dynamic>?;
|
||||
|
||||
if (content == null) {
|
||||
if (contentMap == null) {
|
||||
Sentry.addBreadcrumb(
|
||||
Breadcrumb(data: {"json": json}),
|
||||
);
|
||||
|
|
@ -211,9 +211,7 @@ class PracticeActivityModel {
|
|||
e.string == json['activity_type'] as String ||
|
||||
e.string.split('.').last == json['activity_type'] as String,
|
||||
),
|
||||
content: ActivityContent.fromJson(
|
||||
content,
|
||||
),
|
||||
content: ActivityContent.fromJson(contentMap),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<MultipleChoiceActivity> {
|
|||
}
|
||||
|
||||
// #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)) {
|
||||
|
|
|
|||
|
|
@ -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.5+3544
|
||||
version: 1.21.5+3545
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue