From a5e37dc18c4cbc2c9da30b38db169da0acd15d1f Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Fri, 5 Apr 2024 15:27:16 +0500 Subject: [PATCH 1/2] update user activity query --- changelog.d/20240405_151230_fahad.khalid.md | 1 + .../templates/cairn/apps/superset/bootstrap/courseoverview.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20240405_151230_fahad.khalid.md diff --git a/changelog.d/20240405_151230_fahad.khalid.md b/changelog.d/20240405_151230_fahad.khalid.md new file mode 100644 index 0000000..38cc398 --- /dev/null +++ b/changelog.d/20240405_151230_fahad.khalid.md @@ -0,0 +1 @@ +- [Improvement] Update User Activity dataset query to improve average time spent in course. (by @Fahadkhalid210) \ No newline at end of file diff --git a/tutorcairn/templates/cairn/apps/superset/bootstrap/courseoverview.json b/tutorcairn/templates/cairn/apps/superset/bootstrap/courseoverview.json index 4b76ac8..2c8aa9d 100644 --- a/tutorcairn/templates/cairn/apps/superset/bootstrap/courseoverview.json +++ b/tutorcairn/templates/cairn/apps/superset/bootstrap/courseoverview.json @@ -1909,7 +1909,7 @@ "offset": 0, "params": "{\"remote_id\": 49, \"database_name\": \"admin\"}", "schema": "openedx", - "sql": "SELECT user_id,\n course_id,\n time,\n arrayJoin(range(floor(toUInt64(toUnixTimestamp(time) - 5)), ceil(toUInt64(toUnixTimestamp(time) + 5)))) AS timestamp\nFROM events\nWHERE event_source = 'browser'", + "sql": "SELECT user_id,\n course_id,\n time,\n arrayJoin(range(floor(toUInt64(toUnixTimestamp(time))), ceil(toUInt64(toUnixTimestamp(time) + 120)))) AS timestamp\nFROM events\nWHERE course_id <> '' and user_id > 0", "table_name": "User activity", "template_params": null } From e4809f29c0451161b62f509ded7e48f3dea884e8 Mon Sep 17 00:00:00 2001 From: Fahad Khalid <79192414+FahadKhalid210@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:11:38 +0500 Subject: [PATCH 2/2] Update 20240405_151230_fahad.khalid.md --- changelog.d/20240405_151230_fahad.khalid.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/20240405_151230_fahad.khalid.md b/changelog.d/20240405_151230_fahad.khalid.md index 38cc398..83f660b 100644 --- a/changelog.d/20240405_151230_fahad.khalid.md +++ b/changelog.d/20240405_151230_fahad.khalid.md @@ -1 +1 @@ -- [Improvement] Update User Activity dataset query to improve average time spent in course. (by @Fahadkhalid210) \ No newline at end of file +- [Improvement] Update User Activity dataset query by extending time span to 120 seconds and selecting all events where course ID is not null to improve average time spent in course. (by @Fahadkhalid210)