remove use of record

pull/1402/head
William Jordan-Cooley 1 year ago
parent 9680662c1b
commit 1bd244011f

@ -93,24 +93,24 @@ class MessagePracticeActivityCardState extends State<PracticeActivityCard> {
/// If not, get a new activity from the server.
Future<void> initialize() async {
_setPracticeActivity(
_fetchExistingIncompleteActivity() ?? await _fetchNewActivity(),
await _fetchNewActivity(),
);
}
// if the user did the activity before but awhile ago and we don't have any
// more target tokens, maybe we should give them the same activity again
PracticeActivityEvent? _fetchExistingIncompleteActivity() {
if (practiceActivities.isEmpty) {
return null;
}
// PracticeActivityEvent? _fetchExistingIncompleteActivity() {
// if (practiceActivities.isEmpty) {
// return null;
// }
final List<PracticeActivityEvent> incompleteActivities =
practiceActivities.where((element) => !element.isComplete).toList();
// final List<PracticeActivityEvent> incompleteActivities =
// practiceActivities.where((element) => !element.isComplete).toList();
// TODO - maybe check the user's xp for the tgtConstructs and decide if its relevant for them
// however, maybe we'd like to go ahead and give them the activity to get some data on our xp?
return incompleteActivities.firstOrNull;
}
// // TODO - maybe check the user's xp for the tgtConstructs and decide if its relevant for them
// // however, maybe we'd like to go ahead and give them the activity to get some data on our xp?
// return incompleteActivities.firstOrNull;
// }
Future<PracticeActivityEvent?> _fetchNewActivity([
ActivityQualityFeedback? activityFeedback,
@ -213,19 +213,19 @@ class MessagePracticeActivityCardState extends State<PracticeActivityCard> {
// save the record without awaiting to avoid blocking the UI
// send a copy of the activity record to make sure its not overwritten by
// the new activity
MatrixState.pangeaController.activityRecordController
.send(currentCompletionRecord!, currentActivity!)
.catchError(
(e, s) => ErrorHandler.logError(
e: e,
s: s,
m: 'Failed to save record',
data: {
'record': currentCompletionRecord?.toJson(),
'activity': currentActivity?.practiceActivity.toJson(),
},
),
);
// MatrixState.pangeaController.activityRecordController
// .send(currentCompletionRecord!, currentActivity!)
// .catchError(
// (e, s) => ErrorHandler.logError(
// e: e,
// s: s,
// m: 'Failed to save record',
// data: {
// 'record': currentCompletionRecord?.toJson(),
// 'activity': currentActivity?.practiceActivity.toJson(),
// },
// ),
// );
widget.overlayController.onActivityFinish();

Loading…
Cancel
Save