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 }