Problem generating course certificates

I enabled certificates, but when I try to generate a sample certificate, I get the following message:


There is a problem with this certificate.
To resolve the problem, your partner manager should verify that the following information is correct.
The institution’s logo.
The institution that is linked to the course.
The course information in the Course Administration tool.
If all of the information is correct and the problem persists, contact technical support.

I checked the logs, and this is the error message:

lms_1             | 2020-04-22 03:33:23,027 INFO 227 [lms.djangoapps.certificates.views.webview] webview.py:533 - Invalid cert: User 3 does not have eligible cert for course-v1:edX+DemoX+Demo_Course.
lms_1             | 2020-04-22 03:33:23,499 ERROR 227 [util.views] views.py:154 - Error in django view.
lms_1             | Traceback (most recent call last):
lms_1             |   File "/openedx/edx-platform/common/djangoapps/util/views.py", line 145, in inner
lms_1             |     return func(request, *args, **kwargs)
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py", line 535, in render_html_view
lms_1             |     return _render_invalid_certificate(course_id, platform_name, configuration)
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py", line 665, in _render_invalid_certificate
lms_1             |     return render_to_response(INVALID_CERTIFICATE_TEMPLATE_PATH, context)
lms_1             |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 169, in render_to_response
lms_1             |     return HttpResponse(render_to_string(template_name, dictionary, namespace, request), **kwargs)
lms_1             |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 159, in render_to_string
lms_1             |     return template.render(dictionary, request)
lms_1             |   File "/openedx/edx-platform/common/djangoapps/edxmako/template.py", line 59, in render
lms_1             |     return self.mako_template.render_unicode(**context_dictionary)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/template.py", line 454, in render_unicode
lms_1             |     as_unicode=True)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 829, in _render
lms_1             |     **_kwargs_for_callable(callable_, data))
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 864, in _render_context
lms_1             |     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 890, in _exec_template
lms_1             |     callable_(context, *args, **kwargs)
lms_1             |   File "/tmp/mako_lms/baee6edff9ed87a96d20761eeb3c04a1/certificates/accomplishment-base.html.py", line 75, in render_body
lms_1             |     runtime._include_file(context, u'_accomplishment-header.html', _template_uri)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 752, in _include_file
lms_1             |     callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
lms_1             |   File "/tmp/mako_lms/baee6edff9ed87a96d20761eeb3c04a1/certificates/_accomplishment-header.html.py", line 29, in render_body
lms_1             |     __M_writer(filters.html_escape(filters.decode.utf8(logo_url)))
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/filters.py", line 78, in decode
lms_1             |     return decode(str(x))
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 226, in __str__
lms_1             |     raise NameError("Undefined")
lms_1             | NameError: Undefined

So I think the problem is the missing logo_url, but I have that defined –

  1. in the lms.env.json
  2. also in the admin console, under site configuration.

Does it have to be defined somewhere else? How can I further debug this? Thank you for your help.

From looking at the code, you should modify a " certificate html view configuration" in the admin: /admin/certificates/certificatehtmlviewconfiguration/

Make sure that there is an enabled configuration, and that the “default” entry includes a “logo_url” key.

Unfortunately that did not help. I’ve spent a few days trying to get this fixed. Is anyone available for a (paid) consultation to get this fixed?

I can’t afford the regular monthly contract, but would love to pay for a few hours of work.

Hello, in addition to what @regis says I had to add what it shows in the video to make the certificates work. I hope it helps you.

https://www.youtube.com/watch?v=IJvMjou8e64

1 Like

@regis
Hello, I would like to ask how can I change the template of a Course certificate and the badge icon?
I use tutor. I’ve found some guides, I’ve changed it but nothing happened at the end.

Thank you in advance

Badges-Certificates

Default images are supplied in Open edX for course completion badges.
Be sure to replace these default badge images with your organization’s own badge images before any badges are issued.
When the first badge is issued for a given course, badge images are uploaded to Badgr Server.
All badges issued in future for this course will use this uploaded original badge image, even if you subsequently change badge images in the Django Administration badge image configuration.
Access the Django Administration website for your instance of Open edX.
To do this, go to https://dev.mooc.edu.gr/admin .

  1. Select Site Administration > Badges > Course complete image configurations, and then define a course complete image configuration for each course mode on your platform for which you want to issue badges upon course completion.
    Examples of course modes are “professional” or “advanced” or “basic”.

For each course complete badge image configuration, set these parameters.
• Mode: The course mode for which the badge image should be used.
• Icon: The badge image to use for the specified course mode.

Important

Be sure to replace the default badge images with your organization’s own badge images before any badges are issued!!!

Optionally, you can define a badge image that will be used as the default badge image for any course modes that do not have an explicitly specified badge image.
To do so, in the course complete image configuration that references the image you want to use as a default, select the Default checkbox. After you save the configuration, this badge image is used for any course completion badge configurations that do not have a badge image explicitly specified.

Note
You can specify only one default badge image.
Save each configuration parameter and exit the Django Administration website.

  1. Create Course Event Badges for Your Open edX Instance

Open edX provides several customizable course event badges that can be awarded when any of the following events occur.
A learner enrolls in a certain number of courses.
A learner receives a completion certificate for a certain number of courses.
A learner receives a completion certificate for every course in a specified list of courses.
Before course event badges can be awarded, you must customize them with your parameters and badge images. To customize any of the course event badges, follow these steps. 

Access the Django Administration website for your instance of Open edX.
To do this, go to https://dev.mooc.edu.gr/admin .

