Files
edx-platform/openedx/features/survey_report/models.py
Alejandro Cardenas bfd212b6d8 [FC-005] feat: add necessary models for Openedx survey report (#31183)
* feat: add survey_report djangoapp
* feat: add survey report cli command and query methods
* fix: add init file
* refactor: change model fields
* refactor: rename application file and rename methods
* refactor: add is_active to get course enrollments
* refactor: rename method to get active users
* refactor: remove fields useless
* test: rename mocks in command tests
* test: update test name
* docs: add README file
* docs: add selection criteria to get unique courses
* docs: update README
* test: remove useless mocks and use default modulestore
* docs: change command error message
* docs: add docs decisions
* docs: Update openedx/features/survey_report/management/commands/generate_report.py
* docs: add fields descriptions
* docs: add logs for each query
* style: add blank lines
* refactor: rename variables and add a constant for weeks
* refactor: add constant MIN_ENROLLS_ACTIVE_COURSE


Co-authored-by: henrrypg <henrry.pulgarin@edunext.co>
Co-authored-by: David Ormsbee <dave@tcril.org>
Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>
2022-11-15 17:47:21 -05:00

38 lines
1.2 KiB
Python

"""
Survey Report models.
"""
from django.db import models
from jsonfield import JSONField
class SurveyReport(models.Model):
"""
This model stores information to automate the way of gathering impact data from the openedx project.
.. no_pii:
fields:
- courses_offered: Total number of active unique courses.
- learner: Recently active users with login in some weeks.
- registered_learners: Total number of users ever registered in the platform.
- enrollments: Total number of active enrollments in the platform.
- generated_certificates: Total number of generated certificates.
- extra_data: Extra information that will be saved in the report, E.g: site_name, openedx-release.
"""
courses_offered = models.BigIntegerField()
learners = models.BigIntegerField()
registered_learners = models.BigIntegerField()
enrollments = models.BigIntegerField()
generated_certificates = models.BigIntegerField()
extra_data = JSONField(
blank=True,
default=dict,
help_text="Extra information for instance data",
)
created_at = models.DateTimeField(auto_now=True)
class Meta:
ordering = ["-created_at"]
get_latest_by = 'created_at'