Skip to content
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

Merged
merged 3 commits into from
Aug 9, 2021

Conversation

Tj-Tracy
Copy link
Contributor

@Tj-Tracy Tj-Tracy commented Aug 5, 2021

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:

  • Is in a verified, cert-bearing seat in a course
  • the course has ended
  • the user does not have a passing grade in the course

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

  • Create a verified seat in the demo course (or some other course). Enroll a user.
  • fail the course
  • change the end date to a date in the past
  • check that the messaging properly appears on the dashboard

related themes PR: https://github.com/edx/edx-themes/pull/747

image

@Tj-Tracy Tj-Tracy requested a review from a team August 5, 2021 17:25
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.
@Tj-Tracy Tj-Tracy force-pushed the ttracy/MB-1192-course-ended-no-cert branch from b91b395 to e5bd887 Compare August 5, 2021 17:28
"""
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

@Tj-Tracy Tj-Tracy Aug 6, 2021

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.

@Tj-Tracy Tj-Tracy requested a review from crice100 August 6, 2021 16:00
@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@Tj-Tracy Tj-Tracy merged commit 35d9330 into master Aug 9, 2021
@Tj-Tracy Tj-Tracy deleted the ttracy/MB-1192-course-ended-no-cert branch August 9, 2021 14:03
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

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

robrap added a commit that referenced this pull request Aug 9, 2021
…tus to dashboard messaging (#28405)"

This reverts commit 35d9330.
Tj-Tracy pushed a commit that referenced this pull request Aug 9, 2021
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants