chore: use activity IDs from the choreo response (#3706)
This commit is contained in:
parent
f5a2d1114b
commit
9e190d483a
4 changed files with 7 additions and 4 deletions
|
|
@ -221,6 +221,7 @@ class ActivityGeneratorState extends State<ActivityGenerator> {
|
|||
vocab: activity.vocab,
|
||||
imageURL: imageUrl,
|
||||
roles: activity.roles,
|
||||
bookmarkId: activity.bookmarkId,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,13 +21,12 @@ class ActivityPlanModel {
|
|||
required this.learningObjective,
|
||||
required this.instructions,
|
||||
required this.vocab,
|
||||
required this.bookmarkId,
|
||||
Map<String, ActivityRole>? roles,
|
||||
this.imageURL,
|
||||
this.endAt,
|
||||
this.duration,
|
||||
}) : bookmarkId =
|
||||
"${title.hashCode ^ learningObjective.hashCode ^ instructions.hashCode ^ imageURL.hashCode ^ vocab.map((v) => v.hashCode).reduce((a, b) => a ^ b)}",
|
||||
_roles = roles;
|
||||
}) : _roles = roles;
|
||||
|
||||
Map<String, ActivityRole> get roles {
|
||||
if (_roles != null) return _roles!;
|
||||
|
|
@ -62,6 +61,7 @@ class ActivityPlanModel {
|
|||
endAt: endAt ?? this.endAt,
|
||||
duration: duration ?? this.duration,
|
||||
roles: roles ?? _roles,
|
||||
bookmarkId: bookmarkId,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -102,6 +102,7 @@ class ActivityPlanModel {
|
|||
)
|
||||
: null,
|
||||
roles: roles,
|
||||
bookmarkId: json[ModelKey.activityPlanBookmarkId],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ class ActivityPlannerBuilderState extends State<ActivityPlannerBuilder> {
|
|||
vocab: vocab,
|
||||
imageURL: imageURL,
|
||||
roles: widget.initialActivity.roles,
|
||||
bookmarkId: widget.initialActivity.bookmarkId,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class ModelKey {
|
|||
static const String activityPlanInstructions = "instructions";
|
||||
static const String activityPlanVocab = "vocab";
|
||||
static const String activityPlanImageURL = "image_url";
|
||||
static const String activityPlanBookmarkId = "bookmark_id";
|
||||
static const String activityPlanBookmarkId = "activity_id";
|
||||
static const String activityPlanEndAt = "end_at";
|
||||
static const String activityPlanDuration = "duration";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue