Certificate Module Update

Certificate Module Update

by Chardelle Busch -
Number of replies: 38
Picture of Core developers
The latest version of the Certificate module for Moodle 1.8 is available from the downloads page here.

Since this version has many changes (you need to click on Admin>Notifications to update), I would appreciate it if I could get some feedback from testers.

This version includes locking options: by course grade, time spent in the course, graded activities, taking survey, questionnaire, or feedback, or any combination--thanks to Mike Churchward for his help with the locking code.

Another new option is the ability to enter email addresses for receiving notifications of received certificates. Thanks to Eloy Lafuente for this code.

There is also an option to print Credit hours on the certificate, updated help files, all images can be either JPEG or PNG 8, and a fix so it will not issue a certificate until button is clicked. The non-unicode types (which are recommended, since the Unicode types create much larger pdf files) should work with umlauts, accents, etc. if they are entered in Unicode format. This version includes two Unicode types--use these if your language includes symbols.

Average of ratings: -
In reply to Chardelle Busch

Re: Certificate Module Update

by Martin Holden -
Hi Chardelle,

is the link to the download correct ? - gives a page saying no entry in database.

regards

martin

In reply to Martin Holden

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Do you mean the Download latest version link? It works fine for me. This link comes directly from cvs--maybe it was busy when you tried it.
In reply to Chardelle Busch

Re: Certificate Module Update

by Martin Holden -
Hi,

thanks - tried it again and this time it worked fine - sorry to have troubled you.

martin
In reply to Chardelle Busch

Re: Certificate Module Update - Problem

by Martin Holden -
Hi again Chardelle,

Sorry but seem to have run into a problem.Downloaded the latest version

[Am using my localhost trial platform (Win XP Moodle 1.8.1,(2007021510) Mysql 4.1.22 & PHP 4.3.9 ]

Have been trying Certificate 4.3 FAT recently so I deleted this via admin|module - which completed successfully and then I manually removed the mod/certificate directory &files from the moodle directory structure

I installed your certificate module , copied the certificate.php to the lang en-uft8 folder as per the documentation & then went to admin notifications to update.

Notification reported installation completed successfully.
Went to a course and added a certificate

on the "editing certificate" page I found that the links to the various help files do not work (except for watermark,grade format,print grade , print teacher,print signature,print seal and group mode - all the rest report the associated html file could not be found.)

On attempting to save the new certificate I get the following message

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

Any thoughts or have I done something wrong?

regards

Martin

In reply to Martin Holden

Re: Certificate Module Update - Problem

by Chardelle Busch -
Picture of Core developers
My fault. The latest files have not gotten into the cvs branch yet. I'll disable that link until they do. In the meantime, if you want to send me an email, I'll just send you the zip.
In reply to Chardelle Busch

Re: Certificate Module Update - Problem

by Martin Holden -
Hi Chardelle,

Thanks for sending the zip file.

Have now installed it & I really like the module - many thanks for the work you have put in. I find that it seems to generate the certificate a lot faster than certificate 4.3 FAT I was trying before - I dont know if you are using different code but it certainly seemed to help on my testsystem. If you are going to amalgamate the two you might want to consider/review this aspect

However whilst trying a few things I have identified a couple of possible bugs(?) to do with dependent activities and it's use with the new feedback module for v1.9

I set up a course with a quiz , a feedback form and a number of certificate
as follows:
Cert 1 requires 70% pass mark in quiz
Cert 2 requires feedback form to have been completed
Cert3 requires 70% passmark on quiz + feedback form
Cert 4 requires feedback form + 70% passmark in quiz.

I then setup a number of users - user1 , user2, user3, user4 etc
with user1 took test and filled in feedback
with user 2 just took test
with user 3 just filled in feedback form
with user 4 did nothing

with each user then tried to get a certificate.

The problems I encountered are:

1) when certificates are initially being set up they don't seem to be saved correctly in that the dependent activity is not saved . If you set up the certificate then immediately check it by going to update it the dependent activity has not been set. If you then update the certificate to correct this it is saved correctly.
2) I could not get certificate to work with the feedback module - every time, no matter what the combination and whether the feedback form had been completed , it reported that the activity grade must be completed before issue.

Hopes this feedback helps.

Regards

Martin





In reply to Martin Holden

Re: Certificate Module Update - Problem

by Chardelle Busch -
Picture of Core developers
Hi Martin,

Thanks for testing. Leonardo used only the unicode types for his version--which requires embedding of the entire font(s) into the pdf--thus making the pdfs very large. Unicode should only be necessary for langs with characters.

As for 1--we'll have to look into that.

For 2- Is this an anonymous feedback by any chance? I just looked at that code, and it appears that no user ids are stored in the db for anonymous feedbacks--thus, locking won't work. I'll ask Andreas about that.
In reply to Chardelle Busch

Re: Certificate Module Update - Problem

by Martin Holden -
Hi Chardelle,

Thanks for the information - that explains why creating the pdfs did had a big impact on my local system - I had to extend the php max script run times to 60 seconds to get Leonardo's version to work ( which I would probably have trouble doing on my main site which is hosted by a third party).


For 2 - No when I set up the feed back form I selected the option "user's name will be logged and shown with answers".

Regards,

Martin


In reply to Martin Holden

Re: Certificate Module Update - Problem

by Brian Schmidt -
I can confirm #1 as well, using the code I downloaded today from the modules page. The dependency does not stick when setting up a newly created certificate; I have to go back and update for it to stick. The dependency sticks fine after attaching it during update for me too.
In reply to Brian Schmidt

Re: Certificate Module Update - Problem

by Brian Schmidt -
Well, I take it back (sort of). Today, I did not experience this issue when setting up a new certificate. So, seeming somewhat random now, I'm not sure what circumstances create the issue.
In reply to Chardelle Busch

Re: Certificate Module Update

by Brian Schmidt -
Hi Chardelle,

Can you point me to the location of the code that controls whether or not I can see the certificate page, based on the availability of any assignment it's attached to? I'm not having much luck finding the code that controls this.

Basically, I want to be able to lock the certificate based on an assignment. However, I want this assignment to be hidden to students. If I hide the assignment, though, then when I click on the link to the certificate as a student, I get redirected to the assignment (in the breadcrumbs) and a page that shows, "Sorry, this activity is currently hidden."

I know it's a little squirrelly, but we use this assignment as sort of an easy manual switch for trainers to individually assign each participant the ability to download the certificate when the trainer feels they have successfully completed the course. In other words, we don't want it to be a completely automatic process.

I hope I'm making sense. Is there a way to have the certificate page display, regardless of whether or not any activity it's attached to is hidden? Or is there a better way to go about achieving what we're doing that I've overlooked?

TIA,
Brian
In reply to Brian Schmidt

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Actually, Mike and I discussed this and decided that one should be able to lock the cert based on a hidden activity--that's why you were able to choose it when setting up the cert.

However, I just tested it an you are right--the code to check the availability of a locked activity (at the bottom of the lib file) doesn't like it if it is hidden.

We'll have to look into this.
In reply to Chardelle Busch

Re: Certificate Module Update

by Skip Heflin -

Chardelle,

I have a question for you. I am trying to force my students to follow a certain path, in other words, I want them to have to view and acknowledge reading a document before they are allowed to go further in a course. Is a certificate the way to do this? I am using 1.8, I know about the activity locking module but it is still in testing and not for a production server. My network, admin won't allow us to put it on because of this.

Thank you,

Skip

In reply to Skip Heflin

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Hi Skip,

Not really. I would recommend that you look at using the lesson mod for your documents--it has a dependency function.
In reply to Chardelle Busch

Re: Certificate Module Update

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Committed a fix to CVS. Basically, if a linked activity is hidden, it won't be considered as part of the requirements.

mike
In reply to Mike Churchward

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Brian,

I have a suggestion for you for your hidden assignment. A long time ago, I created a section block that allowed you to add resources and activities to a block on a course page. Then, you could hide the block (but not the individual items in the block), and those activities were still accessible, e.g. via a link, but "hidden" from view on the course page.

Since then, Mike Churchward updated that block and it is available here.

I assume the block hiding trick still works--give it a try.

In reply to Chardelle Busch

Re: Certificate Module Update

by Brian Schmidt -
Chardelle,

I couldn't quite discern from the description, but does this still list any activity (like an assignment) you create with the rest of the activities in the Activities block?

What I had been doing up until now, was creating a hidden section at the bottom of the course site (topics format). This sounds to be very similar to what this does. This hidden section would contain things like this certificate triggering assignment, links for the teacher, etc., that we didn't want students to access.

However, the problem I have now is that while the assignment is hidden on the main page to students because it's contained in a hidden block, students can access this "teacher only" certificate triggering assignment if they click on the Assignments link in the Activities block because I can't hide the assignment itself anymore. If this block you mentioned effects the same changes that my hidden section method above does, then I'm assuming I'll end up running into the same issue with it as well...
In reply to Brian Schmidt

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Hi Brian,

This code is entirely different than Leonardo's which I believe might rely on the same mod code I use in the certificate to print the mod grade--thus only one activity can be locked. This code relies on each activity's own functions--thus if the activity is hidden, the locking function doesn't work (although the certificate can still be set up to lock on a hidden activity--it won't work until the activity is made visible).

As for the assignment index page--yes I believe those assignments in the block (since they are not hidden) will still show up there. You could contact Mike Churchward regarding doing some coding to the block so that if it is hidden, the activities will not show on the index page--he's really a very clever codersmile.
In reply to Mike Churchward

Re: Certificate Module Update

by Brian Schmidt -
Ack! If I'm understanding you correctly, that means that this fix now makes my issue impossible (because I need the required assignment hidden), rather than just less than ideal. mixed I hope I'm just misunderstanding.

If not, is there a way I can go in the opposite direction? Can you point me to the code that controls this? When I was using Leonardo's version of the certificate, I was able to hide the required assignment and students still had the ability to access the certificate (given the assignment was satisfied), which is the desired behavior in my case.
In reply to Brian Schmidt

Re: Certificate Module Update

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Brian -

The issue is in the activity library code. The code that checks for elements of the activity, checks access levels for the user accessing it. If its hidden, and the user is not allowed to access hidden activities, than it returns that page. I believe this was introduced in 1.7.

You can't get around it if you use the activity API's to get things like grades. In the case of the assignment, simply instantiating it to use it checks the access - if its hidden, and you can't view hidden activities (capability viewhiddenactivities), then it returns that message.

The only way you could code around it would be to bypass the assignment API completely, and write custom code to do it all on its own - or change the code in the assignment module. This is not a good thing to do for something that will be widely distributed.

But, if you had a solution before that was working, use it and don't set any activity conditions for the certificate.

mike
In reply to Mike Churchward

Re: Certificate Module Update

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
I have changed the code that uses visibility checking to use the 'viewhiddenactivity' capability as well. So, if you override the student role to allow them to view hidden activities, then the activity will still be considered. This is really the only valid way to do this in 1.7 and up.

mike
In reply to Mike Churchward

Re: Certificate Module Update

by Brian Schmidt -
Mike,

Thanks for the explanation; this makes sense.

Unfortunately, I haven't yet found a solution that has worked 100% for us. I may just need to re-think it a bit more and see if there's a better way to get the end result.

One of the bigger obstacles we have, is that we don't like to assign actual grades to people. So one of the initial factors in wanting it hidden from the students was to alleviate trainers' concerns about assigning numerical grades to students. Instead, we use a custom scale of Completed/Not Completed. However, using a custom scale like this doesn't seem to lend itself to activity locking based on a grade. I tried browsing the code to see how difficult it would be to add that sort of a check in there and my initial thought was that it's probably not easy (at least, for me).

Brian
In reply to Brian Schmidt

Re: Certificate Module Update

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
It would be possible, but not easy as you say. You *could* use a grade scale of 0-1, where 0 is not complete and 1 is complete. Its still numeric, but less likely to be construed as a numeric grade. Then, you just use 100% as the condition.

mike
In reply to Chardelle Busch

Re: Certificate Module Update

by Ângelo Rigo -

Hi
I would like to create a lesson and after 4 questions or more if answers are all correct the student would be redirected to a certificate ?

Is it possible?

Thank´s in advance

In reply to Chardelle Busch

Re: Certificate Module Update

by Ângelo Rigo -

Hi

How can i create a watermark, i do create a png image and after uploading to the pix\watermark directory i choose the new watermark but it gives me the error message: TCPDF error: Alpha channel not supported: /direcotory/image.png

How can i produce images with no alpha chanell?

Thank´s in advance

In reply to Ângelo Rigo

Re: Certificate Module Update

by Tom Cox -
Make an 8 bit ping and it should work. If not, turn off transparency. That should work. Tom
In reply to Chardelle Busch

Re: Certificate Module Update

by Brett Hallongren -

This certificate is really working well for us.  Thanks.

I do however have a question.  I am not all that advanced in modifying code but can work my way through usually if pointed in the right direction.

We need to add a student id or license number to the certificate.  Currently we have a custom field in the main student profile information in our Moodle 1.8.3 installation that collects this information.  Can someone point me in the right direction for modifying the certificate.php file to allow it to print each student's id?  We do not use the print teacher function so I was thinking that there may be a way to modify that code to pull the id instead of the teacher name.

Any help would be appreciated.  Thanks

In reply to Brett Hallongren

Re: Certificate Module Update

by Colin McQueen -
It might be better to look at the code for getting and printing the student name, repeating this and concatenating the student ID onto the student name. Then the templates (if it uses one) will not be mucked about with as the teacher name is usually plonked somewhere specific under a signature isn't it. Probably not the best place for the Student ID.

Just a thought.
In reply to Colin McQueen

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
It's unfortunate that you are using a custom profile field since getting info from the user table is very easy. For example, if you were to use the idnumber profile field, you could simply add a line in your certificate type file like:

cert_printtext(170, 500, 'C', 'Times', '', 10, utf8_decode($USER->idnumber));

Getting the info from a custom field will require writing a function to get that number for each user from the user_info_data table, then using that function in the type file. Like Colin mentions, try looking at the student name function in the lib file and using it as an example.

Print teacher isn't a good example since it uses the roles functions to print the name of the teacher set at the module level on each certificate--it isn't unique for each user.
In reply to Chardelle Busch

Re: Certificate Module Update

by Brett Hallongren -

Chardelle & Colin:

Thank you both for  your responses.

I see where using the teacher would not be a good choice now.

I have no problem changing over to a non-custom field.  The only problem would be that I would need to use one that the students can enter themselves and that I would be able to modify the label on. Id is an auto field isn't it?

I'll look at the student name file and see if I can figure out something.  This looks like it may be beyond my knowledge though so we may just have to have the students fill in the blank themselves manually after they print it off.

Thanks again for the help.

In reply to Chardelle Busch

Re: Certificate Module Update

by Gilbert Rossignol -

Hello, I just recently upgrade my production server to use moodle 1.8.2, during the upgrade, I forgot to bring certificate along for the ride.

Anyway, I just downloaded the most recent version of the certificate module for 1.8 and this is the errors it gives me when I try to update the database.

 (mysql): ALTER TABLE `mdl_certificate` ADD `customtext` TEXT AFTER `printteacher`  

1054: Unknown column 'printteacher' in 'mdl_certificate'

                  


 (mysql): ALTER TABLE `mdl_certificate_issues` CHANGE `classname` `classname` VARCHAR( 254 )  

1146: Table 'fldb.mdl_certificate_issues' doesn't exist

                  

 (mysql): ALTER TABLE mdl_certificate ADD emailothers TEXT after emailteachers  

1054: Unknown column 'emailteachers' in 'mdl_certificate'

                                    

Any ideas on what to do?

Thanks,

Gilbert

In reply to Gilbert Rossignol

Re: Certificate Module Update

by Chardelle Busch -
Picture of Core developers
Hi Gilbert,

Are you upgrading from 1.5 by any chance? If so, the certificate was entirely re-written from 1.6 on and isn't compatible with older versions so you will have to uninstall your current version first, then install 1.8 and see if that works. If not, let me know.
In reply to Chardelle Busch

Re: Certificate Module Update

by wyman Griffin -

I am really getting frustrated. I have asked this question on other forums here and no one responds constructively. I installed the certificate module. It appears in the activity list. When I click on the Certificate button nothing happens. Just a white page. What should I be looking at to correct this? Am I using the certificate activity correctly?

Topic 12 looks like this. I want to add a certificate to Topic 12.

12
Edit summary

This is the only thing so far I have been unable to get working. My Flash, Javascript, Streaming, etc all works. I am sure it is something I have forgot or have configured wrong. But I don't know where to look. I wish there was a how-to, not only for the installation of the software and modules but also a how-to in usage.

In reply to wyman Griffin

Re: Certificate Module Update

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Typically, a blank page indicates a PHP error and you can see it by turning on debugging. What version of Moodle are you using and how did you install the certificate module. Did you visit the admin notifications page to complete the install?
In reply to Anthony Borrow

Re: Certificate Module Update

by wyman Griffin -
Must have been something with the download. I turned on the debug as you said and it was having a problem with a module it was calling. The module was modhel.php. I could not find it in the moodle release and noticed in one of Chardelle's messages that when downloading the zip file something could have gone wrong. I sit on the other side of a corporate firewall and our security software could have done something. So I downloaded the software again reinstalled the module and it works. Amazing. Spent 3 days trying to get this to work. Thanks for the info on the debug. That helped me identify the problem and got me back on track.
In reply to wyman Griffin

Re: Certificate Module Update

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Excellent - I'm glad to hear that you were able to get it working. Happy Moodling and Merry Christmas! Anthony