2.1 Select Site Administration  Course Mode

Admin panel: Course modes -> Add course mode
fill in course ID: course-v1:dsfds+sfdds+dsd
select “honor” mode
fill in display name
fill in “0” under Price
fill in “usd” under Currency
rest stays empty

2.2 Select Site Administration > Badges > Badge Classes.
Add badge class (fill in slug from server, fill in display name, fill in course ID, fill in description, fill in criteria or link to course landing page, select “honor” mode, upload badge image)
Developer needs to award certificate to a test account (to get the slug from the server)
Also important for certificates: activating honor mode
To be done BEFORE anyone enrols on the cours
Add a badge class for each course event for which you want to issue badges.
Examples of course events might be enrolling in five courses, or completing three required courses.

For each badge class, set the following parameters.

Slug: A unique identifier that you choose to identify the badge class. This identifier can contain only numbers, lowercase letters, underscores, or hyphens. The slug, combined with the Issuing Component value, uniquely identifies a badge.

Issuing Component: Identifies the part of the platform that is issuing the badge. This identifier can contain only numbers, lowercase letters, underscores, or hyphens. For the three customizable course event badges that are included in the Open edX platform, the value for Issuing Component must be openedx__course (with two underscores). For course completion badges that are included in the Open edX platform, the issuing component value should be empty.

For new badge types that you create, specify an Issuing Component value that identifies the software component responsible for issuing the badge. For example, if badges are issued by the course management component, you might define Issuing Component as platform__course; if badges are issued based on activity in course discussions, you might define Issuing Component as platform__discussions.

Display name: The human readable badge name that is used when badges are shown to learners, for example, in the Accomplishments view of learners’ profiles.

Course ID: This value should be blank for course event type badges, as they are not associated with a single course.

Description: A description of this badge.

Criteria: A description of the criteria for awarding this badge.

Mode: The course mode for the course associated with this badge, if applicable.

Image: The badge image to use for this badge. Badge images should be square .png files less than 250KB in size.

An example of a badge class configuration might have the following values.
slug: enrolled_three
issuing_component: openedx__course
display_name: Enroll in Three Courses
description: Enrolled in three courses
criteria: A learner must enroll in three courses to receive this badge
image: triple_enrollment_badge_image.png

When you have finished defining the badge class, select Save.

  1. Next, you create a new course event badge configuration that defines all of the course event badges that you want to issue.
    Select Site Administration > Badges > Course event badges configurations > Add course event badges configuration.

Important

You can create more than one course event badge configuration, but you can only mark one configuration as Enabled. Only the most recently activated course event badge configuration is used.

Within the new course event badge configuration, set the following parameters.

Courses completed: Define badges to be awarded for completing a certain number of courses, or completion of specific courses. Define one badge per line. On each line, enter the number of courses that must be completed, followed by a comma and then the slug of the badge class to associate with this badge.

For example, to configure two badges, one that is awarded when a learner completes 3 courses, and another that is awarded when a learner completes 8 courses, you add two lines to the Courses completed field.

3,completed_three 8,completed_eight

where completed_three and completed_eight are badge slugs that you previously defined in badge classes.

Courses enrolled: Define badges to be awarded for enrolling in a certain number of courses, or enrolling in specific courses. Define one badge per line. On each line, enter the number of courses that must be enrolled in, followed by a comma and then the slug of the badge class to associate with this badge.

For example, to configure a badge that is awarded when a learner enrolls in 5 courses, you add this definition.

5,enrolled_five

where enrolled_five is a badge slug that you previously defined in a badge class.

Course groups: Define badges to be awarded for completing a list of specific courses. Define one badge per line. On each line, enter the slug of the badge class, a comma, then the list of course keys.

For example, to configure a badge that is awarded when a learner completes the 3 prerequisite courses in a series, you add this definition.

prereq_computerscience_badge_slug,course1_identifier,course2_identifier,course_3_identifier

where prereq_computerscience_badge_slug is a badge slug that you previously defined in a badge class, and course1_identifier, course2_identifier, and course3_identifier are the Course IDs for the three courses that must be completed for this badge.

When you have finished defining badges in the configuration, select Save.

To activate this configuration, select Enabled at the top of the configuration page.
Important
You can create more than one course event badge configuration, but you can only mark one configuration as Enabled. Only the most recently activated course event badge configuration is used.

  1. Admin panel: Link course -> Add link course (fill in course ID, select Organization, “Active” should be ticked)
  2. Admin panel: Certificate templates (fill in name, fill in template, select organization ID, fill in course key (ID), choose “honor” mode, tick "Active”, select “All languages”)
  3. Admin panel: Organizations -> Add organization (fill in Name and Short Name, “Active” should be ticked)
  4. To activate certificates
    Px TeachUPTU4_Creative_EL
    https://studio.dev.mooc.edu.gr/course/course-v1:dsfds+sfdds+dsd
    Studio: Settings -> Certificates -> fill in fields and upload signatures (Mode -> honor, “Active” should be ticked)
    Studio: Settings -> Advanced Settings -> Certificates Display Behavior: early_with_info
    Studio: Settings -> Advanced Settings -> Issue Open Badges: true
    To automatically award certificate, in LMS: Instructor -> Certificates -> Student-generated certificate
    Configuring Open edX Certificates in Studio |
    https://www.youtube.com/watch?v=IJvMjou8e64

Hello, thank you all
I would like to share with anyone might need a custom certificate template that works
I share my comment on Open Edx since i don’t know how to attach a file

The only think i cannot still find out is this Cannot see option View Certificates