Certificate 3.2 for Moodle 1.7

Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Number of replies: 48
Picture of Core developers

Here's the latest verison ready for testing in stable 1.7.  I've added some roles functionality--more could possibly be added later.

It is set to print the first teacher assigned to the role of editing teacher in the course.

Please test this.  I've coded this on a fresh install of the latest 1.7 version.  I have not tested it when upgrading from 1.6, soooo let me know.

NOTE: this version cannot be upgraded from the old version that was used with Moodle 1.5+ -- you MUST uninstall the old certificate first.
Average of ratings: -
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Chris Collman -
Picture of Documentation writers
I will be at my work localhost that has a clean version of 1.7 in another hour.  I will be checking it out and will post comments here.   Definately a halo.   Thanks - Chris
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Chris Collman -
Picture of Documentation writers
Hi,
Certificate is something my site administrator plays with.  However, 3.2 looks pretty good.   Only issue I see, is which teacher prints on the Certificate in 1.7.  Looks to me as if it is the last teacher assigned.   I played around with 4 teachers, deleting and adding them in different orders.  I thought we could set the teacher order in 1.7 or is that 1.6.2 ?  Could not find it, could only play around with assigned roles in the .

I will review the install instructions for 1.7.  My old habits of going to the admin block did not load Certificate.   Kept going to Modules->Activities and looking for it upon exit.   I forget that is what the notification link is for at the top of the administration block.  

I did turn on the save certificate and there were the certificates in various folders. 

Did not check the email teacher on my localhost.

Did I mention there were no error messages for either students nor teachers.

THANKS - Chris
In reply to Chris Collman

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
You're right, the roles in 1.7 have messed up my nice code to print the teachers in order (I would like to know how to set order in 1.7--I think we need that capability).  Anyway, that will have to be worked out as the roles code develops I guess.

Thanks for testing.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Chris Collman -
Picture of Documentation writers
I put in a question in general problems forum.  If no body picks it up I will throw it into Bug Tracker.   My little non developer brain say teacher order is important in some courses or training  certification  situtations.  

Is your code based on a unique course teacher id (perhaps the largest?), not to be confused with the user id or what ever it is called in the db.   If this is true, you might want to set it to the lowest id.   This way who ever is entered in as the first teacher, gets the honor of the signature.   The last entered teacher is a little confusing to bald guys smile

Yeah how do you tell the difference between a course creator, editing teacher and non-editing teacher?   I am not going to go there.

Chris
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by David Edwards -

Hi Chardelle

I have been playing and just downloaded the new stable release called moodle 1.7 beta (2006101000) and tried to run your certificate mod and received this error.

This SQL relies on obsolete tables! Your code must be fixed by a developer.

I think the problem is in the earlier version of moodle 1.7 dev (2006092800) there was a table called user_teachers which does not appear to be in the new release. Infact the dev version had 182 tables and the new version now has 178 tables. I do not know if that was a mistake on releasing the new version of moodle .

Good news is your previous version of certicate 3.1 beta works on the stable release of moodle 1.6.3 (2006050530) but still getting the FPDF error: some data has already been output to the browser, can't send PDF file.

But if you wait a few seconds or little longer and click the reveiw your certificate button it appears with no problems. Also the teacher name does appear .

I am going to install your new certificate 3.2 on the newest release of Moodle and see what if I get any errors.

Does your certificate mod require the table user_teacher???

Thanks again for all your work and effort.

 Just installed your new verision of certificate and it seems to work even showing the teachers name. Looks like the table user_teachers is not required for this.

Will keep testing.

In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by David Edwards -

Hi Chardelle

Really like what you have done. This is great. I have this working now in 1.6.4 and the latest 1.7 version.

I am also changing some of the code for my own needed certificates and adding an option of putting crests in the top left and right corners of the certificate. If you would like the code after I have finished this let me know and I will send you a copy for your review. I will leave your exsisting code intact so nothing will be lost of your great work.

I have one question about your certificate but do not know if this can be done as I am not very strong in php coding.

Here is my question? When I teacher logins and they click on the certificate would it be possible for that teacher to print all certificates for the course all registered users of that course. ??

Thanks

Dave

In reply to David Edwards

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Since the certificate prints the name of whoever is logged in, then it could only be done by logging in as the student.  Or, if you have the save option set, and the students have already received their certificates, the teacher can print the certificates from the links in the report page.  Another option is to have a certificate that is customized with an enter form, and the teacher can enter each student's name into the form field, then print the certificate.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Chris,

The code for printing the teacher is at the level of the mod.  Did you set the role of teacher at the module level?  Do this if, for example, you have more than one teacher for the course or you have more than one certificate in the course and you want them to print different teacher names.  Click to edit the certificate, then click on the Roles tab.  Then assign the role of editing teacher (teacher) to the certificate (they do not HAVE to be a teacher in the course--you can assign that role to anyone).  That person's name will print on the certificate for teacher. 
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Mike Coville -

First off let me say thank you for this module,it has been a huge benfit for my company in our use of moodle.

Now the reason for my post is a request for a feature. Is there a way to have the certifcate look for a numical grade before it allows a student to recieve the certificate? We would like to set a grade number that the student must meet or exceed before the certificate module will give them their certificate automatically.

I am sorry if this was posted anywheres else but I could not find it, or if this has been addressed in a previouse discussing as I am new to moodle and have onyl been using it for about a month.

Thank you and continue the good work.

In reply to Mike Coville

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Mike,

Unfortunately, conditional activities are not currently part of Moodle core, but it is planned for the future. However, locking the certificate based on a grade can be done with any of the various activity locking hacks that are now available. See the Conditional Activities forum for more information.

Alternatively, you can contact me about contracting for a custom certificate that will hide the certificate until a set grade is achieved.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle

Thanks for a great module.

I have a question: how can I translate the date in the certificate? It's always displayed in English and the names of the months are not in the language file.

On another note: you mentioned testing when upgrading from 1.6, well, that's what I've been doing and the only issue I've seen so far is that the name of the teacher who was last added to the course (in 1.6) is always displayed on the certificate. Taking away this user's role as a teacher doesn't change a thing and neither does setting another user as teacher at the module level for the certificate. Even when I manually erased this user's role as a teacher from the database (yes, that was a smart move), his name kept creeping in on the certificate. But anyway, it's no big deal. I just type their names above their signatures in the PNG ;)

All the best
Ned
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Ned,

Thank you for testing it when upgrading.

As for the date, it doesn't take the dates from the lang file, it pritns the date from the language that is used in your site. (For example, after receiving a certificate, what date is shown above the preview button?) I have not tested the dates in 1.7. I'll do that. Also, if your language has umlauts/accents you might want to try the unicode type from the link above in order to get the months to print properly.

As for the teacher role, I wonder if that has something to do with the new roles code when upgrading--that is something I will also look into. However, it should only print the teacher(s) names that you have set in the module setting.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle

I checked and it always shows the date in English above the preview button, no matter which language was selected on the front page (we have 5 languages, English is one of them).

Thank you for referring me to the unicode type. That'll come in handy with those 5 languages ;)






In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi again Chardelle

Could you point me in the right direction to generate a certificate in Chinese?

Thanks
Ned
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Ned,

Try the unicode type (the link is at the top of this post). Instructions are in the zip.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle

I tried that but I don't know what to put in certificate.php, eg for $string['titlelandscape']: I can't put any Chinese symbols there

Thank you
Ned
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Of course you can Nedsmile That's the reason I created the unicode type (that and for printing the date). Simply open the file in a text editor and then copy and paste what you want to print on the certificate into certificate.php. Look at this post: http://moodle.org/mod/forum/discuss.php?d=51494#239444

you'll see an example unicode certificate with characters in the second line (from a language string in lang/certificate.php). All I did was copy and paste the characters from a .txt file I had into the certificate.php file for the string.

Here's a screenshot as an example.
Attachment langfile.gif
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle

Thanks for bearing with me.

