-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizable demographic fields to be set from the backend. #11999
Comments
While implementing this pull request, it seemed like the json-schema-validator: https://pypi.org/project/json-schema-validator/ library was the only compatible option for Python 2.7. However, several newer features of the current JSON Schema standard are not supported in it. Looking at the proposed schema I can't find support for Regarding the proposed approach, using customizable fields in the demographic data seems like the least disruptive approach. This maintains backward compatibility with the current model and minimizes changes needed for synchronization. However, I remember there were some problems in the past with Morango syncing json data in the past. Perhaps @bjester can shed light on whether this functionality is now working as expected. |
@jredrejo No updates have been made to how JSON fields are handled when synced. If both devices in a sync have modified the data, the changes are not merged, so only one side's writes are preserved. |
These are just the names of properties that I am defining for the schema. We would then generate the JSONSchema from this for validation of the entries in the extra_fields of the FacilityUser. |
A couple of thoughts:
|
Thanks - it does seem like syncing the schema is desirable, but doing softer validation for a dynamic schema will be necessary. The issue of it being updated on two different devices and then having conflicting schemas within the FacilityUser data does seem like a nightmare. I'll try to add some test cases around that to make sure we're not making a mess for ourselves. |
Implemented in #12032 |
Overview
Allow customisable demographic data collection for contextualized demographic reporting
Description and outcomes
During initial design of the demographic data collection that is currently in Kolibri, we were aware of additional demographic data reporting requirements, but were unable to come up with a more generalizable set than the limited demographic data that we currently allow collection of.
Because of the resource and data transmission constraints that exist in the contexts that Kolibri is used, collecting additional demographic data outside of the platform poses a significant additional burden to implementations, and a barrier to doing effective and targeted measurement and evaluation work.
To address this, this feature will pilot demographic data collection beyond the current fixed fields. Allowing someone with command line access to Kolibri to add additional fields to be collected for demographic data. This can be scripted for automated setup when piloting this feature. Only enumerated fields will be able to be added - i.e. in the user interface, it will be a dropdown menu, and in the backend, the schema specification will require an enum of allowed string values.
Technical specifications
A JSONSchema of this rough form will be added to the FacilityDataset
extra_fields_schema
as an additional property. It will also be reused in the DeviceSettingsextra_settings_schema
.An extra_fields field will be added to the FacilityUser model, which will be dynamically validated, depending on the value of the schema saved in the extra_fields of its associated FacilityDataset model.
For ease of programmatic setup, a management command to set these fields specifications in the device settings of an unprovisioned device will be created. Any Facility created on a device that has this setup will duplicate the fields specifications detailed in the DeviceSettings.
All user creation and editing workflows will also be updated to allow editing and saving of these new fields. As each field will be a dropdown, this will be implemented using a KSelect, with one displayed for each field. The order of the fields will be determined by the order of the fields saved in the array in JSON.
Places this will impact will be the setup wizard, the user profile page, and the facility user management.
The text was updated successfully, but these errors were encountered: