Skip to content

Instructor Dashboard - Course Info - API - Add missing content #37713

@wgu-jesse-stewart

Description

@wgu-jesse-stewart

The new Course Info API is missing a few fields.

course_run

In edx-platform/lms/djangoapps/instructor/views/serializers_v2.py - we need to add course_run.

    course_run = serializers.SerializerMethodField(help_text="Course run identifier")
...
    def get_course_run(self, data):
        """Get course run identifier."""
        return data['course'].id.run

Course Info missing from api-docs

This endpoint also doesn't seem work with http://apps.local.openedx.io:8000/api-docs.

I believe this a conflict with class InstructorTaskSerializer in api.py and serializers_v2.py
Adding

    class Meta:
        ref_name = 'InstructorDashboardV2'

and

class Meta:
        ref_name = 'InstructorDashboardV1' may fix this, but there may be a better way.

Tabs need sort_oder value.

We need to add something for sort_oder to the tabs array. These values should be 10,20,30,40,05,etc. This will make it easy to reorder, and insert tabs.

EG:

    "tabs": [
        {
            "tab_id": "course_info",
            "title": "Course Info",
            "url": "None/instructor/course-v1:OpenedX+DemoX+DemoCourse/course_info",
            "sort_order": 10
        },
        {
            "tab_id": "enrollments",
            "title": "Enrollments",
            "url": "None/instructor/course-v1:OpenedX+DemoX+DemoCourse/enrollments",
            "sort_order": 20
        },
        {
            "tab_id": "course_team",
            "title": "Course Team",
            "url": "None/instructor/course-v1:OpenedX+DemoX+DemoCourse/course_team",
            "sort_order": 30
         }
      ]

Tabs is missing bulk email tab.

something like this needs to be added to serializers_v2.py

        if access['staff']:
            tabs.append({
                'tab_id': 'bulk_email',
                'title': _('Bulk Email'),
                'url': f'{mfe_base_url}/instructor/{str(course_key)}/bulk_email'
                'sort_order': XX
            })

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

In Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions