The new custom certificate module.

The new custom certificate module.

Mark Nelson -
回帖数:117
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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.

平均分:Useful (8)
回复Mark Nelson

Re: The new custom certificate module.

Chad Outten -

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

回复Chad Outten

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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?'. 微笑

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

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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.

回复Mark Nelson

Re: The new custom certificate module.

Shane Elliott -
Core developers的头像 Plugin 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.

回复Mark Nelson

Re: The new custom certificate module.

Jean-Michel Védrine -

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.

回复Jean-Michel Védrine

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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

回复Mark Nelson

Re: The new custom certificate module.

Germán Valero -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 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.

 

回复Germán Valero

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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

回复Mark Nelson

Re: The new custom certificate module.

Paul Cook -

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

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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.

回复Mark Nelson

Re: The new custom certificate module.

Sebastian Henze -

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!

回复Sebastian Henze

Re: The new custom certificate module.

Sebastian Henze -

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

回复Sebastian Henze

Re: The new custom certificate module.

Sebastian Henze -

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!

 

 

回复Sebastian Henze

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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!

回复Mark Nelson

Re: The new custom certificate module.

Sebastian Henze -

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

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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!

回复Mark Nelson

Re: The new custom certificate module.

Todd Jorns -

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.

回复Todd Jorns

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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

回复Mark Nelson

Re: The new custom certificate module.

Jean-Michel Védrine -

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 微笑.

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

回复Jean-Michel Védrine

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Jean,

It's a bug. 微笑

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

Thanks!

回复Jean-Michel Védrine

Re: The new custom certificate module.

Pattie Steib -

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

回复Mark Nelson

Re: The new custom certificate module.

Janez Troha -

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

回复Mark Nelson

Re: The new custom certificate module.

Frankie Kam -
Plugin developers的头像

Hi Mark

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

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

Thanks for your honesty
Frankie Kam

回复Mark Nelson

Re: The new custom certificate module.

Frankie Kam -
Plugin developers的头像

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

回复Frankie Kam

Re: The new custom certificate module.

Ray Pierce -

Hello Mark,

This is an excellent plugin.

I mirror Frankies question. Is there a way to force the custom certificate to open in the window that pops up rather than an immediate download of the certificate. Users have become accustomed to seeing it this way and are confused with the blank window that pops up. Some don't notice that the file has been downloaded.

I plan on donating to the cause as well. This looks like you did a ton of work!!

回复Mark Nelson

Re: The new custom certificate module.

Luis de Vasconcelos -
Particularly helpful Moodlers的头像
回复Luis de Vasconcelos

Re: The new custom certificate module.

Jean-Michel Védrine -

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.

回复Mark Nelson

Re: The new custom certificate module.

Sudhanshu Verma -

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

 

回复Sudhanshu Verma

Re: The new custom certificate module.

Jean-Michel Védrine -

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.

 

回复Jean-Michel Védrine

Re: The new custom certificate module.

Sudhanshu Verma -

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.

回复Sudhanshu Verma

Re: The new custom certificate module.

Jean-Michel Védrine -

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.

 

回复Jean-Michel Védrine

Re: The new custom certificate module.

Todd Luger -

Does anyone know if it is possible to add fonts to the menu of options and, if so, how to do this?

I need to add the following two fonts: Arial and Palatino Linotype.

Thanks.

Todd

回复Todd Luger

Re: The new custom certificate module.

Todd Luger -

I was able to add the fonts but am now getting an error for one of them:

TCPDF ERROR: Could not include font definition file: palatino

The palatino fonts are definitely present on the server at this location: lib/tcpdf/fonts

Is this an issue with the cert plugin being unable to use the Palatino font?

Or is it a corrupt or incorrectly installed font file?


回复Todd Luger

Re: The new custom certificate module.

Todd Luger -

It appears that the certificate activity may have gotten corrupted when we replaced the defective fonts after assigning these fonts to a number of elements. I think this is the case because the Palatino font now works correctly in a brand new certificate activity.

I need to manually recreate a cert with about 40 elements in it to verify this.

Todd

回复Todd Luger

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Todd, please let me know how you go.

回复Mark Nelson

Re: The new custom certificate module.

Todd Luger -

Hi Mark

We were able to resolve all our issues with fonts and background images. I was able to perfectly match a certificate template from an outside agency and received their approval on it this morning.

If there are any issues I have left open on github, you can close them. 

Thanks for your help.

Todd 

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 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

回复Mark Nelson

Re: The new custom certificate module.

Wendi Daniels -

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.

回复Wendi Daniels

Re: The new custom certificate module.

Wendi Daniels -

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.

回复Wendi Daniels

Re: The new custom certificate module.

Wendi Daniels -

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)

回复Wendi Daniels

Re: The new custom certificate module.

Mary Cooch -
Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Testers的头像 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.

回复Mary Cooch

Re: The new custom certificate module.

Wendi Daniels -

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.

回复Mark Nelson

Re: The new custom certificate module.

Ing. Edgardo Hdz. A. SS -

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 ?

回复Mark Nelson

Re: The new custom certificate module.

guillermo espinoza -

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.

回复Mark Nelson

Re: The new custom certificate module.

Eric Smoyer -

This module is amazing and exactly what I am looking for but I cannot get it to display the certificates I get this error and debug code. I have done a lot of Googling and trial and error and unable to get it working. I hope this plugin is still maintained, it is too awesome to be abandoned! Any advice would be helpful. (I also posted in the GitHub, wasn't sure if either of these were still followed)


Can not find data record in database table customcert_issues.


More information about this error


Debug info: SELECT * FROM {customcert_issues} WHERE userid = ? AND customcertid IS NULL

[array (

0 => '134',

)]

Error code: invalidrecord

Stack trace:

line 1455 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown

line 1431 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()

line 45 of /mod/customcert/element/code/classes/element.php: call to moodle_database->get_record()

line 292 of /mod/customcert/classes/template.php: call to customcertelement_code\element->render()

line 127 of /mod/customcert/view.php: call to mod_customcert\template->generate_pdf()

回复Eric Smoyer

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Thanks Eric,

As discussed on github this has been fixed, but for anyone else who may be experiencing this issue I am commenting here to let them know.

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hey guys,

Shortly after writing that post I moved overseas to Canada to snowboard for a while (2 years to be exact!) and was only working part-time, so sadly I neglected this plugin.

I am now back in the HQ office and have had much more time (since I get project weeks) to make a lot of improvements.

For those willing to try it out please see https://github.com/markn86/moodle-mod_customcert and let me know how it goes. I will keep a look on this forum for any feedback.

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Chris Collman -

Hi Mark,

Hope you relaxed shredding the slopes during your hibernation and will have as much fun shredding code at HQ微笑

There are a few simple code things I am sure can be done but am clueless.  For example, how to we insert a static picture via the code in a custom certificate.  The specific request is for a seal, but I can see it might be for anything.   Another for your roundtuit list.

Best, Chris


回复Chris Collman

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Chris,

There is an 'image' element you can add to a custom certificate which allows you to upload an image to show on the certificate. Is that what you are after?

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Chris Collman -

Possibly but not exactly.  Here is what I hear:

Any time my certificate prints, I want my logo in a specific spot.  I do not want to leave it up to a teacher to remember to include it.  

I think if I could point to an image already uploaded as you mentioned, that would be great. But I want to hard code it into my custom certificate. 

There was another post of adjusting the stretching of an uploaded image without going into the code, I figured out both a code and non code work around for that.   But hard coding a speciallogo.png  to appear is beyond me.


Thanks   Chris


回复Chris Collman

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Chris,

You can create templates as an administrator that other teachers can then load when creating a certificate, so they are not required to continually create them. In this template you could position the image where you want it to be in every certificate. However, it is not currently possible to 'force' the image to remain in this place. If a teacher has the capability to edit a certificate, then they will be able to move it.

Hmm, maybe I should refer to it as a customcert to avoid confusion? 微笑

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Chris Collman -

Hi Mark,

Thanks to your insightful reply and a good night's sleep, I realize now that I was talking about a different certificate process.  It did not belong in this thread.  My apologies for making the classic new user mistake微笑  

Chris





  

回复Mark Nelson

Re: The new custom certificate module.

Tim Bahula -

I like this custom certificate module much better than the certificate module.


Elsewhere you mentioned that the administrator can create templates. Where can I do that?

回复Tim Bahula

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Thanks Tim.

It can be located at 'Site administration' > 'Plugins' > 'Activity modules' > 'Custom certificate'. There you will see the link 'Manage templates'.

Hmm, maybe I should consider adding another link on the activity page for admins.

回复Mark Nelson

Re: The new custom certificate module.

Arturs Polis -

Hi! I am wondering - does the custom certificate has a possibility to have it visible as an activity, but not accessible unless the accessibility prerequisites have been met (when they are hidden themselves)?
If not, wouldn't it be great to include this in the coming release?

回复Arturs Polis

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hey Arturs,

Sounds like you are talking about a feature that would be specific to core, not the activity itself. You can currently add conditions to an activity and have it displayed (but with no link) - my understanding if you would want these conditions to be hidden?

回复Mark Nelson

Re: The new custom certificate module.

Arturs Polis -

Yes. I am quite surprised that it is not possible to hide the conditions without hiding the activity. I am not sure if it could be useful for all activities, but for Certificate it definitely would, because we want to show it to students before the conditions are met.

回复Arturs Polis

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

I would create an issue at tracker.moodle.org and suggest this change in core. Activities have very little control over the course/view.php page and what details are displayed.

回复Mark Nelson

Re: The new custom certificate module.

Mary Evans -

Hi Mark, 

I was really impressed with the final look of the Certificate. What a brilliant plugin this is. 

I have had a question about adding fonts to the Certificate plugin,  in the Themes forum.. 

Can you explain 'in a nutshell' how you configure the fonts so that they display the Certificate as you want them to look, so that I can pass this information to the user?

Many thanks

Mary

回复Mary Evans

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Mary,

Thanks! Are you taking talking about the 'Custom certificate' module (new one) or the 'Certificate' module? 微笑

Certificate - The font you want to use is specified in the mod/certificate/type/<typeyouareusing>/certificate.php file by passing it to the function certificate_print_text(). This function accepts the name of any font in the font directory lib/tcpd/fonts.

Custom certificate - The font can be selected for each element (that uses text) in a drop-down. This drop-down is populated by the function \mod_customcert\certificate::get_fonts() which scans the directory lib/tcpdf/fonts for any fonts that may be used.

With the custom certificate module once the font has been added to the font directory you can choose it from the drop-down when editing an element. However, with the certificate plugin you will also have to edit the mod/certificate/type/<typeyouareusing>/certificate.php file and pass the name of the font to certificate_print_text().

If you wish to add a font to lib/tcpd/fonts please see http://www.tcpdf.org/fonts.php. I have not done this myself and simply use the fonts that ship with Moodle.

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Todd Luger -
Hi Mark

This custom certificate plugin is very useful, so thanks for building it.

I have been making good progress creating custom certs but have run into two issues:

  1. Is there a way to customize the background with color, image, gradient, etc.?
  2. When I create a user field, the element does not appear on the Rearrange elements screen.

TIA.

Todd


回复Todd Luger

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Thanks Todd,

1) No there isn't. The best solution I can think of is to use an image, but that isn't ideal if all you want is to change the colour. The best solution would be to create another 'background' element that you can choose to add to the certificate (or maybe not an element at all but a setting for the certificate). I need to think about this.

2) Having a look at the code now. It appears the field is only shown if the user currently rearranging the elements has a value for that field. So, if you chose 'Web page' but do not have one yourself then the value will remain as an empty string. This will need to be addressed.

If you could visit https://github.com/markn86/moodle-mod_customcert and create some pull requests to remind me to work on them that would be great! 微笑

Regards,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Todd Luger -

Hi Mark

I suspected what you explained for #2 and will test shortly.

I also just came upon another issue. The downloaded PDF file doesn't open correctly in Acrobat Reader on a Mac or PC. I had been previewing it in Preview on a Mac, so I did not realize this. Attached is a screenshot of what I see in Acrobat Reader and a jpg of what I see in Preview.

Todd

附件 Certificate_of_Participation.jpg
附件 Screen Shot 2016-06-27 at 1.31.31 PM.png
回复Todd Luger

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Wow, that is odd, and not good. Are you able to create an issue on https://github.com/markn86/moodle-mod_customcert/issues so I can make note that I have to work on it? If you are able to provide exact replication steps so I can do it on a new install that would also be awesome. I don't have much time right now for development as I am busy working on new features for 3.2 as well as GSoC, but when I do I will address any issues I find there.

Thanks!

回复Mark Nelson

Re: The new custom certificate module.

Todd Luger -

Hi Mark

I will be creating the issues at GitHub now. I can report that you are correct about the user field. As soon as I added data to that field for my account, it displayed on the certificate.

Todd

回复Mark Nelson

Re: The new custom certificate module.

Matt Walker -

I'm a bit of a Moodle newb, so I apologize if this question is ridiculous- I installed this module and was able to create a certificate that looks decent. But I don't know how to make my course use this certificate...how do I do that? Is there a setting somewhere I can tell Moodle to give a user the ability to download my new certificate when they complete my course? Thank you!

回复Matt Walker

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hey Matt,

Where did you create the certificate? Was it a template? To add it to a course you need to turn editing on then add the 'Custom certificate' activity to your course. Once you have filled out the form and added it you can then edit it - where you can choose to load a previously created template.

Sorry, can't help much more as there isn't enough detail for me to know exactly what steps you have taken.

Hope this helps,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Matt Walker -

Thanks- I found what I needed from that. I had my course set up as a single activity SCORM file (we're working on switching to Moodle from CourseMill LMS which just uses SCORM files), so I switched it to be topic based, and now I see where to add the certificate as a second activity. I was able to bring in the template that I set up in the settings for the certificate plugin. Thanks again!

回复Mark Nelson

Re: The new custom certificate module.

Colleen Jenkins -

I am having this same issue.  I configured the certificate to look how I wanted it to look (Under site administration > Plugins > Custom certificate).  I have clicked "Load Template" within this same screen.  Then I go to a course, add the Custom Certificate Activity, set no restrictions just so I can click and test it, and the PDF is blank.  I went back to the activity and hit edit to see if I could choose my certificate template and there is no option to do that.  Can someone point me in the right direction?

回复Matt Walker

Re: The new custom certificate module.

Emma Richardson -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

You want to look at completion settings and restrictions (check documentation).  You can set completion settings on your course activities and then make the certificate restricted until the user has completed the activities.

回复Emma Richardson

Re: The new custom certificate module.

Tony Johnson -

Emma,

From what I could see I have attempted the completion setting, restrictions, etc. multiple times with multiple sample courses and those variables (per the documentation) see to be setup correctly.

I also changed permissions to 644 on the cert plugin and it crashed moodle. I changed it back to 755 and moodle worked, but the completion cert still doesn't.


Tony



回复Tony Johnson

Re: The new custom certificate module.

Emma Richardson -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Is cron running?  Cron is needed to update the completion info.  Does the scorm show as completed?  Is it actually completed?  Is the certificate just dependent on the scorm being completed?  Can you post screenshots of your completion settings and restrictions?

回复Mark Nelson

custom certificate module - prints blank

E Tonini -

Thanks for creating this plugin!

I've installed the custom certificate module (dragged the zip file onto add plugin) and designed it (created template) in SiteAdmin > Plugins > Activity modules.  When I preview the certificate from there it looks perfect.  I added it to a course.  However, when I click "Get your custom certificate" it generates a completely blank white PDF.  Is there something Admin/system wide that needs to be On/Set/Installed?

Moodle 3.1, Windows 10

回复E Tonini

Re: custom certificate module - prints blank

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
Hi E Tonini, can you turn debugging mode on your site (see https://docs.moodle.org/31/en/Debugging) and check if there are any errors being displayed when you click on 'Get your custom certificate'.
回复Mark Nelson

Re: custom certificate module - prints blank

E Tonini -

Thank you for your help, Mark.

I turned debugging mode on, selected both ALL and DEVELOPER, and checked the box for "Display debug messages."  I went back into the course and clicked "Get your custom certificate." The certificate was the same blank page. Nothing pop-up by way of debug message.  I've never used debugging.  Do I need to do something to check for the messages?

回复E Tonini

Re: custom certificate module - prints blank

Richard Rahn -

We're having exactly the same issue. We created a custom certificate template, and it looks fine in preview mode. We then added the Custom Certificate activity in the correct course, completed the initial information, and saved it. But when we select "Get your custom certificate" the PDF created is blank.

Based on the comments above, we're missing the step of connecting the template to this activity, but I can't find anywhere to do that. When I select the "Edit" option for the Custom Certificate activity, it displays the original setup page, but there's nothing on that page that I can see that will allow me to select the template. What am I missing? Is there somewhere else I should be looking?

回复Mark Nelson

Re: The new custom certificate module.

jon sharp -

Hi Mark

In the std certificate module – there are activity specific fields for 'Text options' etc which includes 'Print Credit Hours' etc.

How is this done with new one?

thanks


回复jon sharp

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Jon,

Simply add a 'Text' element to the 'Custom certification' on the 'Edit custom certificate' page.
回复Mark Nelson

Re: The new custom certificate module.

jon sharp -

Hi Mark

Does that mean that you need a custom template for each course where the number of hours are different (I was planning to use same template on a number of courses)?

If so, might be good instead to have a set of non-specific user vbls in the activity-specific config (rather than the existing 'Print Credit Hours'), which the designer can use as required, per activity.

BTW It would be good to be able to edit coordinates & font face/size in one place, (viz customcert_elementstable table). GUI is good but need that easier access and finer control too.

回复Mark Nelson

Re: The new custom certificate module.

Christian Parraga -

Hello Mark:

I have two questions

First, I've created the certificate activity in one course and I wanted to use the same one in another course, but I can't. Is there a way to add that certificate created in a course into the template manager?

Second, Suddenly all issued certificates became 0, I was trying to fix a problem and I run cron:

http://site.example.com/admin/cron.php?password=opensesame

After this, issued certificates are 0 and when I try to verify it gives me error, do you know what happened?

回复Christian Parraga

Re: The new custom certificate module.

Is NP -

I have a similar problem.

I created the certificate activity in the course, configured it and the certificate looks good but when I click on the activity it always says certificates issued 0 and when trying to validate the code in the certificate, it is not valid (lthough students can download them).

I would appreciate some help with this issue.

Regards!

回复Christian Parraga

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Christian,

1) That's a good idea. Currently the only way would be to create a site wide template first, but I can see a lot of people creating a template on one course then wanting to continue using it but being unable to. Perhaps a feature to save a certificate as a site wide template? I created https://github.com/markn86/moodle-mod_customcert/issues/68 to deal with this.

2) No idea why the cron would change anything related to the issued certificates .. currently the customcert module does not do anything during cron. Are you able to replicate this?

Regards,

Mark

回复Mark Nelson

How to return to course menu after generating custom certificate?

Daryl Moon -

Hi Mark, thanks for a great plugin, I managed to design an nice template and add a link to the activity (custom certificate) within my course, no problems with that part< I can create the cert fine.

The problem I am having is the user navigating back to the course, to complete the next activity (Course Feedback).   In the picture below you can see that all the user sees is the Course Administration menu.  They don't have the options for continuing to the next topic in the course.

Certificate menu


The second pic shows the four activities in the course:


How do I either turn on a "Return to Course" button at the bottom of the print your certificate activity or have the menu on the left list the four activities and allow the user to easily navigate to the last activity?

thanks

回复Daryl Moon

Re: How to return to course menu after generating custom certificate?

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Daryl,

That is odd.

Is this not the same navigation for the other activities as well? The mod_customcert activity should be using the same page layout as the other activities, so it's surprising to me that one would display differently (navigation wise) than another. Also, do you know what course format you are using?

Cheers.

回复Mark Nelson

Re: How to return to course menu after generating custom certificate?

Daryl Moon -

Thanks Mark, I changed to a topics course format and the problem is now resolved, thanks for the tip.

回复Mark Nelson

Re: The new custom certificate module.

Alejandro Ortiz López -

Hi, Mark

