Aspects: no report tab in the instructor dashboard

Hi @Sara_Burns

As discussed on Slack, I am opening a thread here.

I have:

[tutor@edx1 ~]$ pip3 freeze | grep tutor
tutor==22.0.0
tutor-contrib-aspects==4.0.0
tutor-contrib-backup==4.5.0
tutor-forum==22.0.0
tutor-mfe==22.0.0

I ran:

tutor images build openedx aspects aspects-superset permissions --no-cache
tutor images build mfe --no-cache
tutor local do init -l aspects
tutor local do dbt -c "run-operation remove_deprecated_models" --only_changed False
tutor local reboot --detach

I have this config:

[tutor@edx1 tutor]$ grep -r ASPECT . 2>/dev/null
./config.yml:ASPECTS_CLICKHOUSE_CMS_PASSWORD: <REDACTED>
./config.yml:ASPECTS_CLICKHOUSE_CMS_USER: ch_cms
./config.yml:ASPECTS_CLICKHOUSE_LRS_PASSWORD: <REDACTED>
./config.yml:ASPECTS_CLICKHOUSE_LRS_USER: ch_lrs
./config.yml:ASPECTS_CLICKHOUSE_REPORT_PASSWORD: <REDACTED>
./config.yml:ASPECTS_CLICKHOUSE_REPORT_USER: ch_report
./config.yml:ASPECTS_CLICKHOUSE_VECTOR_PASSWORD: <REDACTED>
./config.yml:ASPECTS_CLICKHOUSE_VECTOR_USER: ch_vector
./config.yml:ASPECTS_ENABLE_PII: true
./config.yml:ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS: true
./env/apps/openedx/settings/cms/development.py:ASPECTS_INSTRUCTOR_DASHBOARDS = [{'name': 'Course Dashboard', 'slug': 'course-dashboard', 'uuid': 'c0e64194-33d1-4d5a-8c10-4f51530c5ee9', 'allow_translations': True}, {'name': 'At-Risk Learners Dashboard', 'slug': 'learner-groups', 'uuid': '8661d20c-cee6-4245-9fcc-610daea5fd24', 'allow_translations': True}, {'name': 'Individual Learner Dashboard', 'slug': 'individual-learner', 'uuid': 'abae8a25-1ba4-4653-81bd-d3937a162a11', 'allow_translations': True}]
./env/apps/openedx/settings/cms/development.py:ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS = True
./env/apps/openedx/settings/cms/production.py:ASPECTS_INSTRUCTOR_DASHBOARDS = [{'name': 'Course Dashboard', 'slug': 'course-dashboard', 'uuid': 'c0e64194-33d1-4d5a-8c10-4f51530c5ee9', 'allow_translations': True}, {'name': 'At-Risk Learners Dashboard', 'slug': 'learner-groups', 'uuid': '8661d20c-cee6-4245-9fcc-610daea5fd24', 'allow_translations': True}, {'name': 'Individual Learner Dashboard', 'slug': 'individual-learner', 'uuid': 'abae8a25-1ba4-4653-81bd-d3937a162a11', 'allow_translations': True}]
./env/apps/openedx/settings/cms/production.py:ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS = True
./env/apps/openedx/settings/lms/development.py:ASPECTS_INSTRUCTOR_DASHBOARDS = [{'name': 'Course Dashboard', 'slug': 'course-dashboard', 'uuid': 'c0e64194-33d1-4d5a-8c10-4f51530c5ee9', 'allow_translations': True}, {'name': 'At-Risk Learners Dashboard', 'slug': 'learner-groups', 'uuid': '8661d20c-cee6-4245-9fcc-610daea5fd24', 'allow_translations': True}, {'name': 'Individual Learner Dashboard', 'slug': 'individual-learner', 'uuid': 'abae8a25-1ba4-4653-81bd-d3937a162a11', 'allow_translations': True}]
./env/apps/openedx/settings/lms/development.py:ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS = True
./env/apps/openedx/settings/lms/production.py:ASPECTS_INSTRUCTOR_DASHBOARDS = [{'name': 'Course Dashboard', 'slug': 'course-dashboard', 'uuid': 'c0e64194-33d1-4d5a-8c10-4f51530c5ee9', 'allow_translations': True}, {'name': 'At-Risk Learners Dashboard', 'slug': 'learner-groups', 'uuid': '8661d20c-cee6-4245-9fcc-610daea5fd24', 'allow_translations': True}, {'name': 'Individual Learner Dashboard', 'slug': 'individual-learner', 'uuid': 'abae8a25-1ba4-4653-81bd-d3937a162a11', 'allow_translations': True}]
./env/apps/openedx/settings/lms/production.py:ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS = True

I do see the analytics in Studio, but I still don’t get the reports in the instructor dashboard in the LMS (see screenshot below).

Any idea what to check ?

Adding @DianaVillalvazo and @arbrandes to this thread, as well, in case there’s any overlap with frontend-base stuff.

Hi guys, I went through all the code and didn’t find anything worrying anywhere, so it should be working

@mboisson can you take a look to tour settings and look for `**OPEN_EDX_FILTERS_CONFIG` ?
**
you should have something like:

the configs for “tabs.requested.v1” are the ones that tell the backend to add the filter that will add the reports tab to the list of tabs on the new instructor dashboard

you can also take a look at the endpoint that returns the tabs to be displayed, if it looks like this, then the filter is not adding the tab, in order for it to be “right” there should be an extra tab for reports in there, this is how it looks like when there’s either an issue or aspects is not enabled

in my lms/production.py, I have:

try:
    not OPEN_EDX_FILTERS_CONFIG
except NameError:  # OPEN_EDX_FILTERS_CONFIG is not defined
    OPEN_EDX_FILTERS_CONFIG = {}
# When DEPR-38432 is pickedup we may want to cleanup here.
if not OPEN_EDX_FILTERS_CONFIG.get("org.openedx.learning.instructor.dashboard.render.started.v1"):
    OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.render.started.v1"] = {
        "fail_silently": False,
        "pipeline": [],
    }
if not OPEN_EDX_FILTERS_CONFIG.get("org.openedx.learning.instructor.dashboard.tabs.requested.v1"):
    OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.tabs.requested.v1"] = {
        "fail_silently": False,
        "pipeline": [],
    }

OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.render.started.v1"]["pipeline"].append("platform_plugin_aspects.extensions.filters.AddSupersetTab")
OPEN_EDX_FILTERS_CONFIG["org.openedx.learning.instructor.dashboard.tabs.requested.v1"]["pipeline"].append("platform_plugin_aspects.extensions.filters.AddSupersetTabToInstructorDashboard")

I am not sure how to check the endpoint ?

Now that I think of it, I used to have the feedback tab, added by this tutor environment patch:

OPEN_EDX_FILTERS_CONFIG = {
    "org.openedx.learning.instructor.dashboard.render.started.v1": {
        "fail_silently": False,
        "pipeline": [
            "feedback.extensions.filters.AddFeedbackTab",
        ]
    },
}

and it is no longer there either.

Could this be because the instructor-dashboard is using frontend-base rather than the legacy MFE implementation ?

To test this, I tried to go back to the MFE app using

    apps["instructor-dashboard"]["enabled"] = False

according to

https://github.com/overhangio/tutor-mfe#frontend-apps

but it results in a link to the instructor dashboard which yields an error 500 with the end of the error in the logs being:

lms-1  |     response = handler(request, *args, **kwargs)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/lms/djangoapps/course_home_api/course_metadata/views.py", line 83, in get
lms-1  |     course_key = CourseKey.from_string(course_key_string)
lms-1  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.12/site-packages/opaque_keys/__init__.py", line 198, in from_string
lms-1  |     return cls.deprecated_fallback._from_deprecated_string(serialized)  # type: ignore
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.12/site-packages/opaque_keys/edx/locator.py", line 403, in _from_deprecated_string
lms-1  |     raise InvalidKeyError(cls, serialized)
lms-1  | opaque_keys.InvalidKeyError: <class 'opaque_keys.edx.locator.CourseLocator'>: None/course-v1:CQ+CIP101+v1

I figured it out!

It is precisely because of the configuration for the Feedback tab that the Aspects reports disappeared…

I was following

https://github.com/openedx/xblocks-extra/blob/main/src/feedback/README.rst

which instructs to overwrite

OPEN_EDX_FILTERS_CONFIG

instead of adding to it.

This commit fixed that: do not overwrite OPEN_EDX_FILTERS_CONFIG for feedback, add to it instead · calculquebec/tutor-plugins@62de602 · GitHub

The documentation for the feedback xblock is probably a bit misleading. Since it also does not work for the FeedbackXBlock, I created a separate thread for it.

Glad you figured it out!! And thanks for following up with the solution!