Certificate module for 1.5+

Certificate module for 1.5+

by David T. Cannon -
Number of replies: 25

I'm moving this discussion from the "general development" forum, since this forum seems more approriate.

The latest DEMONSTRATION code is at http://whatalife.com/moodle

user: admin
pw: 2admin (please dont change config options)

after you create a certificate, go in and edit it smile

latest features:

  • watermark
  • new date format
  • logo ability
  • multiple signature files
  • techer names

Needs to be completed:

  • Which date to print
  • Need to create certificate validation block
  • Manual print/ issue ability
  • help buttons and documentation
  • testing

Dave.

Average of ratings: -
In reply to David T. Cannon

Re: Certificate module for 1.5+

by Chardelle Busch -
Picture of Core developers
Hi David,

Great job. I just created a certificate with the teacher name and a signature line above it--really nice. Since there aren't any grades in that course, I can't tell for sure, did you get a grade to show?

I think that once you post this module, then we can test it better by messing around with it on our own test sites.

Also, just to note, the icon you have is one I created to go with the new nuvola iconset (more 3D looking). Here is the one I originally created that matches Moodle's flat icons and might be better to put in this.
Attachment certificate.png
In reply to Chardelle Busch

Re: Certificate module for 1.5+

by David T. Cannon -

The grade should show. However, it is printing the numeric for the grade, I dont know if/how we we convert them to a letter grade, or if we even want that.

I will switch the icons.

Dave.

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Chardelle Busch -
Picture of Core developers
Are you planning on adding an option to print the total grade?  If you do, then if you set the gradebook to display letter grades, then the total grade will display the letter grade.  I hope you don't mind, I just tested the grade, I opened up the quiz, created a test user, took the quiz, and the score showed up on the certificate--pretty cool.

As for the date, what are the options?  Could you make a Print Date dropdown similar to Print Grade, move the don't print option from Print Format to here, and then add other options.

And what are these?: 
  • Need to create certificate validation block
  • Manual print/ issue ability
In reply to Chardelle Busch

Re: Certificate module for 1.5+

by David T. Cannon -

I will look into total grade, sounds like a requirement. Since I have not yet created a class, Im not sure how this works.

Ya, I was thinking of making the date an option, since there are different reasons for different dates. I want to try to make this mod independant of AL, even though they seem to go hand in hand.

Need to create certificate validation block
I have a block that can be added to main page that is used to verify the vertificate number. Its basically a textfield that a vert # can be entered, and will verify class, student, date.

Manual print/ issue ability
I read where someone manually issues certificates. This would allow a, presumably teacher, disply certificates in a class, and print them. Also if they want to manually sign them, this method would be used. This will probably not be in this initial release.

Sound good?

Dave.

 

In reply to David T. Cannon

Re: Certificate module for 1.5+

by David Prinzing -
How is the coming along? Can I get a copy of this to play with? I have to set something like this up and I would love to see it in action at least.
In reply to David Prinzing

Re: Certificate module for 1.5+

by David T. Cannon -

Well, all but one bug remain, and we have a workaround for it at this point.

Anything more, are a few feature requests.

latest code : http://whatalife.com/certificate0.9.zip

Dave.

In reply to David T. Cannon

Vast: Re: Certificate module for 1.5+

by Ari Ranta -
Hi David
I have modified mod\certificate\view.php and certificate.php language files trying to write longer texts and add alternative certificate models. Now I have stucked in a stupid problem which I cannot understand.

I have modified the intros, statements, ondays and hours. I'd like to put some of the texts on two or several lines for example:
'has satisfactorily
completed the course
asd fasdf asdf asdf asdf...'

Shouldn't this work if I make the line feeds (Enter or Shift + Enter) in those text strings in certificate.php file?. For some reason the texts on the printable certificate are on same line though I have tried different ways to add the paragraphs.

Is this maybe a fpdf problem?
Or is this a problem at all? Maybe I'm just stupid Sekaisin...?

Ari

In reply to Ari Ranta

Re: Vast: Re: Certificate module for 1.5+

by Chardelle Busch -
Picture of Core developers
Date fix and line breaks,

