Certificate (add-on)

 
 
Picture of Mark Nelson
The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi All,

This is an update on the development of the new module I have promised for some time now, sorry it has taken so long! It has taken many directions but I think I am heading in the right direction now. It is still in development, so do not use it, but any suggestions or help will be appreciated.

The current certificate module

 

Pros:

Highly customisable, users have complete control of the appearance of the certificate as they write the code responsible for the customisation.

Cons:

 

  1. Module settings are limited, does not provide complete control out of the box.
  2. Difficult to customise beyond what is offered in the settings.
  • User needs FTP access to the mod/certificate directory.
  • User needs PHP knowledge and an understanding of the TCPDF library.

Extremely unrealistic:

 

  1. You can not expect administrators to grant FTP access to every user who may want to create a certificate type.
  2. Even if FTP access was granted knowledge on how to use this access is required.
  3. Once accessed, an understanding of PHP is needed.

Can we upgrade?

 

Unfortunately no; this is a separate module. However, you can always have both installed on your site if you are currently using the existing one.

 

Reasons:

 

  1. The certificate types are highly customisable as users can write any code they wish in their certificate type and customise it to their liking.
  2. The new module stores the details of the certificate's appearance in the database. To convert the existing types I would have to interpret the code in each certificate type a user has created and copy this into the database - not possible.

The new custom certificate module

Pros:

 

  1. Highly customisable; without needing FTP access or PHP knowledge!
  2. All customisations can be done on your browser!

Cons:

 

  1. Still in development!
  2. I wrote it.

Setting up a custom certificate:

These are the only unique settings for this module on the initial settings page.

The reason not all the customisation is on this page is because it is a core Moodle page, the URL looks like <yoursite>/course/modedit.php?update=65&return=1. The file modedit.php contains a hook that loads the necessary files to install the module but does not allow complete control without editing core code.

Once a custom certificate instance has been added you can then click on the menu item 'Edit custom certificate' to be taking to the editing page.

The editing page:

Here you can add as many pages as you like, as well as elements. Once you have configured the setting as you wish you can save the template and then use this throughout your site so there is no need to customise anymore.

What's an element?

 

 

 

  1. A customisable item that can be added to the custom certificate.
  2. The item is a sub-plugin, which means it can do what other plugins do such as installing database tables, capabilities etc.
  3. Can easily share among the Moodle community. This means instead of users asking how to add a certain field to a certificate which usually ends in needing to write some code, users can simply create a plugin to share.

Complete Control

 

  1. What form elements are displayed when it is added to a custom certificate.
  2. How it validates and saves these elements once submitted, may want to save more data into a separate database table.
  3. How these elements are rendered on the PDF.

Hope this was clear to you all. Feedback and questions are welcomed.

 
Average of ratings:Useful (5)
Picture of Chad Outten
Re: The new custom certificate module.
Group Moodle Course Creator Certificate holdersGroup Testers

G'day Mark! The new certificate module looks good. I've got a few questions:

1. Is it being developed for M2.5.x?

2. When might it be available?

3. Will there be an upgrade path for those users on earlier version of the certification module?

4. Are there future plans to include this module in core moodle?

Let me know if you need some help with testing. Send me a PM.

Cheers, Chad

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Chad,

1. Currently I have been developing this plugin in 2.5+. However, once I have a working version I will test it on 2.3 and 2.4 and if there are no issues I will create branches for those on github that users can choose to use if they so wish. If there are any issues I will attempt to address them as well.

2. Hopefully soon! I don't want to give a set date though.

3. See the section in the first post named 'Can we upgrade?'. smile

4. This is hard to say. It isn't up to me whether it gets in core or not, so it would need to be approved by others. However, I know that at Moodle we are working to make it so that it is easier to install plugins through the Moodle interface (in 2.5 you can search, download and install modules entirely through your browser!) rather than bloating the current software with modules that are not necessarily going to be used.

