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

Generate certificate when all enrollment are passed #75

Closed
jbpenrath opened this issue Jan 13, 2022 · 4 comments
Closed

Generate certificate when all enrollment are passed #75

jbpenrath opened this issue Jan 13, 2022 · 4 comments
Assignees
Labels
Milestone

Comments

@jbpenrath
Copy link
Member

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
Joanie must be able to generate a certificate when a product contains one. But certificate delivery should be trigger only when the the student has passed all related graded enrollments.

Describe the solution you'd like

Feature

First we should add a BooleanField is_graded to the CourseProductRelation table to be able to take in account only some courses of a product for progression.

Then we should add a field to register the student progression to the enrollment model. An enrollment should passed, not_passed or None if user has not yet try to pass the course.

Once we have these two information, we are able to know when a student has passed all graded courses to deliver its certificate.

API

/api/certificates : a route to retrieve all certificates for a user
/api/certificates/:certificate_uid/download : a route to request the certificate document in PDF format.

Do you want to work on it through a Pull Request?
Yes

@jbpenrath jbpenrath added this to the GRADEO milestone Jan 13, 2022
@jbpenrath jbpenrath self-assigned this Jan 13, 2022
@sampaccoud
Copy link
Contributor

Should we record it in Joanie's db (and get synchronization issues as it is not really the source of truth?) or can we afford to query the LMS each time we need it (with some cache if necessary?)

@jbpenrath
Copy link
Member Author

jbpenrath commented Jan 13, 2022

Hmmm... that's sound good to keep LMS as the only source of truth. But currently, we should request the enrollment state when we retrieve user orders and this is something did regularly.

If we decide to request LMS to retrieve enrollment state, we have to build a good logic to avoid spamming :

  1. As you suggest we should cache the result (lifetime: 24h?)
  2. We should only request state for enrollment related to course run opened
  3. We should not request enrollment state if the certificate has been generated
  4. Maybe the route to retrieve enrollment state from LMS should return all users's enrollments at once ?

On the other hand, I think this logic does not scale well when we will plug Joanie with several LMS.

@sampaccoud
Copy link
Contributor

sampaccoud commented Jan 13, 2022

not 24h for sure... maybe 10 minutes max 😅 but anyway if you save it in joanie's db you will also not be in sync... Or maybe, since you are adding an endpoint in fonzie, OpenEdX can call the course run hook when something changes in the grade?

jbpenrath added a commit that referenced this issue Jan 21, 2022
Add a `is_graded` field to the course product relation to know if the related
course should be took in account to deliver a certificate.

#75
jbpenrath added a commit that referenced this issue Jan 21, 2022
Add a `is_graded` field to the course product relation to know if the related
course should be took in account to deliver a certificate.

#75
jbpenrath added a commit that referenced this issue Jan 21, 2022
Refactor Certificate model to generate document on demand then add an api
endpoint to list and get certificate.

#75
jbpenrath added a commit that referenced this issue Jan 25, 2022
Refactor Certificate model to generate document on demand then add an api
endpoint to list and get certificate.

#75
jbpenrath added a commit that referenced this issue Jan 25, 2022
Refactor Certificate model to generate document on demand then add an api
endpoint to list and get certificate.

#75
jbpenrath added a commit that referenced this issue Jan 25, 2022
Refactor Certificate model to generate document on demand then add an api
endpoint to list and get certificate.

#75
jbpenrath added a commit that referenced this issue Jan 27, 2022
Add a `is_graded` field to the course product relation to know if the related
course should be took in account to deliver a certificate.

#75
jbpenrath added a commit that referenced this issue Jan 28, 2022
Add a `is_graded` field to the course product relation to know if the related
course should be took in account to deliver a certificate.

#75
jbpenrath added a commit that referenced this issue Jan 28, 2022
Add a `is_graded` field to the course product relation to know if the related
course should be took in account to deliver a certificate.

#75
@jbpenrath
Copy link
Member Author

Closed by #86

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

No branches or pull requests

2 participants