If you are getting the LSD flashback to 1969 date, there are two lines in two different certificate files for the date. One of each of the lines is commented out (two // in front of the line). Simply switch the two--here's from David's post:
There are two lines, by commenting them out and uncommenting the line next to it may work for different systems:

mod/certificate/view.php line 88

block/certificate/index.php line 71

I understand this is messy hack, but I have not yet solved the problem for different systems and time.

Ari--to put a line break in a language string, you need to add <br /> where you want the break.


In reply to Chardelle Busch

Vast: Re: Vast: Re: Certificate module for 1.5+

by Ari Ranta -
Hi Chardelle,
The problem is that <br /> or <br> doesn't do anything in the pdf. They only get printed on the certificate.
Take a look at the attachment.

In reply to Ari Ranta

Re: Vast: Re: Vast: Re: Certificate module for 1.5+

by Chardelle Busch -
Picture of Core developers
Well, you're right--it must indeed be an fpdf thing. So, just add a new string. I just did it and you can see the result in the screenshot.

1. I just added a new string called statement2 to certificate view.php case 0 (about line 168) to go after the first statement and placed it 20 points (the 300) below the first statement--so the code looks like this:

cert_printtext(170, 280, 'C', 'Helvetica', '', 20, get_string("statement".$type, "certificate"));
cert_printtext(170, 300, 'C', 'Helvetica', '', 20, get_string("statement2".$type, "certificate"));

2. Add the new string to lang/certificate.php so it looks like this:

$string['statement0'] = 'has satisfactorily';
$string['statement20'] = 'completed the course';

If you want them to line up on the left, change the C to an L.  If you want to change the amount they are indented from the left, change the 170 number.

Have fun!

Attachment certif.gif
In reply to Chardelle Busch

Vast: Re: Vast: Re: Vast: Re: Certificate module for 1.5+

by Ari Ranta -
Ok Chardelle,
I'll write different string for each row.
Thanks again for your professional help.
Ari
In reply to Ari Ranta

Re: Vast: Re: Vast: Re: Vast: Re: Certificate module for 1.5+

by David T. Cannon -

I think Chardelle has described the best way to accomplish this.

Thanks,
Dave.

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Nicole Snyder -
First of all I just wanted to say that David, you are the best. I LOVE your certificate module and it has really brought a sense of completion and acheivement to my students.

Now one quick questions, sorrysad, hopefully I am not doing anything crazy, but my certificates when displaying a date say that I am in December 31st 1969? My website dates are set to the current date so I don't know what I am doing wrong. Any ideas?

Thank you,
Nicole
In reply to Nicole Snyder

Re: Certificate module for 1.5+

by David T. Cannon -

Nicole,

Read an earlier post, this thread about commenting out lines to overcome the date problem

Dave.

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Alison Wright -

I have the same date problem as Nicole.  I can't seem to find the post you were referring to.  How can I resolve the date issue?

Ali

In reply to Alison Wright

Re: Certificate module for 1.5+

by David T. Cannon -

Here is temp fix:

There are two lines, by commenting them out and uncommenting the line next to it may work for different systems:

mod/certificate/view.php line 88

block/certificate/index.php line 71

I understand this is messy hack, but I have not yet solved the problem for different systems and time.

Dave.

In reply to David T. Cannon

Re: Certificate module for 1.5+

by David T. Cannon -
In reply to David T. Cannon

Re: Certificate module for 1.5+

by Chardelle Busch -
Picture of Core developers

Hi David et al,

My wonderful friend, Mike Churchward just helped me with the code to add the name of the activity along with its grade.  So, if you have the grade of an activity set to show, the line will look like this for example:

Grade Final Exam: 88

You  will need to replace the lib.php file and the view.php file. 


I have also coded a version where the graded activity name shows up on its own line, and the grade shows up below the date e.g.:

.....
Final Exam
September 30, 2005
Grade: 88

It is the view.php file called view2.php (to use this version you would need to rename it view.php).

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Jonny McCullagh -
I have just tried installing your Certificate module David but when I choose to add a certificate to a course I get a page with the normal moodle headers etc but no form to add the certificate.

Do I need to upgrade moodle or am I missing something obvious?
Thanks for any help,
jonny
In reply to Jonny McCullagh

Re: Certificate module for 1.5+

by David T. Cannon -

Well, it is intended for Moodle 1.5+. If you are running that version, I really have no idea what the trouble is.

You are the first I have heard of this kind of incident. Maybe turn debug on in the admin panel and see if any errors come up.

Is the site public somewhere that I can login and take a look at it?

Dave.

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Jonny McCullagh -
I'm using version Moodle 1.5.1 (2005060210). Tried debugging and got nothing.

I have attached a screenshot but when viewing the source it seems to have stopped loading html directly after the comment:
-- This page defines the form to create or edit an instance of this module --

so there is no html after this and no end body or end html.
Anyone got any ideas? Cheers, jonny
Attachment moodlejonnycertprob.jpg
In reply to Jonny McCullagh

Re: Certificate module for 1.5+

by Jonny McCullagh -
Got to the bottom of the problem.
First,
I did not have activity locking installed.
I installed Certificate and visitied admin (and I think only the first 2 parts of the certificate install happened as there was no Continue button).
Next I installed Activity Locking and revisited the Admin screen.
Moodle replied with - Activity Locking installed and below this it stated Certificate tables installed.

So the Certificates install did not complete until after I had put Activity Locking in.

I hope this helps someone else or maybe the Certificate install.txt could point out that Activity Locking should be installed first?

Thanks,
jonny
In reply to Jonny McCullagh

Group BUG - due to Certificate module for 1.5+?

by Jay S -
Moodle 1.5
Appache
Valid PHP and Mysql

I have installed the following mods.
Certificate (including activity linking)
Dialogue


Groups does not work. I can only add students to the first group. No matter what group I select the students are added to the first group.

Before the two mods were installed groups worked fine.

Help!

In reply to David T. Cannon

Re: Certificate module for 1.5+

by Bill Weinheimer -

I'm having the same trouble.  When I first visited this thread I uninstalled the certificate module, installed the activity locking, reinstalled the certificate module.  I got the same message as Jonny while installing yet I still have the same page as the screenshot he posted when attempting to create a certificate activity for one of my courses.  In other words, installing activity locking didn't fix it for me.

Also, I no longer see the normal screen using the /admin page.  It appears as blank as well.  To reach admin functions now I have to log in at the regular user login, then access admin from the sidebar.  If I remove the certificate module the admin page returns.  I am using Moodle 1.5.2.

Any help would be greatly appreciated since I am over deadline on this project because of the invisible certificates.

Thanks,

Bill