I will post on this thread when it is ready for testing and if you would like you can test and report back any issues/comments, which would be much appreciated.

Regards,

Mark

 
Average of ratings:Useful (1)
Picture of Chad Outten
Re: The new custom certificate module.
Group Moodle Course Creator Certificate holdersGroup Testers

Ok, Mark. Keep us posted. Chad

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Forgot to add that the development of the certificate module is located at https://github.com/markn86/moodle-mod_customcert - click to watch this repository to keep up-to-date. smile

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

This is an example of a customcert certificate example I created. The editing page shows you the elements you have added to the certificate and lets you configure each one individually. The name column is a custom field you can give the element so you can distinguish between them. For example there may be two grade elements added to a custom certificate (like below), so two different names are used so it is quick to see which one you want to configure.

 
Average of ratings: -
Picture of Shane Elliott
Re: The new custom certificate module.
Group Developers

Hey Mark,

This is looking awesome. Definitely makes it far more usable for those who don't have any knowledge of HTML/PHP. I like the idea of the sub-plugins too.

Shane.

 
Average of ratings:Useful (1)
Picture of Jean-Michel Védrine
Re: The new custom certificate module.
Group DevelopersGroup Particularly helpful Moodlers

Hello mark,

With the latest versions of customcert, I had some trouble with the query lines 695-702 of mod/customcert/lib.php using Mysql, I had to replace

