openedx.features.survey_report package#
Subpackages#
Submodules#
openedx.features.survey_report.api module#
Contains the logic to manage survey report model.
- openedx.features.survey_report.api.get_report_data() dict#
Get data from database to generate a new report.
- openedx.features.survey_report.api.send_report_to_external_api(report_id: int) None#
Send a report to Openedx endpoint and save the response in the SurveyReportUpload model.
endpoint: The value of the setting SURVEY_REPORT_ENDPOINT
content_type: JSON
payload: - 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. - created_at: Date when the report was generated, this date will send with format ‘%m-%d-%Y %H:%M:%S’
openedx.features.survey_report.apps module#
Survey Report App Configuration.
openedx.features.survey_report.models module#
Survey Report models.
- class openedx.features.survey_report.models.SurveyReport(*args, **kwargs)#
Bases:
ModelThis model stores information to automate the way of gathering impact data from the openedx project.
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. - state: State of the async generating process.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- courses_offered#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- created_at#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- enrollments#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- extra_data#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- generated_certificates#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)#
- get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)#
- get_state_display(*, field=<django.db.models.fields.CharField: state>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- learners#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- registered_learners#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- state#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- surveyreportupload_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- class openedx.features.survey_report.models.SurveyReportAnonymousSiteID(*args, **kwargs)#
Bases:
ModelThis model is just to save the identification which will be send to the external API when the settings ANONYMOUS_SURVEY_REPORT is defined.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- class openedx.features.survey_report.models.SurveyReportUpload(*args, **kwargs)#
Bases:
ModelThis model stores the result of the POST request made to an external service after generating a survey report.
fields: - sent_at: Date when the report was sent. - report: The report that was sent. - status: Request status code. - request_details: Information about the send request.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- get_next_by_sent_at(*, field=<django.db.models.fields.DateTimeField: sent_at>, is_next=True, **kwargs)#
- get_previous_by_sent_at(*, field=<django.db.models.fields.DateTimeField: sent_at>, is_next=False, **kwargs)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- report#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
- report_id#
- request_details#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- sent_at#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- status_code#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
openedx.features.survey_report.queries module#
Queries to get data from database.
- openedx.features.survey_report.queries.get_course_enrollments() int#
Get total number of enrollments from users that aren’t staff. Course staff members will be included.
- openedx.features.survey_report.queries.get_generated_certificates() int#
Get total number of generated certificates.
- openedx.features.survey_report.queries.get_recently_active_users(weeks: int) int#
Get total number of users with last login in the last weeks.
- Parameters:
weeks (int) – number of weeks since the last login to considerate as an active learner.
openedx.features.survey_report.tasks module#
Tasks for Survey Report.
openedx.features.survey_report.urls module#
Defines URLs for Survey Report.
openedx.features.survey_report.views module#
Views to manage the Survey Reports.