From 9d8aadfe9e371a77ac1eab27f656c6e9ca20e1d9 Mon Sep 17 00:00:00 2001 From: Eunoia <33084435+Eunoia1729@users.noreply.github.com> Date: Wed, 20 Apr 2022 08:01:47 +0000 Subject: [PATCH] feat: include storybook-title column during event export --- .../elimu/analytics/entity/StoryBookLearningEvent.java | 9 +++++++++ .../receiver/StoryBookLearningEventReceiver.java | 2 +- .../ai/elimu/analytics/task/ExportEventsToCsvWorker.java | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ai/elimu/analytics/entity/StoryBookLearningEvent.java b/app/src/main/java/ai/elimu/analytics/entity/StoryBookLearningEvent.java index 6a95c16..9e48de6 100644 --- a/app/src/main/java/ai/elimu/analytics/entity/StoryBookLearningEvent.java +++ b/app/src/main/java/ai/elimu/analytics/entity/StoryBookLearningEvent.java @@ -10,6 +10,7 @@ public class StoryBookLearningEvent extends LearningEvent { @NonNull private Long storyBookId; + private Long storyBookTitle; @NonNull private LearningEventType learningEventType; @@ -22,6 +23,14 @@ public void setStoryBookId(Long storyBookId) { this.storyBookId = storyBookId; } + public Long getStoryBookTitle() { + return storyBookTitle; + } + + public void setStoryBookTitle(Long storyBookTitle) { + this.storyBookTitle = storyBookTitle; + } + public LearningEventType getLearningEventType() { return learningEventType; } diff --git a/app/src/main/java/ai/elimu/analytics/receiver/StoryBookLearningEventReceiver.java b/app/src/main/java/ai/elimu/analytics/receiver/StoryBookLearningEventReceiver.java index 95be1ad..c03cd56 100644 --- a/app/src/main/java/ai/elimu/analytics/receiver/StoryBookLearningEventReceiver.java +++ b/app/src/main/java/ai/elimu/analytics/receiver/StoryBookLearningEventReceiver.java @@ -44,7 +44,7 @@ public void onReceive(Context context, Intent intent) { storyBookLearningEvent.setPackageName(packageName); storyBookLearningEvent.setTime(timestamp); storyBookLearningEvent.setStoryBookId(storyBookId); -// storyBookLearningEvent.setStoryBookTitle(storyBookTitle); + storyBookLearningEvent.setStoryBookTitle(storyBookTitle); storyBookLearningEvent.setLearningEventType(learningEventType); // Store in database diff --git a/app/src/main/java/ai/elimu/analytics/task/ExportEventsToCsvWorker.java b/app/src/main/java/ai/elimu/analytics/task/ExportEventsToCsvWorker.java index 82531ef..3ee82c5 100644 --- a/app/src/main/java/ai/elimu/analytics/task/ExportEventsToCsvWorker.java +++ b/app/src/main/java/ai/elimu/analytics/task/ExportEventsToCsvWorker.java @@ -334,6 +334,7 @@ private void exportStoryBookLearningEventsToCsv() { "android_id", "package_name", "storybook_id", + "storybook_title", "learning_event_type" ); StringWriter stringWriter = new StringWriter(); @@ -363,6 +364,7 @@ private void exportStoryBookLearningEventsToCsv() { storyBookLearningEvent.getAndroidId(), storyBookLearningEvent.getPackageName(), storyBookLearningEvent.getStoryBookId(), + storyBookLearningEvent.getStoryBookTitle(), storyBookLearningEvent.getLearningEventType() ); csvPrinter.flush();