thanks for your efforts and useful plugin.

I'm experiencing one issue: My site runs in spanish and randomly after I've setup the date format it starts appearing with the MONTH in english:

date setup


(some time later):

date error

I would appreciate any guidance, help, prayers or good vibes on this matter.

Thank you all.

Alejandro Ortiz

回复Alejandro Ortiz López

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
回复Mark Nelson

Re: QR Code

Justin Cloete -

Hi Mark

First off, I have just downloaded this plugin and I must say well done it looks great and the fact that it works with the app is a huge plus.

I have one question/request would it be possible to add a unique QR Code (based on the certificate number) to each certificate which allows prospective employers to verify the authenticity of the certificate, similar to the "Simple certificate plugin".


回复Justin Cloete

Re: QR Code

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Justin,

I think you are talking about mod_certificate, and not mod_customcert, as mod_certificate supports the mobile app and mod_customcert does not (at this stage). I am no longer working on any new features for mod_certificate but will happily merge a patch if you come up with one.

Cheers!

回复Mark Nelson

Re: The new custom certificate module.

Ray Pierce -

Hi Mark,

I posted a reply to Frankie Kam but should have posted here.

This is an excellent plugin.

Is there a way to force the isued certificate to show in the window that pops up? Currently there is a blank window and the PDF immediately downloads. Some are confused by this since they have grown accustomed to the Moodle Certificate I have been using on my site. It shows the certificate and allows them to print it from there.

Thank you for any help.

Ray

回复Mark Nelson

Re: The new custom certificate module.

Abhishek nath -
How can i assign template to courses. If i have multiple custom certificate templates then can i assign each template  to a different course.
回复Abhishek nath

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
You need to create the custom certificate activity in the course, then load the template (on the same page where you add elements you will see a select box at the bottom).
回复Mark Nelson

Re: The new custom certificate module.

Abhishek nath -

Thanks Mark for the reply.

 I wanted to know if can i assign different template to different course.

回复Abhishek nath

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

You don't assign templates to a course.

Currently templates are either assigned to a custom certificate (course module context) or they are assigned to the system context (via manage templates page). You can load site templates from within a course but you can not load a template from one course module, to another. If you wish to do this I suggest backing up the activity and restoring it in a new course.

HTH,

Mark

回复Mark Nelson

Re: The new custom certificate module.

Emma Richardson -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Couple of questions:

Has anyone found a way to duplicate a template?

Is there a way to have text align to center - I have some very long course names that overflow onto a second line and this is always left justified - is there way to center the output?

Oh, also, is there anyway to have the text be underlined?

Also, a bug.  When you upload a new image to be used as a background, you have to save and exit the screen and then go back into the edit screen before you can add the new image as a background.

 

回复Mark Nelson

Re: The new custom certificate module.

Rich Stevenson -

Hi Mark

I am having problems with the Restricted Access section on the certificates.


I have set up restricted access to a certificate so that it is not available until the User Profile field, which has a text variable defined as "Data Protection", is set to "Passed".


I have forced the variable to equate to Passed, yet the certificate restriction remains in place and I can not stop this from being hidden.


Has anyone else encountered this issue and if so, is there a workaround?



回复Rich Stevenson

Re: The new custom certificate module.

Rich Stevenson -

Hi Mark


To follow up on my previous question, it actually appears the restrictions on ANY user profile fields does not work.

 

Richard


回复Rich Stevenson

Re: The new custom certificate module.

Mark Nelson -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像

Hi Rich,

The plugin does not have any control over this, ie it is in-built in core so that any module can take advantage of it. If you can replicate the issue using another activity on a site like qa.moodle.net and it is still an issue please create an issue on tracker.moodle.org with exact replication steps so we can create a fix.

Thanks!

回复Mark Nelson

Re: The new custom certificate module.

Arshbeer Gill -

I tried to download certificate plugin but it shows error(page not found).

Suggestions please, i'm very new to moodle.