-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MB-1192: [feat] Add course ended, not passing certificate status to dashboard messaging #28405
Conversation
If a student has not passed a course, the course has ended, and they have a verified seat, we want to show them a message at a glance on the dashboard.
b91b395
to
e5bd887
Compare
common/djangoapps/student/helpers.py
Outdated
""" | ||
Check to see if a user has passing grade for a course | ||
""" | ||
course_grade = CourseGradeFactory().read(user, course=enrollment.course_overview, create_if_needed=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if the course overview doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a change here to protect against an empty overview. I'm not sure what's best practice in Python here actually, so if you have any advice, I'd appreciate it.
@@ -680,6 +680,11 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem | |||
for enrollment in course_enrollments | |||
} | |||
|
|||
passing_courses = { | |||
enrollment.course_id: user_has_passing_grade_in_course(user, enrollment) | |||
for enrollment in course_enrollments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we worried about the performance if the user has a lot of enrollments? Will this slow the dashboard down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took two (semi) related loops and smushed them together. There's a lot of these similar dictionary comprehension... things on the page, so I just picked one and made it a regular loop.
Your PR has finished running tests. There were no failures. |
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR may have caused e2e tests to fail on Stage. If you're a member of the edX org, please visit #e2e-troubleshooting on Slack to help diagnose the cause of these failures. Otherwise, it is the reviewer's responsibility. E2E tests have failed. https://gocd.tools.edx.org/go/tab/pipeline/history/deploy_to_stage |
EdX Release Notice: This PR has been deployed to the production environment. |
1 similar comment
EdX Release Notice: This PR has been deployed to the production environment. |
This PR adds a message to a dashboard course card around a user who is in the "course ended, not passing" state. Now, when a user:
A new message will appear informing them that they have not passed, along with a button to go to their progress page and see grades.
Testing instructions
related themes PR: https://github.com/edx/edx-themes/pull/747