I think I am now where you are: the pdf generates some Japanese characters (that's what I believe the characters in your screenshot to be) but, at least with me, no Chinese characters.

せんせい (sensei - "teacher" in Japanese) is generated but 结业证书 ("Certificate of Achievement" in Simplified Chinese) fails to appear (what appears are 4 small rectangles)

I noticed I'm running PHP 4.4.2. Could that have something to do with it?
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi ned,

No, that probably isn't it, although tcpdf has recently been upgraded so I will upgrade it for this package and let you know when that is available. I think that for Chinese, you will have to convert your chinese ttf to a font that can be used with this program. This converter runs only off unix, so if you can access unix commands, send me an email with your email address and I will send you the font converter.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle

I sent the email. Thanks for your suggestion.

Do you recommend installing zlib to speed up tcpdf?
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Ned,

Okay, sent the zip, let us know how it goes. I will upload the latest unicode files for PHP4 later today.

Tcpdf does require zlib.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
Hi Chardelle,

I've recently upgraded to php-4.4.4 and now I get the following error when I try to view the certificate:

TCPDF error: Some data has already been output to browser, can't send PDF file

Nothing more. I tried upgrading to the latest version of tcpdf but to no avail. Have you dealt with this error before?

Thank you for your help,
Ned


In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi ned,

I assume you are running Moodle 1.7+.

Could you tell me what version of the certificate you have.
and
If you open the tcpdf.php file in the tcpf folder, and tell me what version of tcpdf you have.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
I think I'm running the latest version of the certificate : Version 3.2 20061012

Now I'm running tcpdf version 1.53.0.TC030_PHP4 but I had the same problem with 1.53.0.TC026_PHP4

my moodle is an early 1.7 stable
In reply to ned moltoya

Re: Certificate 3.2 for Moodle 1.7

by Leonardo Terra -

Are you using debug options in moodle?

If you are, try disable this.

You can try certificate 3.3 or 4.0+ to.

In reply to Leonardo Terra

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
solved!

I set debugging to the max and it showed the lang file with trailing spaces. Thanks for the hint!

in the meantime I also upgraded to php5 (still with certificate 3.2) and it keeps working. I'm now going to replace tcpdf for php4 with the one for php5. See if it speeds up things...
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Chris Collman -
Picture of Documentation writers
I added a link here from Certificate in Certificate_MoodleDocs for a download. I didn't have any problems installing it but don't think I needed the unicode file when I tested this in one of my localhost 1.7 files.

Chardelle might want to glance at what I did. Thanks Chardelle for your efforts.
Can I ask you (Chardelle) for some version of conditional activity for 1.7 to go with certificate..... delivery in the next couple of hours would be nice evil . (Just kidding). - Chris
In reply to Chris Collman

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Oh you're hilarious Chris smile.

Thanks for the docs, I made a couple of little changes. No, don't use the unicode type unless you will be using it with languages that use umlauts, accents, characters, etc. And, for those who do use it, you will probably need to set your locale in your language settings to get it to print the correct date.

As for locking--obviously we need something that will tide us over until the Moodle core code fully supports conditional activities. I am working on a version that will lock based on an activity grade, course grade, or completing feedback--it should be done tomorrow or so, HOWEVER, this version will not be released as open source, so contact me for more info.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Dan Hilke -
Do I understand correctly that there is no Activity Locking yet for 1.7??

I thought I'd finally make the jump from 1.5.3 to 1.7, but I depend on Completion Certificates for my courses, and I don't think I can use the 'dependency' method of locking mentioned in the Tips & Tricks. I need to lock the Certificate based on a passing score for a whole bunch of Lessons and Quizzes (or an overall course grade would work).

Is this still not possible yet for 1.7?
(It's hard to know for sure, from mining through the forums... Thank You, to anyone that can offer an "as-of-today" status.)

Dan

In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Lewis Kohl -
Can we get step by step installation instructions for a freshly installed Moodle version 1.7 please?
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Talking Jazz -
Hi,

I´ve tried and installed both versions of certificate on my 1.7.moodle: 1.6 and 1.7.

So far, 1.6 seemed to be more comfortable because I hat 4 options for the kind of certificate I wanted to use. There´s no such option in version 1.7.

But there ist THE SAME PROBLEM with both versions: If I write a name of a student into the certificate (the student I want to make the certificate for), only the name of the admin is printed. sad

My question: Is this a bug or a feature?

Thanks for your time!

TalkingJazz
In reply to Talking Jazz

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Dan,

No, there won't be any conditional activities in Moodle core until 2.0. Until then, please contact me regarding a locked certificate.
In reply to Talking Jazz

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Talking Jazz,

Everything in 1.7, should be the same as 1.6, except for an update for printing "teacher" names. There should still be the four default types in the type folder.

An option for typing in the student name is not available--the certificate will print the name of whoever is logged in and getting the certificate. However, this could be accomplished with a customized certificate.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by John C -

Hi,

I am a newbie and in the process of setting up Moodle 1.7. I am struggling with the certificate. I would like to add the certificate module. In looking through the forums, I saw a number of different versions of the certificate module. I downloaded and tried some of the versions but did not get them to work. Can someone tell me what is the most current link and where I can find it as well as the most recent instructions on how to load and to customize the certificate? Thank you. Any help will be greatly appreciated.

In reply to John C

Re: Certificate 3.2 for Moodle 1.7

by yur kra -

hello, i also have a probelm with the certificate mod, it installed perfectly, but when i go to the add block, it just has verify certificate. not the certificate block. am i doing somthing wrong or is there some other problem.  thanks. God BLess.

In reply to yur kra

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
I'll be double checking the zip files, etc. in the next couple of days and get everything organized, including adding more info about installing, customizing, etc.

Yur, the verification block can be added to a course if you want to be able to verify a code # from a certificate (this can also be done through the report link in the upper right corner of the view page). To add a certificate to a course, you should see Certificate in the Add an Activity drop down in the course sections.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by yur kra -
hello,  thank you so much Chardelle for your reply, Iam still unable to add the certificates to courses. i checked in the add activity block and did not see certificate. Thank you for all your help. God Bless.
In reply to yur kra

Re: Certificate 3.2 for Moodle 1.7

by yur kra -

hello Chardelle,

 please disregard the above, i have finally figured it out. the problem i have no is linking my scorm files to the certificate. i am trying to configer when a scorm lesson is complete the certificate prints. i read the instructions, but i cannot get the scorm file to be the dependent file. is it possiple to link the scorm and the certificate mod. thanks and GOD BLESS.

In reply to yur kra

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Ok Yur,

Unfortunately, that is not possible with Moodle yet. However, the Certificate Pro version does include locking a certificate based on passing a graded activity.
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by yur kra -

hello, i checked out the pro moodle, i have no idea what that is. and also how does the activity locking work. and what would i need to install it.

once again think you for all your help. God bless.

In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Genie Wu -

Hi Chardelle,

First of all I'd like to thank you for all your wonderful work with the certificate module.

I checked out the promoodle website and I am kind of interested in it. Unfortunately, there isn't much information on their moodle about who they are and where they are, and maybe a demonstration of the certificate pro mod.

I've used scoreLock+certificate. The certificate cannot be completely locked. I am thinking about trying the latest version of activity locking with certificate. I have never tried activity locking. What would be the best tool combination in your opinion for the time being to lock the certificate?

Thanks,

Genie 

In reply to Genie Wu

Re: Certificate 3.2 for Moodle 1.7

by Leonardo Terra -

Have you tried Certificate 4.0? Certificate 4.0 has options to block certificate emission based on grade.

In reply to Leonardo Terra

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
Hi Genie,

That particular version of the certificate is mine. Yes, you have a couple of options, you can try the activity locking--I haven't had time to yet. The one Leonardo is referring to is the module I originally created with some changes.

However, just to let everyone know. Some moodlers are working on updating the certificate mod for 1.8, you can read more in the docs http://docs.moodle.org/en/Development:Certificate_Module

Locking is planned, as well as some other cool options like adding text when your create an instance of the certificate. So, if you can wait....

I should put a caveat here for anyone using Leonardo's version. I' can't be sure if it will be upgradable to the new certificate for 1.8.

In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by ned moltoya -
when restoring a course with a certificate from a backup I got the following error message (debugging set to max):

Notice: Use of undefined constant restore_userdata_selected - assumed 'restore_userdata_selected' in /www/www.learn2speak.eu/mod/certificate/restorelib.php on line 57


and when deleting such a course:

Notice: Trying to get property of non-object in /www/www.learn2speak.eu/mod/certificate/lib.php on line 68

Notice: Trying to get property of non-object in /www/www.learn2speak.eu/mod/certificate/lib.php on line 72

Notice: Trying to get property of non-object in /www/www.learn2speak.eu/mod/certificate/lib.php on line 76
In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by Tom Pendley -

Hi Chardelle,

I am wondering if it would be easy to change teh code so that each certificate pdf was sent with the name of the course instead of certificate? Having them all the same is not user friendley to me.

Thanks

Tom

In reply to Chardelle Busch

Re: Certificate 3.2 for Moodle 1.7

by CJ Amarosa -

First off I really like the Cert Module, Thanks

The thing is I would like to give different certificates for different lessons/activities. Is there a way to print the lesson/activity name on the certificate rather than the course name.

Any help would be appreciated. Thanks in advance

In reply to CJ Amarosa

Re: Certificate 3.2 for Moodle 1.7

by Leonardo Terra -

In Certificate FAT 4.3 you can print activity name choosing this activity like grade reference. But course name will be printed.

I’m working in a new version of certificate FAT with a lot of improvements, including alternatives to print activities. But I need some help to get some agility in this project.

In reply to Leonardo Terra

Re: Certificate 3.2 for Moodle 1.7

by Chardelle Busch -
Picture of Core developers
First, in response to Tom's old post above--the latest version sends, downloads, or saves the cert with the name of the certificate.

As for printing a mod name, you can do this by creating your own custom type. In the type certificate.php file, you could add your own custom lang string, and delete the string that prints the course name. You could change the code that prints the grade of the activity along with the name, e.g. if you chose to print the % grade for the activity, change this line:
$grade = $modinfo->name.' '.$strgrade.': '.$modinfo->percentage.'%';
to
$grade = $modinfo->name;

Then make the changes to the line:
cert_printtext(170, 420, 'C', 'Times', '', 10, utf8_decode($grade));

to change it to the correct placement, font size, etc.