I want to enable automatic generation of certificates. I am trying to follow
but the described option does not exist in the Settings page, i.e. this:
In Studio, on the Settings menu, select Schedule & Details.
From the drop-down menu, select one of the following options:
Immediately upon passing
There is no dropdown that I can see in the Settings page of the course.
I have a certificate enabled and configured, and I can see the preview of the web/html certificate just fine as a staff, but I can’t figure out how to make it available to students.
Hey, to see the dropdown you must have the course set as Self-paced, it’s a setting you can find also in the Schedule & Details tab.
If the menu is currently grayed out for you then temporarily set the start date of the course in the future, then the choice will become active again.
Choose self-paced then revert back to the original start date you had set previously.
Other things worth checking to while troubleshooting this:
Make sure the certificate is not only created and has a template but is Active (right upper corner in Settings->Certificates, right next to the Preview button (sorry for no picture))
Make sure you’ve set the required Waffle Switch e.g. via the Django Admin Panel under django-waffle -> Switches -> Add Switch. Set the name to toggle_name from the source code below.
Make sure the user is enrolled in the course in the same mode the certificate is available in, if the user is enrolled in a different track, he may not see the certificate. You can also see the track for which the cert is generated, right next to the buttons mentioned in 1)
lms/djangoapps/certificates/config.py
"""
This module contains various configuration settings via
waffle switches for the Certificates app.
"""
from edx_toggles.toggles import SettingToggle, WaffleSwitch
# Namespace
WAFFLE_NAMESPACE = 'certificates'
# .. toggle_name: certificates.auto_certificate_generation
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: This toggle will enable certificates to be automatically generated
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2017-09-14
AUTO_CERTIFICATE_GENERATION = WaffleSwitch(f"{WAFFLE_NAMESPACE}.auto_certificate_generation", __name__)
# .. toggle_name: REDACT_CERTIFICATES_HISTORICAL_PII
# .. toggle_implementation: SettingToggle
# .. toggle_default: False
Note: As I am aware the learner-dashboard and learning MFEs have no polling to see whether the user has passed the course. There needs to be some kind of refresh/unit switch for new backend data to be fetched so that the button shows up.
The backend task of generating the certificate is launched from a check that happens each time a user’s grade changes (initiated by django signal / openedx event) - so that part is automatic.
Hey my bad, I just checked the code and the drop down menu is only visible in instructor paced mode.
In self paced as the name implies the certificates should just be generated now whenever the user has a passing grade.
# lms/djangoapps/certificates/api.py
def auto_certificate_generation_enabled():
return _AUTO_CERTIFICATE_GENERATION.is_enabled()
def _enabled_and_instructor_paced(course):
if auto_certificate_generation_enabled():
return not course.self_paced
return False
def can_show_certificate_available_date_field(course):
return _enabled_and_instructor_paced(course)
Did you try running a minimal test case? E.g. a course with 1 section/subsection/unit and 1 problem with grading for the subsection correctly configured?
To configure grading select one of the graders in the “Graded as” option in the subsection’s menu
Also how do you enroll your users in the course? The default enroll mode is ‘audit’ and so they won’t be getting the certificate if you enroll them e.g. through the instructor tab batch enrollment here:
as that does not pass any mode. In fact I just checked and you even wouldn’t be able to as some intermediate funcs called in this batch enrollment process don’t even have such an arg in the signature and don’t accept **kwargs.
So I’d suggest trying with an ‘audit’ certificate or enrolling users in the honor mode but that depends too heavily on the way you handle users for me to propose something.
# common/djangoapps/student/models/course_enrollment.py
@classmethod
def enroll_by_email(cls, email, course_id, mode=None, ignore_errors=True):
"""
Enroll a user in a course given their email. This saves immediately.
...
`mode` is a string specifying what kind of enrollment this is. The
default is the default course mode, 'audit'. Other options
include 'professional', 'verified', 'honor',
'no-id-professional' and 'credit'.
See CourseMode in common/djangoapps/course_modes/models.py.
...
but the doc says it must be enabled… The doc is confusing. Indeed, it “just works”. I simply had to confirm this with someone who had completed the course (not me).
The doc should state that for self-paced course, the certificate will just appear.