mitodl / mitxpro

BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

No link to program certificate when user isn't enrolled in program #1434

Closed pdpinch closed 4 years ago

pdpinch commented 4 years ago

Steps to Reproduce

  1. Create a user who has earned certificates in all the courses in a program, but isn't enrolled in the program
  2. View the user's dashboard

Expected Behavior

Actual Behavior

Stacktrace

A collapsible section with markdown

response from enrollments API: ```{ "past_program_enrollments": [], "program_enrollments": [], "past_course_run_enrollments": [ { "company": null, "receipt": null, "run": { "end_date": "2019-11-04T23:30:00Z", "title": "Introduction to Quantum Computing and its Applications", "expiration_date": "2020-02-02T15:00:00Z", "enrollment_start": "2019-06-24T15:00:00Z", "id": 18, "course": { "description": "

Course 1 of 2 in the Quantum Computing Fundamentals professional certificate program starts October 7, 2019. To earn a Professional Certificate and CEUs, you must complete the two courses in the program. For those who do not want to commit to the full program, courses can be taken on an individual basis for a certificate of completion and CEUs.

", "thumbnail_url": "https://xpro-app-production.s3.amazonaws.com/original_images/QCx_Course_1_Card-darkened.jpg", "readable_id": "course-v1:xPRO+QCFx1", "id": 11, "title": "Introduction to Quantum Computing" }, "courseware_id": "course-v1:xPRO+QCFx1+R3", "enrollment_end": "2019-10-14T23:59:00Z", "courseware_url": "https://courses.xpro.mit.edu/courses/course-v1:xPRO+QCFx1+R3/course/", "start_date": "2019-10-07T05:00:00Z" }, "certificate": { "link": "REDACTED", "uuid": "REDACTED" } }, { "company": null, "receipt": null, "run": { "end_date": "2019-12-16T23:30:00Z", "title": "Quantum Computing Algorithms for Cybersecurity, Chemistry, and Optimization", "expiration_date": "2020-03-15T15:00:00Z", "enrollment_start": "2019-06-24T15:00:00Z", "id": 19, "course": { "description": "

Course 2 of 2 in the Quantum Computing Fundamentals professional certificate program starts November 11, 2019. Learners may enroll in each course independently and receive a certificate of completion and CEUs. However, both courses are required in order to get the Professional Certificate in Quantum Computing Fundamentals.

", "thumbnail_url": "https://xpro-app-production.s3.amazonaws.com/original_images/QCx_Course_1_Background.jpeg", "readable_id": "course-v1:xPRO+QCFx2", "id": 12, "title": "Quantum Computing Algorithms for Cybersecurity, Chemistry, and Optimization" }, "courseware_id": "course-v1:xPRO+QCFx2+R3", "enrollment_end": "2019-11-18T23:59:00Z", "courseware_url": "https://courses.xpro.mit.edu/courses/course-v1:xPRO+QCFx2+R3/course/", "start_date": "2019-11-11T05:00:00Z" }, "certificate": { "link": "REDACTED", "uuid": "REDACTED" } } ], "course_run_enrollments": [] } ```

Screenshot or Screencast

From production:

image
asadiqbal08 commented 4 years ago

After looking into it, It does not seems me directly related to certificates but with the enrollment flow/procedure.

When all the CourseRunCertificates are generated then the corresponding ProgramCertificate is created automatically with the help of signal. So we have the CourseRunCertificate and ProgramCertificate in system.

So If a user enrolled himself in all courses of program but not enrolled himself in program then I did not see any corresponding signal that will create the ProgramEnrollment for that user too. Currently, I am getting this over the dashboard after executing above scenario.

So the questions are:

@pdpinch @ahmed-arbisoft let me know if I am overlooking something over it.

pdpinch commented 4 years ago

I discussed this with @gsidebo and we think the best thing to do is to create a program enrollment automatically for the user -- either when they enroll in each of the courses in a program, or when they get a certificate for each of the courses.

I think we can omit the order on the ProgramEnrollment in this case, since no purchase was made.

pdpinch commented 4 years ago

I chatted with @abdulkdawson and we think the best and easiest thing to do is to create the ProgramEnrollment automatically when the user earns the ProgramCertificate.

pdpinch commented 4 years ago

When a user enrolls individually in all the courses in a program, they need to get a program certificate.