Hello Everyone. I recently got course completion certificates working on my Palm/tutor instance.
I was asked if there was a way I could add an approximate course completion time (in hours) to the certificates for my courses, so that students could claim them for continuing-education credits.
I’ve seen people talk about manually modifying certificates in general, but here I’d need to modify the template so that it takes a value from a variable which is set on a per-course basis (it shouldn’t be the same for all courses.)
Is there a good way to do this? (It’d be even better if the variable were set in Django or somewhere within the web UI.)
Hi @JS777,
Yes you can. The best way is to set your custom variable in JSON format in the Certificate Web/HTML View Overrides advanced settings, and then use it in the template.
E.g., in the course settings:
I’m not sure how that could work though to create per-class hours?
I.e. I know I can create per-class variables like class_1_hours, class_2_hours, etc. But won’t there still be a single HTML-based template for all classes? And therefore there wouldn’t be a way to make each class’s certificate show up with a different number of hours?
(I should say that if the solution is to add like an “if(class1) then {${class_1_hours}}” or some sort of conditional logic like that in JavaScript, I don’t know JavaScript :-/)
If by class you mean course, in the terms of Open edX, then note that the Certificate Web/HTML View Overrides advanced setting is per-course. You can set a different value for each course while keeping a single certificate template for all the platform.
Ah, a per-course override would be awesome and exactly what I’m looking for! But I’m not sure if I’m looking at the same thing as you’re mentioning. There doesn’t seem to be a “Certificate Web/HTML View Overrides” option shown in Django in Palm.
The closes seems to be “Certificate html view configurations” (URL ending in admin/certificates/certificatehtmlviewconfiguration/)
I seem to have one existing entry in there: “{“honor”: {“certificate_type”: “Honor”, “certificate_title”: “Certificate of Achievement”}}” (picked up from somewhere here on the forums to make certificates the honor type by default).
So
am I looking at the right place?
how do I make an entry per-course within that place?
you mentioned, to the class Advanced Settings + adding the following to my certificate template, with a basic conditional check based on other stuff I saw in the file already.
<div class="accomplishment-regular-text subscript">
<p>
% if hours:
This class takes ${hours} hours to complete.
% endif
</div>
Now if a class has the hours set, it will be included, but other classes will just work the same until I figure out the hours.