feat: added tracking event on learner search (#30945)

This commit is contained in:
Ahtisham Shahid
2022-09-07 14:50:00 +05:00
committed by GitHub
parent 19c6bae60e
commit 4541750eec
2 changed files with 13 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ from django.core.exceptions import ValidationError
from django.http import Http404
from django.urls import reverse
from edx_django_utils.monitoring import function_trace
from eventtracking import tracker
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseKey
from rest_framework import status
@@ -1681,6 +1682,17 @@ def get_course_discussion_user_stats(
course_stats_response = get_course_user_stats(course_key, params)
tracker.emit(
'edx.forum.searched',
{
'query': username_search_string,
'search_type': 'Learner',
'page': params.get('page'),
'sort_key': params.get('sort_key'),
'total_results': course_stats_response.get('total_results'),
}
)
if comma_separated_usernames:
updated_course_stats = add_stats_for_users_with_no_discussion_content(
course_stats_response["user_stats"],

View File

@@ -87,6 +87,7 @@ class Thread(models.Model):
'edx.forum.searched',
{
'query': search_query,
'search_type': 'Content',
'corrected_text': corrected_text,
'group_id': group_id,
'page': requested_page,