Skip to content

Commit

Permalink
feat: include storybook-title column during event export
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunoia1729 authored Apr 20, 2022
1 parent 93b1a64 commit 8bbb676
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class StoryBookLearningEvent extends LearningEvent {

@NonNull
private Long storyBookId;
private String storyBookTitle;

@NonNull
private LearningEventType learningEventType;
Expand All @@ -22,6 +23,14 @@ public void setStoryBookId(Long storyBookId) {
this.storyBookId = storyBookId;
}

public String getStoryBookTitle() {
return storyBookTitle;
}

public void setStoryBookTitle(String storyBookTitle) {
this.storyBookTitle = storyBookTitle;
}

public LearningEventType getLearningEventType() {
return learningEventType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ private void exportStoryBookLearningEventsToCsv() {
"android_id",
"package_name",
"storybook_id",
"storybook_title",
"learning_event_type"
);
StringWriter stringWriter = new StringWriter();
Expand Down Expand Up @@ -363,6 +364,7 @@ private void exportStoryBookLearningEventsToCsv() {
storyBookLearningEvent.getAndroidId(),
storyBookLearningEvent.getPackageName(),
storyBookLearningEvent.getStoryBookId(),
storyBookLearningEvent.getStoryBookTitle(),
storyBookLearningEvent.getLearningEventType()
);
csvPrinter.flush();
Expand Down

0 comments on commit 8bbb676

Please sign in to comment.