From 54df4f83d240a2b9c8bc09f8c231e970b197fcb5 Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:01:31 +0700 Subject: [PATCH] feat: simulate video learning events Resolves #3 --- ...01018_video-learning-events_2024-09-21.csv | 32 ++++++++----- ...01018_video-learning-events_2024-09-21.csv | 19 +------- ...01018_video-learning-events_2024-09-21.csv | 40 +++++++++------- ...01018_video-learning-events_2024-09-21.csv | 39 ++++++++++++++- ...01018_video-learning-events_2024-09-21.csv | 25 +++++----- ...01018_video-learning-events_2024-09-21.csv | 47 +++++++++++-------- simulate-video-learning-events.py | 40 +++++++++++----- 7 files changed, 152 insertions(+), 90 deletions(-) diff --git a/lang-ENG/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv b/lang-ENG/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv index b73b66a..a6896cd 100644 --- a/lang-ENG/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv +++ b/lang-ENG/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv @@ -1,13 +1,21 @@ id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896840,e387e38700000001,ai.elimu.analytics,3,akili and me - letter c, -0,1726896840,e387e38700000001,ai.elimu.analytics,42,one small step, -0,1726896840,e387e38700000001,ai.elimu.analytics,13,akili and me - the rectangle song, -0,1726896840,e387e38700000001,ai.elimu.analytics,8,akili and me - family, -0,1726896840,e387e38700000001,ai.elimu.analytics,3,akili and me - letter c, -0,1726896840,e387e38700000001,ai.elimu.analytics,42,one small step, -0,1726896840,e387e38700000001,ai.elimu.analytics,8,akili and me - family, -0,1726896840,e387e38700000001,ai.elimu.analytics,10,akili and me - music, -0,1726896840,e387e38700000001,ai.elimu.analytics,33,akili and me - letter i, -0,1726896840,e387e38700000001,ai.elimu.analytics,3,akili and me - letter c, -0,1726896840,e387e38700000001,ai.elimu.analytics,36,akili and me - letter l, -0,1726896840,e387e38700000001,ai.elimu.analytics,34,akili and me - letter j, +0,1726905582649,e387e38700000001,ai.elimu.analytics,1,akili and me - letter a,VIDEO_OPENED +0,1726905608328,e387e38700000001,ai.elimu.analytics,1,akili and me - letter a,VIDEO_COMPLETED +0,1726905582651,e387e38700000001,ai.elimu.analytics,1,akili and me - letter a,VIDEO_OPENED +0,1726905640436,e387e38700000001,ai.elimu.analytics,1,akili and me - letter a,VIDEO_COMPLETED +0,1726905582651,e387e38700000001,ai.elimu.analytics,32,akili and me - letter h,VIDEO_OPENED +0,1726905589620,e387e38700000001,ai.elimu.analytics,32,akili and me - letter h,VIDEO_COMPLETED +0,1726905582651,e387e38700000001,ai.elimu.analytics,11,akili and me - art - drawing rectangles,VIDEO_OPENED +0,1726905589095,e387e38700000001,ai.elimu.analytics,11,akili and me - art - drawing rectangles,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582651,e387e38700000001,ai.elimu.analytics,3,akili and me - letter c,VIDEO_OPENED +0,1726905632218,e387e38700000001,ai.elimu.analytics,3,akili and me - letter c,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582652,e387e38700000001,ai.elimu.analytics,36,akili and me - letter l,VIDEO_OPENED +0,1726905635147,e387e38700000001,ai.elimu.analytics,36,akili and me - letter l,VIDEO_COMPLETED +0,1726905582652,e387e38700000001,ai.elimu.analytics,8,akili and me - family,VIDEO_OPENED +0,1726905600915,e387e38700000001,ai.elimu.analytics,8,akili and me - family,VIDEO_COMPLETED +0,1726905582652,e387e38700000001,ai.elimu.analytics,12,akili and me - numbers - one two three song,VIDEO_OPENED +0,1726905623025,e387e38700000001,ai.elimu.analytics,12,akili and me - numbers - one two three song,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582652,e387e38700000001,ai.elimu.analytics,33,akili and me - letter i,VIDEO_OPENED +0,1726905589590,e387e38700000001,ai.elimu.analytics,33,akili and me - letter i,VIDEO_COMPLETED +0,1726905582653,e387e38700000001,ai.elimu.analytics,42,one small step,VIDEO_OPENED +0,1726905620623,e387e38700000001,ai.elimu.analytics,42,one small step,VIDEO_COMPLETED diff --git a/lang-ENG/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv b/lang-ENG/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv index c6deb62..8b13789 100644 --- a/lang-ENG/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv +++ b/lang-ENG/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv @@ -1,18 +1 @@ -id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896840,e387e38700000002,ai.elimu.analytics,42,one small step, -0,1726896840,e387e38700000002,ai.elimu.analytics,7,akili and me - letter g, -0,1726896840,e387e38700000002,ai.elimu.analytics,2,akili and me - letter b, -0,1726896840,e387e38700000002,ai.elimu.analytics,5,akili and me - letter e, -0,1726896840,e387e38700000002,ai.elimu.analytics,4,akili and me - letter d, -0,1726896840,e387e38700000002,ai.elimu.analytics,14,akili and me - counting compilation, -0,1726896840,e387e38700000002,ai.elimu.analytics,7,akili and me - letter g, -0,1726896840,e387e38700000002,ai.elimu.analytics,10,akili and me - music, -0,1726896840,e387e38700000002,ai.elimu.analytics,35,akili and me - letter k, -0,1726896840,e387e38700000002,ai.elimu.analytics,11,akili and me - art - drawing rectangles, -0,1726896840,e387e38700000002,ai.elimu.analytics,13,akili and me - the rectangle song, -0,1726896840,e387e38700000002,ai.elimu.analytics,9,akili and me - jump jump jump, -0,1726896840,e387e38700000002,ai.elimu.analytics,13,akili and me - the rectangle song, -0,1726896840,e387e38700000002,ai.elimu.analytics,1,akili and me - letter a, -0,1726896840,e387e38700000002,ai.elimu.analytics,5,akili and me - letter e, -0,1726896840,e387e38700000002,ai.elimu.analytics,10,akili and me - music, -0,1726896840,e387e38700000002,ai.elimu.analytics,33,akili and me - letter i, + diff --git a/lang-ENG/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv b/lang-ENG/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv index 67fd11a..d6f6b80 100644 --- a/lang-ENG/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv +++ b/lang-ENG/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv @@ -1,17 +1,25 @@ id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896840,e387e38700000003,ai.elimu.analytics,7,akili and me - letter g, -0,1726896840,e387e38700000003,ai.elimu.analytics,33,akili and me - letter i, -0,1726896840,e387e38700000003,ai.elimu.analytics,9,akili and me - jump jump jump, -0,1726896840,e387e38700000003,ai.elimu.analytics,12,akili and me - numbers - one two three song, -0,1726896840,e387e38700000003,ai.elimu.analytics,2,akili and me - letter b, -0,1726896840,e387e38700000003,ai.elimu.analytics,14,akili and me - counting compilation, -0,1726896840,e387e38700000003,ai.elimu.analytics,6,akili and me - letter f, -0,1726896840,e387e38700000003,ai.elimu.analytics,14,akili and me - counting compilation, -0,1726896840,e387e38700000003,ai.elimu.analytics,42,one small step, -0,1726896840,e387e38700000003,ai.elimu.analytics,12,akili and me - numbers - one two three song, -0,1726896840,e387e38700000003,ai.elimu.analytics,14,akili and me - counting compilation, -0,1726896840,e387e38700000003,ai.elimu.analytics,10,akili and me - music, -0,1726896840,e387e38700000003,ai.elimu.analytics,8,akili and me - family, -0,1726896840,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j, -0,1726896840,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j, -0,1726896840,e387e38700000003,ai.elimu.analytics,6,akili and me - letter f, +0,1726905582662,e387e38700000003,ai.elimu.analytics,1,akili and me - letter a,VIDEO_OPENED +0,1726905619092,e387e38700000003,ai.elimu.analytics,1,akili and me - letter a,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582662,e387e38700000003,ai.elimu.analytics,32,akili and me - letter h,VIDEO_OPENED +0,1726905596844,e387e38700000003,ai.elimu.analytics,32,akili and me - letter h,VIDEO_COMPLETED +0,1726905582662,e387e38700000003,ai.elimu.analytics,2,akili and me - letter b,VIDEO_OPENED +0,1726905600960,e387e38700000003,ai.elimu.analytics,2,akili and me - letter b,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582662,e387e38700000003,ai.elimu.analytics,3,akili and me - letter c,VIDEO_OPENED +0,1726905626849,e387e38700000003,ai.elimu.analytics,3,akili and me - letter c,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582664,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j,VIDEO_OPENED +0,1726905602664,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j,VIDEO_COMPLETED +0,1726905582664,e387e38700000003,ai.elimu.analytics,3,akili and me - letter c,VIDEO_OPENED +0,1726905612137,e387e38700000003,ai.elimu.analytics,3,akili and me - letter c,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582664,e387e38700000003,ai.elimu.analytics,8,akili and me - family,VIDEO_OPENED +0,1726905610476,e387e38700000003,ai.elimu.analytics,8,akili and me - family,VIDEO_COMPLETED +0,1726905582665,e387e38700000003,ai.elimu.analytics,13,akili and me - the rectangle song,VIDEO_OPENED +0,1726905589360,e387e38700000003,ai.elimu.analytics,13,akili and me - the rectangle song,VIDEO_COMPLETED +0,1726905582665,e387e38700000003,ai.elimu.analytics,13,akili and me - the rectangle song,VIDEO_OPENED +0,1726905627004,e387e38700000003,ai.elimu.analytics,13,akili and me - the rectangle song,VIDEO_COMPLETED +0,1726905582665,e387e38700000003,ai.elimu.analytics,36,akili and me - letter l,VIDEO_OPENED +0,1726905626627,e387e38700000003,ai.elimu.analytics,36,akili and me - letter l,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905582665,e387e38700000003,ai.elimu.analytics,5,akili and me - letter e,VIDEO_OPENED +0,1726905605425,e387e38700000003,ai.elimu.analytics,5,akili and me - letter e,VIDEO_COMPLETED +0,1726905582665,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j,VIDEO_OPENED +0,1726905617428,e387e38700000003,ai.elimu.analytics,34,akili and me - letter j,VIDEO_COMPLETED diff --git a/lang-TGL/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv b/lang-TGL/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv index ae81beb..fc99a0e 100644 --- a/lang-TGL/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv +++ b/lang-TGL/android-id-e387e38700000001/version-code-3001018/video-learning-events/e387e38700000001_3001018_video-learning-events_2024-09-21.csv @@ -1,2 +1,39 @@ id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896842,e387e38700000001,ai.elimu.analytics,1,piper, +0,1726905583777,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905593327,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583777,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905604565,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583777,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905607396,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905625686,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905622984,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905641120,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905640086,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905639740,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905585891,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905585776,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905595853,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583778,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905591282,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583781,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905640556,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583781,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905624594,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583781,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905596410,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583781,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905602412,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583782,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905630464,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583782,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905596841,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583782,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905615498,e387e38700000001,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED diff --git a/lang-TGL/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv b/lang-TGL/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv index c02762a..76056ce 100644 --- a/lang-TGL/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv +++ b/lang-TGL/android-id-e387e38700000002/version-code-3001018/video-learning-events/e387e38700000002_3001018_video-learning-events_2024-09-21.csv @@ -1,14 +1,13 @@ id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000002,ai.elimu.analytics,1,piper, +0,1726905583786,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905590274,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583787,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905590843,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583787,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905588710,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583787,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905622421,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583788,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905631943,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583788,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905642729,e387e38700000002,ai.elimu.analytics,1,piper,VIDEO_COMPLETED diff --git a/lang-TGL/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv b/lang-TGL/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv index 1e37241..be8f4fc 100644 --- a/lang-TGL/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv +++ b/lang-TGL/android-id-e387e38700000003/version-code-3001018/video-learning-events/e387e38700000003_3001018_video-learning-events_2024-09-21.csv @@ -1,20 +1,29 @@ id,timestamp,android_id,package_name,video_id,video_title,learning_event_type -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, -0,1726896842,e387e38700000003,ai.elimu.analytics,1,piper, +0,1726905583791,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905639219,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583792,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905640777,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583792,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905620024,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583792,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905635756,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583792,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905629549,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583793,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905592411,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583793,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905621815,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583793,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905639131,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583793,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905594401,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583794,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905599987,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED +0,1726905583794,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905595040,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583794,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905631557,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583794,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905598726,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_COMPLETED +0,1726905583794,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_OPENED +0,1726905600554,e387e38700000003,ai.elimu.analytics,1,piper,VIDEO_CLOSED_BEFORE_COMPLETED diff --git a/simulate-video-learning-events.py b/simulate-video-learning-events.py index d8e87f1..cd040e2 100644 --- a/simulate-video-learning-events.py +++ b/simulate-video-learning-events.py @@ -23,7 +23,7 @@ date_iso_8601 = datetime.today().strftime('%Y-%m-%d') print(basename(__file__), f'date_iso_8601: {date_iso_8601}') -def simulate_video_learning_event(android_id, videos_df: pandas.DataFrame): +def simulate_video_learning_event(android_id, videos_df: pandas.DataFrame, video_learning_events): print(basename(__file__), 'simulate_video_learning_event') """ Simulate a VideoLearningEvent, e.g. a video being opened. @@ -32,25 +32,46 @@ def simulate_video_learning_event(android_id, videos_df: pandas.DataFrame): """ id = 0 - timestamp = int(datetime.now().timestamp()) + timestamp_ms = int(datetime.now().timestamp() * 1_000) # Locate a random video in the DataFrame number_of_videos = len(videos_df.index) random_video_index = random.randrange(0, number_of_videos) random_video = videos_df.loc[random_video_index] - return { + # https://github.com/elimu-ai/model/blob/main/src/main/java/ai/elimu/model/v2/enums/analytics/LearningEventType.java + learning_event_types = ['VIDEO_OPENED', 'VIDEO_CLOSED_BEFORE_COMPLETED', 'VIDEO_COMPLETED'] + + video_learning_events.append({ + 'id': id, + 'timestamp': timestamp_ms, + 'android_id': android_id, + 'package_name': package_name, + 'video_id': random_video.id, + 'video_title': random_video.title, + 'learning_event_type': learning_event_types[0] + }) + + # A `VIDEO_OPENED_EVENT` should always be followed by a `VIDEO_CLOSED_BEFORE_COMPLETED` or + # a `VIDEO_COMPLETED` event. + second_learning_event_type = random.choice(learning_event_types[-2:]) + + # Increase timestamp to simulate passage of time between the `VIDEO_OPENED` event and the + # second event. Increase by a random number between 1 second and 60 seconds. + timestamp_ms += random.randrange(1_000, 1_000 * 60) + + video_learning_events.append({ 'id': id, - 'timestamp': timestamp, + 'timestamp': timestamp_ms, 'android_id': android_id, 'package_name': package_name, 'video_id': random_video.id, 'video_title': random_video.title, - 'learning_event_type': '' - } + 'learning_event_type': random.choice(learning_event_types[-2:]) + }) for language_code in language_codes: - print(basename(__file__)) + print() print(basename(__file__), f'language_code: {language_code}') videos_csv_url = f'https://raw.githubusercontent.com/elimu-ai/webapp/main/src/main/resources/db/content_PROD/{language_code.lower()}/videos.csv' @@ -77,10 +98,7 @@ def simulate_video_learning_event(android_id, videos_df: pandas.DataFrame): random_number_of_events = random.randrange(0, 20) print(basename(__file__), f'random_number_of_events: {random_number_of_events}') for i in range(random_number_of_events): - print(basename(__file__)) - event = simulate_video_learning_event(android_id, videos_df) - # print(basename(__file__), f'event: {event}') - video_learning_events.append(event) + simulate_video_learning_event(android_id, videos_df, video_learning_events) video_learning_events_df = pandas.DataFrame(video_learning_events) # print(basename(__file__), f'video_learning_events_df: \n{video_learning_events_df}')