learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
799 stars 655 forks source link

Add ancestor information to summary and session log exports #12691

Open rtibbles opened 1 month ago

rtibbles commented 1 month ago

Observed behavior

Some users have asked for additional information showing the topic hierarchy for each resource node in the export logs. We had prototyped this previously, but it caused huge slowdowns during the export process.

However, now that the ancestor information is directly annotated onto the content nodes, we can reuse this for quick access to this information.

Expected behavior

The ancestors information should be unpacked and the longest ancestor chain used to determine how many topic headers to include. Then each ancestor for each row should be put into a topic header until the ancestors are exhausted.

The topic headers should be a string in the form "Topic level {n}" starting at 1.

User-facing consequences

This should hopefully allow users who have made deliberate choices in their topic hierarchies to use that information in their data analysis.

thesujai commented 6 days ago

Can i give it a shot?

nucleogenesis commented 5 days ago

@thesujai in the kolibri.core.logger.management.commands module you'll find the exportlogs.py file which is where the root of the work should be, I think - but here in the kolibri.core.logger module, the csv_export file appears to be where the document is generated.

To test this, you can go to the Facility -> Data section while signed in as an admin, there you can click to generate the logs.

This all starts from around here I think (just for context, as the work should only involve the backend module(s) linked above).

If you have any questions reach out on Slack or here! Thanks again for taking this one!