return $DB->count_records_sql("SELECT COUNT(u.*) as count

with

return $DB->count_records_sql("SELECT COUNT(u.id) as count

for it to work.

Sorry to post here but there is no component for customcert in the CONTRIB tracker.

I only have customcert installed on a test install of Moodle master branch.

 
Average of ratings:Useful (1)
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Thanks Jean!

I have switched my Moodle instances from using MySQL to PostgreSQL as PHPUnit runs a lot faster on this database, so missed this issue. Once the module is ready for live deployment I will have to test on multiple databases. I am glad you are using it on a test install, as currently it is in an ALPHA stage. One thing I want to improve is the postiion X and position Y parameters.

Regards,

Mark

 
Average of ratings: -
Picture of German Valero
Re: The new custom certificate module.
Group Documentation writersGroup Particularly helpful MoodlersGroup Translators

Hi Mark,

The custom certificate module looks very promising.

I wonder if you could add one English language string named modulename_help which describes what this module does. This string is displayed when a user of Moodle 2.3 and upwards uses the activity chooser to add a new activity within a Moodle course, and is very helpful to many teachers.

For example, the modulename_help for the lesson module is "The lesson module enables the teacher to create an adaptive learning experience consisting of a series of pages containing questions."

Thanks in advance.

 

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi German,

Thanks for your feedback. I am going to add this as soon as I come up with a suitable help message. I do prefer writing code over messages, but in this case I guess it is necessary. :D

Regards,

Mark

 
Average of ratings: -
Picture of Paul Cook
Re: The new custom certificate module.
 

Hi Guys, would be great to find a certificate block for Moodle 2.5 that works? Has anyone managed to get simple certificate working at all? PC

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Paul,

I think you mean activity, not block. Block's are completely different plugins. I am not sure about the simple certificate, you will have to ask the maintainer of that module about that. Please ask at https://moodle.org/mod/forum/discuss.php?d=228850.

Regards,

Mark

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Guys,

The module is now ready for some Beta testing for those who are willing to try it out. It will work on Moodle 2.3 onwards.

Please let me know if you have any feedback.

Regards,

Mark

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Sorry guys, found an issue in 2.3 with the userfield element and w/o some hacking it won't work. It now only works on 2.4 onwards.

 
Average of ratings:Useful (1)
Picture of Maria Madsen
Re: The new custom certificate module.
 

looking forward to this being released thanks

 
Average of ratings: -
Picture of Sebastian Henze
Re: The new custom certificate module.
 

Hello Mark,

I'm using the plugin in Moodle 2.5 and (without having customized it yet) it looks good. But some of the settings in the screenshots in your first post I couldn't find, e.g. the colours.

 

I want to insert my own images now, and I'm wondering what the ideal image resolutions are. The watercrest for example is 380x380, but it is stretched in the PDF. I want to insert an image that shouldn't be stretched. Could you help me with the ideal resolutions?

Thank you!

 
Average of ratings: -
Picture of Sebastian Henze
Re: The new custom certificate module.
 

Sorry, I didn't realize. It seems we still have the old certificate plugin installed, so disregard what I wrote.

 
Average of ratings: -
Picture of Sebastian Henze
Re: The new custom certificate module.
 

Okay, now the new plugin has been installed, and it looks really good! But every time I want to insert text or a name or something like that, I get a blank page. Is that an error that I could fix? Border and image seems to work just fine.

 I know this is still in development, so keep up the great work!

 

 

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Sebastian,

Thanks a lot for trying out this plugin.

Sounds like there is a PHP error happening. Are you able set debugging on your site to maximum (Settings > Site administration > Development > Debugging) and then visit the page and copy the error (if any) that is shown and paste it here.

Thanks!

 
Average of ratings: -
Picture of Sebastian Henze
Re: The new custom certificate module.
 

Hey Mark,

 

I activated the debugging, but how do I access it? There is no error message, I just get a blank page when I try to add text.

 

Sebastian

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

On the debugging page did you check the setting 'Display debug messages'?

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

I wasn't really happy with having to manually enter values to position elements, so am currently in the process of implementing a drag and drop interface to position elements. I will update you guys once it has been finished and ready for testing!

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: The new custom certificate module.
Group Particularly helpful Moodlers

Hi Mark. Great to hear that. I can't wait for its completion!

 
Average of ratings: -
Picture of Todd Jorns
Re: The new custom certificate module.
 

Could you add "Section" to your add elements box?  We would like to print certificates after each Topic or Section inside a course, not the course name.  Otherwise I have to manually type in the name of each module/topic/section in order to print.

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Todd,

The elements are sub-plugins, so it would not be difficult for someone to create a sub-plugin that displays the section name and share it, which will install just like any other plugin for Moodle. However, it's a good idea so I will create this when I get time.

Regards,

Mark

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: The new custom certificate module.
Group DevelopersGroup Particularly helpful Moodlers

Hello Mark,

Since you introduced the uploadimage new setting something strange is happening on the Moodle 2.6dev instance where I have it installed (this installation is updated from github both for moodle and for customcert)

Several updates after i's introduction, this setting is always considered as "new", so if I try to go to admin/index.php I am redirected to admin/upgradesettings.php and I see

upgradesettings

And there is no way to leave this page whether I try to upload a file or click on save changes.

Fortunately if I update the files for moodle or one of my plugins via gihub, I am still able to start the upgrade process, but at the end I always land on that damned page smile.

Is it a bug, or only a problem with my install ?

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Jean,

It's a bug. smile

I am experiencing it as well. I will hopefully have a fix up shortly.

Thanks!

 
Average of ratings: -
Picture of Pattie Steib
Re: The new custom certificate module.
 

Hi Mark,

I'm wondering if your module will have a way to restrict the usage of images so that they are not shared site-wide.  We have a certification logo that we would want only the trainer to have access to.  Will this be possible?

Thanks much,

Pattie

 
Average of ratings: -
Picture of Janez Troha
Re: The new custom certificate module.
 

Hi Mark,

I have try out your new custom certificate module and it is the best solution for me so far. Still I have one problem. Is there any option to center element (username) across the page? I want to print user name at horizontal center of page, but with fixed x position I get some strange results, especially with very long and very short names.

Thanks

Janez

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: The new custom certificate module.
Group Particularly helpful Moodlers

Hi Mark

> Cons
> 1...
> 2. I wrote it.
>

LOL(#2) !!! Haha. Gave me a good laugh this Monday morning!
wink

Thanks for your honesty
Frankie Kam

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: The new custom certificate module.
Group Particularly helpful Moodlers

Hi Mark

Thanks to you and the Custom Certificate module, I have managed to customise my Certificate for my English Placement Test. I do have one problem, though. The "Get your custom certificate" button, when clicked, always opens a new window and then proceeds to download the PDF certificate file. I would prefer for the PDF file to be displayed inside the opened new window.

How can I do this? 

Regards
Frankie Kam

 
Average of ratings: -
Sketch...
Re: The new custom certificate module.
 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: The new custom certificate module.
Group DevelopersGroup Particularly helpful Moodlers

Hello Luis

mod_certificate is the old activity module described in a lot of the other posts of this forum

mod_customcert is the new module written by Mark which is the subject of this thread.

mod_customcert is not officially released but it works quite well.

 
Average of ratings: -
Sketch...
Re: The new custom certificate module.
Group Particularly helpful Moodlers

Thanks Jean-Michel

Are there any plans (dates) for an official release of mod_customcert?

 
Average of ratings: -
Picture of Wendi Turner
Re: The new custom certificate module.
 

Thank you so much, Mark!

 
Average of ratings: -
Picture of sudhanshu verma
Re: The new custom certificate module.
 

Dear Mark,

The custom certificate looks good. When I click on the button 'Download grid' error page comes. It is difficult for me to calculate the correct X and Y position for any element for setup of the certificate  page. So is there any tool I can use to do this.

I would also request you to add the the alignment and formatting (Italic, bold,) option in the form for  elements except images. 

Looking forward to work with you on this plugin.

Thanks again for this plugin.

 

Thanks,

Sudhanshu

Ballistic Learning Pvt Ltd. India

 

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: The new custom certificate module.
Group DevelopersGroup Particularly helpful Moodlers

Well in fact even if this is not documented it is already possible to write elements in bold or italic adding b or i at the end of the font name. For instance timesi, timesb or timesbi.

 

 
Average of ratings: -
Picture of sudhanshu verma
Re: The new custom certificate module.
 

Thanks Michel. Can I do this from interface ?. I also want to add the alignment select dropdown in form. If any body know let me know how tedious is to do this.

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: The new custom certificate module.
Group DevelopersGroup Particularly helpful Moodlers

Hello sudhanshu,

Sorry my first response was not correct, I was not at home and spoke from memory, I have now tested and can detail more

Font style

The customcert module constructs its font menu looking in the font directory of the TCPDF library (it is lib/tcpdf/fonts) so if there exists a bold, italic (oblique) or bolditalic version of a font in that directory, it should appear automatically in the menu).

font menu

The TCPDF library included in Moodle have bold, italic and bolditalic versions for the following fonts: Courier, Free mono, Free Sans, Free Serif, Helvetica and Times

So you should see these styles variations in your font menu.

Note: Some of these fonts have a complete UTF8 character set and some other don't, so only UTF8 complete fonts can be used to write in some foreign languages (for instance arabic, chinese, ...). If you do a search in this forum, you will find some posts I wrote about this subject. The fonts with "free" in their name are complete UTF8 and should work for all languages.

Last thing: if the standard fonts included in TCPDF are not enough for your use it is possible to install additional fonts, see the TCPDF documentation to do that (but I must warn you, this is not very easy).

Text alignment

It would be possible to add a select menu for the alignment of each element, but that would not be easy and would require some work

The first problem is that each element is rendered inside a "cell" but currently there is no place where the width of this cell is specified so each cell extend to the end of the line (right margin for all left to right languages) so when you will choose center or right alignment maybe the results would not be what you expect !

The second problem is that you not only need to add a select menu to choose the alignment but also

  • a field in the database to store this value
  • an upgrade procedure to add the above filed to existing installations
  • code to store the value in the data base when the element is created
  • code to retrieve the value from the database
  • pass this value to the writeHTMLCell function that is used to render the text
  • ...

If you have some php knowledge it would certainly be an interesting project (but you would have to solve the cell width problem first) but to my best knowledge nobody in currently working on this and Mark seems very busy working on Moodle HQ projects.

 

 
Average of ratings: -
Picture of Mark Nelson
Re: The new custom certificate module.
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hey guys,

Sorry about my absence on these forums recently.

I have moved overseas and have gone from working full-time at HQ, to only part-time. At HQ we were fortunate enough to have a week every so often where we were free to work on our own Moodle related projects, the 'Custom certificate' activity being mine. However, since I am now only contracting I do not have this luxury which is the reason this project has not been updated in a while.

The foundation is there but it still has a lot of work to be done. However, I am not sure when it will be continued. Perhaps someone would want to take the reins?

Regards,

Mark

 
Average of ratings:Useful (2)
Picture of Wendi Turner
Re: The new custom certificate module.
 

If I may throw it out there, if we were to pool some money to pay for you to finish the email part of it, how much would you ask for? How much to perfect the whole project? I hope it is alright that I posed the question - the reality is that you need income to support yourself, and if you have to take on monetary jobs to forfeit a free job, it is understandable. So may I ask...what would your price be? I could not pay for it by myself,  but I would be interested in pooling together with others.

 
Average of ratings: -
Picture of Wendi Turner
Re: The new custom certificate module.
 

If I find someone to fix the email thing, I would be glad to post the script here that made it work, and it could be, at your discretion, added to the programming.

 
Average of ratings: -
Picture of Wendi Turner
Re: The new custom certificate module.
 

A fellow Moodler sent me a message saying he could fix the email thing. He said nothing more - whether he was offering to fix my files or the parent script, whether he was offering his services for hire and asking to be considered for the pooled amount. 

(Edited by Mary Cooch - to remove references to paid Moodle work -original submission Wednesday, 12 March 2014, 9:14 AM)

 
Average of ratings: -
Mary Cooch
Re: The new custom certificate module.
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hello Wendi. Sometimes people do send private messages about Moodle work and it is up to you whether you trust them or not.  For that reason it is not advised to discuss paying for Moodle work on the forums. In terms of Site policy, people are free to post job adverts in the Moodle jobs database rather than discussing in the forums.

 
Average of ratings: -
Picture of Wendi Turner
Re: The new custom certificate module.
 

Understood. I did not know about that policy and I was trying to be discrete for both the programmer and the Moodle community. I did not mean to go against the policies. Thank you.

 
Average of ratings: -
Picture of Ing. Edgardo Hdz. A. SS
Re: The new custom certificate module.
 

Hello Mark

I want to ask about the certificate module developed for you are simple questions or if any of the participants could answer me what they agradeseria .
Well the context of my questions is
I have installed moodle 2.5.2
In postgres and a and e module installed
My questions are
1. I am developing an alternative module to yours which is connected through servises web Moodle but this module performs some of the tasks described forum ie change the font and backgrounds plus a sheet and if my application would modify your original code module does this certificate I can do ? or what would you do to not incur licensing issues ? .
Two . You could modify the code of the custom certificate and what would that do to not incur licensing issues ?
Three . By modifying the code as custom certificate should give the code to post .
I appreciate the support and I agree that it is good parametric generation Realize certificate and want to modify the code module certificate complementary manner to orient could not incur licensing issues ?

 
Average of ratings: -
Picture of guillermo espinoza
Re: The new custom certificate module.
 

Hi I want to know if this module works in moodle 2.6 certificate. I am testing in local mode (localhost) and I have installed: 1.8.3-3 xampp.
The error goes as follows:
I detected a coding error should be fixed by a programmer: PHP catchable fatal error.

This error does when I see certified. I'm like full site administrator. The error it runs on: view.php

Greetings and thanks for your time.

 
Average of ratings: -