Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
=============

Version 0.77.12
---------------

- Add department 21T (Theater Arts) (#3668)
- Preconnect to the API and Typekit origins (#3819)
- Add a content-engagement panel to the B2B analytics dashboard (#3806)

Version 0.77.11 (Released August 25, 2026)
---------------

Expand Down
10 changes: 10 additions & 0 deletions data_fixtures/fixtures/departments.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@
"updated_on": "2024-04-17T00:00:00.000000+00:00"
}
},
{
"model": "learning_resources.LearningResourceDepartment",
"fields": {
"department_id": "21T",
"name": "Theater Arts",
"school_id": 3,
"created_on": "2024-04-17T00:00:00.000000+00:00",
"updated_on": "2024-04-17T00:00:00.000000+00:00"
}
},
{
"model": "learning_resources.LearningResourceDepartment",
"fields": {
Expand Down
72 changes: 72 additions & 0 deletions data_fixtures/migrations/0025_add_department_21T.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Data migration: add department 21T (Theater Arts)

from urllib.parse import urlencode

from django.db import migrations
from django.utils.text import slugify

from channels.constants import ChannelType

SCHOOL_NAME = "School of Humanities, Arts, and Social Sciences"


def remove_theater_arts(apps, schema_editor):
"""
Remove department with department_id=21T
"""

Channel = apps.get_model("channels", "Channel")
LearningResourceDepartment = apps.get_model(
"learning_resources", "LearningResourceDepartment"
)
department = LearningResourceDepartment.objects.filter(department_id="21T").first()
if department:
Channel.objects.filter(department_detail__department=department).delete()
department.delete()


def add_theater_arts(apps, schema_editor):
LearningResourceDepartment = apps.get_model(
"learning_resources", "LearningResourceDepartment"
)
LearningResourceSchool = apps.get_model(
"learning_resources", "LearningResourceSchool"
)
Channel = apps.get_model("channels", "Channel")
ChannelDepartmentDetail = apps.get_model("channels", "ChannelDepartmentDetail")

school = LearningResourceSchool.objects.get(name=SCHOOL_NAME)

department, _ = LearningResourceDepartment.objects.get_or_create(
department_id="21T",
defaults={
"name": "Theater Arts",
"school": school,
},
)

channel, _ = Channel.objects.get_or_create(
search_filter=urlencode({"department": department.department_id}),
channel_type=ChannelType.department.name,
defaults={
"name": slugify(department.name),
"title": department.name,
},
)
ChannelDepartmentDetail.objects.get_or_create(
channel=channel,
department=department,
)


class Migration(migrations.Migration):
dependencies = [
(
"data_fixtures",
"0024_add_ovs_platform_offeror",
),
]

operations = [
migrations.RunPython(add_theater_arts, remove_theater_arts),
]
5 changes: 5 additions & 0 deletions frontends/api/src/analytics/test-utils/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,17 @@ const contentEngagementDepth = (
organization_name: faker.company.name(),
courserun_readable_id: `course-v1:MITx+${faker.string.alphanumeric(5)}+2026`,
courserun_title: faker.commerce.productName(),
// Internally consistent with the view's arithmetic: the rates divide by
// total_enrolled_learners, the averages by engaged_learners (800/28, 1000/28),
// and every activity cohort is a subset of engaged_learners.
total_enrolled_learners: 40,
engaged_learners: 28,
engagement_rate_pct: 70,
total_videos_watched: 800,
video_watchers: 22,
avg_videos_per_engaged_learner: 28.6,
total_problems_attempted: 1000,
problem_attempters: 25,
avg_problems_per_engaged_learner: 35.7,
total_chatbot_interactions: 60,
chatbot_users: 14,
Expand Down
18 changes: 17 additions & 1 deletion frontends/api/src/analytics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,21 @@ export type ProgramFunnel = {
program_course_completers: number | null
}

/** `mv_b2b_content_engagement_depth` — grain: org x course run, all-time. */
/**
* `mv_b2b_content_engagement_depth` — grain: org x course run, all-time.
*
* Three of these columns are cohort counts rather than metrics a reader asked
* for: `video_watchers`, `problem_attempters` and `chatbot_users` are the
* distinct learners behind the activity total beside each of them. The view
* publishes them so the API can apply the anonymity floor to the cohort that
* actually produced a sum rather than to a superset of it — an average over
* one learner *is* that learner's value, however many learners were merely
* "engaged". Keep each one next to the total it accounts for.
*
* The two `avg_*_per_engaged_learner` columns divide by `engaged_learners`,
* as their names say; the totals above them are contributed only by the
* narrower cohorts. That split is why both are suppressible independently.
*/
export type ContentEngagementDepth = {
organization_key: string
organization_name: string
Expand All @@ -112,8 +126,10 @@ export type ContentEngagementDepth = {
engaged_learners: number | null
engagement_rate_pct: number | null
total_videos_watched: number | null
video_watchers: number | null
avg_videos_per_engaged_learner: number | null
total_problems_attempted: number | null
problem_attempters: number | null
avg_problems_per_engaged_learner: number | null
total_chatbot_interactions: number | null
chatbot_users: number | null
Expand Down
9 changes: 5 additions & 4 deletions frontends/api/src/generated/v0/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading