Certificate Module 0.8 for 1.5

Certificate Module 0.8 for 1.5

by David T. Cannon -
Number of replies: 76

Greetings,

I have placed the latest certificate module (2 MB) at:

http://whatalife.com/certificate.zip

Changes from 0.7:

  • Certificate classname and student name is "locked" to that certificate once viewed.
  • Certificate block allows certificate validation from home page (add block)
  • Fixed some logging stuff
  • and more that I cant remember at this time...

Still seeking feedback so I can finish this thing up.

Dave.

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

Re: Certificate Module 0.8 for 1.5

by Manel Lopez -
Hi David

Nice work

Could you tell me is this is right?

1) when i download the zip, size was 1,7 Mb instead 2 Mb like post indicates.
2) wen i go to validate a certicate a wrong data appears.

Certificate PWIVMB valid

To: usu 1

Class: testing

Date: 1124194115


Thanks for your effort
In reply to Manel Lopez

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Manual,

Yes the correct size is 1.6 MB, I was rounding up to 2MB.

It appears your date is incorrectly printing, are the other fields (TO and CLASS ) also not correct?

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Manel Lopez -
Hello David

All the others things are correct: Name, Class and also date.

Is when i'm going to validate, when data appears wrong.

Another curious thing is the fact that i can click all the times i want in certificate and moodle show me it.

If you want, i'm interesting in transalate certificate to spanish and català too. If you are too say me it.

Best Regards
In reply to Manel Lopez

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Manel,

I will look into it. In order to prevent Moodle from showing the certificate, you have to install the Activity Locking mod. And lock the cert from view until other course modules have been completed.

Maybe translate next version, I still have some English hard-coded in there.

Dave.

In reply to Manel Lopez

Re: Certificate Module 0.8 for 1.5

by Manel Lopez -
Hi again


David, let me rectify: preview however don't works.


Regards
In reply to Manel Lopez

Re: Certificate Module 0.8 for 1.5

by Chardelle Busch -
Picture of Core developers
Hi David,

I just got a chance to test the new stuff.

1. The lang file for the block is called certificate.php instead of block_certificate.php and it's missing some strings. (Why is it called Certificate1 by the way, maybe just Validate?)
2. But-I can't test this because if I choose to print cert #-Yes, no number gets added to the certificate. Am I missing a data table maybe? Should I delete and re-install the mod do you think?
3. I am now getting the locking check after viewing--GREAT--when I get a chance I'll try again to get the view entered in the student activity reports.
4. I do not get the preview pane either, and the mod page hangs--I'd just as soon not even have it if it is a problem.

Still on my wish list:
1. If a grade is added, also add the name of the graded activity--e.g. Final Quiz Grade: 75.
2. Option to open certificate in a new window.

In reply to Chardelle Busch

Re: Certificate Module 0.8 for 1.5

by Manel Lopez -
Hi chardelle

I'd rather laisser faire  David to depurate certificate than saturate him with my wish list smile

But when he finishes to depurate it ...
Why don't write the total grade instead a unique valuable item, writing "...with an achievement of 75/100"?.
And, why not, add the possibility to print in the reverse the contents of the course?
And ... smile

0.9 for 1.6?
1.0 for 2.0?

Have a nice day


In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Julian Ridden -
Thanks for the update. Still having issues with the preview however.

I will message you with a test user and pass to my demo site so you can see what is happening.

I am running Moodle 1.5.2 on a Linux box. Everything else is working fine.

As I said in an earlier post. The module itself is working and creating certificates. It is just the preview pane that is generating a "page not found" error.

See the demo course at http://playpen.monte.nsw.edu.au
Look in Demo Course category and then "Latest Features" course
In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -

I just finished some testing of the new version of the certificate mod on a win32 version of Apache and php (Xampp). Here are my observations:

1) Everything installs fine with no problems in MOODLE 1.52+

2) I also noticed that The mod/lang/en/ and block/lang/en files are interchanged.

3) For the Validation block - With debug activated I see the following message in the block header: "Notice: Undefined variable: cert in I:\Xampp\htdocs\mdl152\blocks\certificate\block_certificate.php on line 21"  The block works very well but the date format is like this: "1124300469"

4) The Mod - Certificate - Settings page displays the following message with debug on:"Notice: Undefined property: forum_certificate_autopreview in I:\Xampp\htdocs\mdl152\mod\certificate\config.html on line 12"

5) The Certificate Editing page shows this list of debug error messages at the top of the table :"Notice: Undefined offset: 0 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 1 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 2 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 3 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 0 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 1 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 2 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69

Notice: Undefined offset: 3 in I:\Xampp\htdocs\mdl152\mod\certificate\mod.html on line 69"

6) The preview pane does not work:  Instead, the following error message appears in the frame:"Not Found

The requested URL /moodle/mod/certificate/view.php was not found on this server.
Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7c PHP/4.3.7 mod_autoindex/color Server at shadrac Port 80"

7) My final comment is that the borders of the certificate do not always print. I see them occasionally but I am not sure what I did to make them appear.  I wonder if this is something to do with the undefined offset messages mentioned above.

I am now going to install the mod on my live site (linux) and I'll let you know if I see any changes.

Regards Don




In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Just finished testing on a Linux server and all the points that I mentioned in my previous post repeated on that server.

I did some analysis with the frames not printing and here is what I found: The Certificate edit page takes forever ( at least 40 seconds to load. If I don't wait for the complete page to load ( including my footer) none of my edits seem to be accepted. If I wait for the footer to appear and then make a change, I get a rapid refresh of the top part of the page and the border style changes to whatever it likes. Often this will be none and, if I leave the page in that state, I don't see the borders. I suspect that getting rid of the php errors might speed up the page loading a probably get rid of this little bug. That's my story and I am sticking to it (for now).
In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Well I have found our problem!  At lines 259, 285 and 286 of certificate/mod.html there are some source urls that are "hardwired". Line 259 states "   echo '<iframe name="cert_iframe"rc="/moodle/mod/certificate/view.php?id='.$form->coursemodule.'" width="460" height="400" align="right"></iframe>';"  If your moodle site is not in a "moodle" directory, then  change the src"/moodle/mod/certificate....... line to src"/your_moodle_directory_name/mod/certificate......... Now the preview will work just fine.

On Lines 285 and 286 there is another url that must be changed similarly:
Line  285 states: <script type="text/javascript" src="http://192.168.1.100/moodle/lib/editor/htmlarea.php?id=3"></script>

Change this to: <script type="text/javascript" src="/your_moodle_directory_name/lib/editor/htmlarea.php?id=3"></script>

Do the same for line 286 and your mod.html page will begin to load and operate as advertised.

I know that this is not the final, elegant solution but my installation is now working properly and I can continue testing.

Cheers - Don


In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Good job Don!

Just some sloppy coding. I got hit with another project so I have been working fast on the certificate module.

I will fix this and other comments received today and reupload the module.

Dave.

In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Julian Ridden -
Thanks for that. Knew it would be something simple
In reply to Julian Ridden

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Thanks Don/Julian/Chardelle/Manel-

I believe I fixed all the problem from today and have re-uploaded the latest modules at http://whatalife.com/certificate.zip

Don, The warnings you get on the certificate page are just that warnings, and should not cause any trouble. Becasue later a isset() is used on the variable. I have not found a neat way to stop the warnings since its a dynamic multi-dimension array.

Unzip files in moodle to update from previous revision. Be sure admin->module->certificate->settings preview is on to use autopreview.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jared Lelos -

Hi, I tried this and I got this error

FPDF error: Image file has no extension and no type was specified: /.../mod/certificate/pix/watermarks/

I looked in the folder in question it has Crest.png which looks fine to me. The problem is this error come up in the preview, when I try and save and if I try and cancel. 

Everything else seems to work fine - I'm real excited about having this feature!

Thanks

Jared

In reply to Jared Lelos

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Hmmm, that's pretty strange. The three dots is not a good sign ...

Are you using the latest code?

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jared Lelos -
Oh no the three dots I used to shorten down the line all it had was the rest of the path to the file. Everything else was works fine except for this error.
In reply to Jared Lelos

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Jared,

This is another puzzler to me. Look at source code of the edit page for the certificate, the watermark lines should look like:

 <select id="menuprint_wmark" name="print_wmark" >
   <option value="0" selected="selected">No</option>
   <option value="Crest.png" selected="selected">Crest</option>
</select>

Let me know if it differs. Also, the Crest.png must be just like that, not Crest.PNG or any other capital variation. Lastly, make sure read permissions are set on the directory.

Let me know what you find out,

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jared Lelos -

Hi Dave,

Before I saw this I tried installing the certificates on a fresh copy of moodle and it works just as it should. I think maybe there was a conflict with the activity locking module as it was the only other addon I had. Whatever the reason - certificates are working just fine now. Thanks for all the effort you've put in - automatic certificate creation really makes moodle standout from the competition in my opinion.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
David
I just did a complete install of the new versions of the certificate block and the certificate module.  I have only two comments so far..

1) When going to the admin->module->certificate->settings page to select autopreview on, the php debug mode still gives the following message: "Notice: Undefined property: forum_certificate_autopreview in I:\Xampp\htdocs\mdl152\mod\certificate\config.html on line 12"

2) I still get the unformatted date in the validation block (ie)
"Date: 1124382250"

Otherwise all is working as advertised.
- Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Thanks Don,

I fixed the typo for #1.

I'm not sure how to fix the date output problem. Since, those numbers above look nothing like a date, I wouldn't know how to parse it. Anyone else have any experience working with dates?

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Thanks for the quick response. 
The numbers that you are displaying are taken literally from the database.  If you browse your moodle database mdl_certificate_viewed table for cert_date, you will see the date in this format.

 All the dates and times in the Moodle database are stored in this format and then manipulated before displaying to us mortals in month, day and year.  You may be able to learn something from the moodle log output since it is another example of extracting this date format from the mdl_log table and displaying it to us human users. 

This is way over my head but I hope that this little bit of research can help some one with a better understanding than I have to solve the problem.

- Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

What is intersting to me, is that the date look perfect for me:

TO: Admin User 2
Course: Student Induction Course
Date: 2005-08-15 20:43:59

But I am running latest releases of PHP/MySQL/Moodle. So I will look at the logs and see how they display dates.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
David
I am still having problems with the date format and I am bound and determined to find a solution. I have been playing with Blocks/Certificate/index.php and trying to patch some code from your Mod/Certificate/view.php to accomplish the following:
1) Extract the unformatted date from the database,
2) Put it into a format using code stolen from your certificate mod,
3) Print it in the new format in the Certificate Validation Block.

Unfortunately I am not much of a programmer and I have run into a brick wall. The code is in lines 71 to 78 in the index.php file. Could you or any other competent party please have a look at this and see if there is a solution here?

Thanks, as always.  

- Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Well this is what I found.

Moodle does not use a datetime field in their DB, I dont know why. I am using it in my tables, that is why you are seeing some weird output. I places code to format the date in, hopefully it works for all platforms.

I have uploaded new code at my website above.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
David - Thanks for your persistence - it is greatly appreciated!!

Here is what I found with the new code:
The certificate date is printing as December 31st, 1969 at 5:59 pm

On my live - Linux server the date is now in the proper format: I see:
'Certificate ZEOJJS valid

TO: Don Farion

Course: Course 101

Date: December 31st, 1969 at 5:59 pm"

Every certificate that I create seems to have the same date and certificate number.

(Just Added) In the database - I can see the four certificates that I have created but in the certificate_viewed table,  I only see the first one with the date and code that you see above.
The developmental server on Xamp under windows I cannot generate a certificate because windows does not like the date and it gives me the following message:

Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in I:\Xampp\htdocs\mdl152\mod\certificate\view.php on line 88

I hope that this helps.


In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Ger Tielemans -
Warning: strtotime() [function.strtotime]: Called with an empty time parameter. in C:\apachefriends\xampp\htdocs\moodle152b\mod\certificate\view.php on line 88

Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\apachefriends\xampp\htdocs\moodle152b\mod\certificate\view.php on line 88
FPDF error: Image file has no extension and no type was specified: C:\apachefriends\xampp\htdocs\moodle152b/mod/certificate/pix/watermarks/
In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
David
I threw you a bit of a red herring in my last post.  I had created a number of certificates in the same course and they all had the same date and code number.  This, I suppose, is more of a quirk than a bug since one certificate per course is a reasonable limitation.

When I create a certificate in a different course, it maintains the same erroneous date as the others but it has a different code.

Sorry for the misunderstanding.  The only problem remaining is the fixed, erroneous date.

- Don
In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Dave
It is a rainy Saturday afternoon and I have been playing with your latest code and, with a couple of small edits, I have it working! 

Here are the changes that I have made:
1) In the file: moodle/blocks/certificate/index.php  -> change line #72 to:
    $completion_date = date("F jS, Y \\a\\t g:i a",($CERT->cert_date));
and
2) In the file: moodle/mod/certificate/view.php -> change line #88 to:
    $completion_date = date("$date_fmt", ($certrecord->cert_date));

Please have a look at this and tell me what you think.  Everybody else - tinker at your own risk - a really don't know what I am doing here! blush

- Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Ger Tielemans -
nop, a fpdf error:
Attachment vraag019.jpg
In reply to Ger Tielemans

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Ger,

I see one other person is having same type of problem. I am working on it.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Ger Tielemans -

OK, your advice to reinstall 0.9 did it -- in combination with the new view.php script:

Re: Certificate Module 0.8 for 1.5
by Alison Wright - Wednesday, 7 September 2005, 01:07 PM
 

Hi Dave,

Have attached view.php

The code was from Don Farions...

Attachment surf001.jpg
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Well,

If it works for you great, It displays all my times in year 1969. So It must have some dependancy on the type of system. I tried looking at how they are retrieved for the logs output, but theres alot of things going on there. I just dont have the time right now to figure it out.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Nicole Snyder -
I downloaded and installed the certificate module to 1.5.2+ and it is working great except the students name will not print when the certificate module is viewed?

Thank yousmile
Nicole
In reply to Nicole Snyder

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Nicole,

Well, that is just weird. Please download the latest code from above link, select remove certificate module, then go to admin to recreate the tables.

Let me know if student name is still not showing up. If it isn't, look to see that the studentname field in the certificate_viewed table is being filled.

Thanks,

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Julian Ridden -
This is great stuff. Many thanks to those who are contributing to this.

I have now installed this module in my Playpen for others to see. So if you are interested in seeing certificate in action check out http://playpen.monte.nsw.edu.au

The certiicate is located in my Advanced Features Demo Course.
In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by L. Vandijck -
Whatever I do, the following error message keeps popping up when I access a certificate in a course (creating it works as expected):
Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\program files\easyphp\www\mod\certificate\view.php on line 88
FPDF error: Some data has already been output, can't send PDF file

I've tried removing and reinstalling Certificate, but to no avail. Any hints?
Regards,
Leo
In reply to L. Vandijck

Re: Certificate Module 0.8 for 1.5

by Don Farion -
You can try my little hack in today's post if you are adventurous!  It is working for me.  This will likely get it working for you over the weekend until Dave can take a look at my edits and tell us what he thinks of the whole thing.

- Don
In reply to L. Vandijck

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Temporary solution for this is to download the latest code.

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

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 0.8 for 1.5

by Jared Lelos -

Hi Dave,

I have one more little problem. I have setup the locking and certificates and it all looks fine but...

when I login as a user and click on the locked certificate I get:

Warning: Cannot modify header information - headers already sent by (output started at /home/altior/public_html/cpdhours/theme/altior/header.html:2) in /home/altior/public_html/cpdhours/mod/certificate/fpdf/fpdf.php on line 1022
FPDF error: Some data has already been output to browser, can't send PDF file

and then the certificate has a tick by it (but is still locked).

I've tried using 0.9 of the certificate module with the same result.

I have one webpage activity followed by a quiz (which is locked). If I click on the the locked quiz I get a message to the effect that I must do the activity before I can take the quiz but when I try to click on the certificate I get the above error.

Thanks for your help.

In reply to Jared Lelos

Re: Certificate Module 0.8 for 1.5

by Chardelle Busch -
Picture of Core developers
Jared,

Did you make any changes to the certificate files?  This type of error message usually appears when extraneous lines get inserted into a php file.  Try looking for (and deleting) any blank lines, particularly at the bottom of the file.
In reply to Chardelle Busch

Re: Certificate Module 0.8 for 1.5

by Jared Lelos -

I haven't edited any lines (yet!) any idea where I should look? I did try reinstalling the module as well to no effect.

Thanks

In reply to Jared Lelos

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Jared
I was having the same problem and found a quick fix.

1) Open certificate/mod/view.php and find the lines of code that are bracketed by the following comments:

/// Activity Locking
"code"
///End activity locking.

2) Replace this entire block of code with the following:

/// Activity Locking ///
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course ID was incorrect');
}
require_once($CFG->libdir.'/locklib.php');
check_locks($cm);
/// End Activity Locking

This updates the code to Stuart's latest version of the activity locking mod and it works okay for my installation.

Once again, tinker at your own risk while we wait to see what David has to say about the final version.

Regards
- Don



In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Rhonda Goetz -

I installed the certificate module and it works wonderfully, but when I install the activity locking module, it duplicates all my units in the courses. 

Anyone know how to fix this?  I am using 1.5.2.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jeffery Watkins -
I installed with no problems.  Added a certificate to a course... but when I click on it I get this:


Warning: Cannot modify header information - headers already sent by (output started at /home/moodle/public_html/moodle15/moodle/lib/locklib.php:79) in /home/moodle/public_html/moodle15/moodle/mod/certificate/fpdf/fpdf.php on line 1022
FPDF error: Some data has already been output to browser, can't send PDF file

Any ideas?

Jeff
In reply to Jeffery Watkins

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Jeffery
Try modifying the activity locking code in view.php as described in my post dated this morning.  I pretty sure that it will fix your problem.

- Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Jeffery Watkins -
New error after activity locking fix
Warning: Missing argument 2 for check_locks() in /home/moodle/public_html/moodle15/moodle/lib/locklib.php on line 43

EDIT:
I updated Activity Locking and all is working fine now.

Jeff
In reply to Jeffery Watkins

Re: Certificate Module 0.8 for 1.5

by Chardelle Busch -
Picture of Core developers
FYI,

I just updated the certif mod. All is working fine. (I have debug OFF) This is what I had to do:

1. For the date, I had to switch the two commented lines David mentions above to get it right.
2. I also got the headers sent error when clicking on a locked certif as a student. I added Don's locking fix above (thanks for that) and it is fixed.

Here's my server setup:
Linux
Apache Version:
1.3.33 (Unix)
PHP Version:
4.3.11
MySQL Version:
4.0.22-standard

Also, I got the certificate views to show in the user activity reports. Replace the function_user_certificate_outline and function_user_certificate_complete code in certificate/lib.php with this:

function certificate_user_outline($course, $user, $mod, $certificate) {
if ($logs = get_records_select("log", "userid='$user->id' AND module='certificate'
AND action='view' AND info='$certificate->id'", "time ASC")) {

$numviews = count($logs);
$lastlog = array_pop($logs);

$result->info = get_string("numviews", "", $numviews);
$result->time = $lastlog->time;

return $result;
}
return NULL;
}


function certificate_user_complete($course, $user, $mod, $certificate) {
global $CFG;

if ($logs = get_records_select("log", "userid='$user->id' AND module='certificate'
AND action='view' AND info='$certificate->id'", "time ASC")) {
$numviews = count($logs);
$lastlog = array_pop($logs);

$strmostrecently = get_string("mostrecently");
$strnumviews = get_string("numviews", "", $numviews);

echo "$strnumviews - $strmostrecently ".userdate($lastlog->time);

} else {
print_string("neverseen", "resource");
}
}
In reply to Chardelle Busch

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Chardelle
I just applied your edit to cetificate/lib.php and my certificates are logging fine as well!

Thanks.
-Don
In reply to Don Farion

Re: Certificate Module 0.8 for 1.5

by Chardelle Busch -
Picture of Core developers
Good. Now, if I could just get the name of the graded module to print along with the grade I'd be very happy. I have more than one certificate per course for different graded activities, so having the name to go along with the grade would be so helpful.

Is there anybody that has any ideas about this?

Jens,

I haven't seen that error. I'm using version 1.5.2 (2005060220)
In reply to Chardelle Busch

Re: Certificate Module 0.8 for 1.5

by Jens Gammelgaard -
Picture of Translators

Hi Chardelle,

I wonder if you have found a way out of the islocked() issue on the post: http://moodle.org/mod/forum/discuss.php?d=27477 (See post by: S. Perito ) ??

The cute thing is that the certificate and the conditional mod worked nicely in version 1.51+ with no fatal errors.

Thank you,

Warm Regards
Jens

In reply to Jens Gammelgaard

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

OK, I uploaded a new version.

Development version, use at own risk.

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

  • added revision, guess i been forgetting that
  • removes newlines from end of files, causes problem for some people evifentially
  • added logging code from Chardelle above
  • added vertical cert from nikki

Using this with the locking module works now, but if locking module changes there may be problems.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Julian Ridden -
Just added your code and am seeing the following error when attempting to preview or access certificates.

FPDF error: Incorrect orientation

Any ideas

Update
Some seemto work and others not. Vertical acheivement is fine. So is Horizontal completeion.

Ohters generate the issue.

I have this set up for testing in the Playpen
In reply to Julian Ridden

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Thanks Julian,

I rushed and had a typo. please use attached file update for /mod/certificate/view.php or redownload from above.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jeffery Watkins -
I cannot get it to print student's name.  Am I missing a setting?

Jeff
In reply to Jeffery Watkins

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Jeff,

I think you have a version that is out-of-sync with the DB version.

From the admin panel, go to modules. Delete the certificate module. Then, go back to the admin panel, and it should recreate certificate tables.

Let me know if you still encounter problems.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jeffery Watkins -
Thats the ticket Dave... thanks!!!

Jeff
In reply to Jeffery Watkins

Re: Certificate Module 0.8 for 1.5

by Alison Wright -

Hi

I have been getting the same error as mentioned above.  The view.php appears to have the activity locking fix included in it (i have the 0.9 version).

Warning: Cannot modify header information - headers already sent by (output started at /home/fhlinux204/i/i-am-in-the-moodle.co.uk/user/htdocs/theme/standardwhite/header.html:2) in /home/fhlinux204/i/i-am-in-the-moodle.co.uk/user/htdocs/mod/certificate/fpdf/fpdf.php on line 1022
FPDF error: Some data has already been output to browser, can't send PDF file

Can anyone advise as to what I can do to fix this?

TIA

Ali

In reply to Alison Wright

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Ali,

Two posts up, it says you need to delete the module from the admin panel, to get you DB in sync.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Alison Wright -

Hi Dave,

Unfortunately, it didn't seem to solve the error.  Error message shows instead of saying what prerequisites must be completed before allowed access to the certificate. Once activities are done then certificate displays fine. 

Any ideas?

In reply to Alison Wright

Re: Certificate Module 0.8 for 1.5

by Alison Wright -

Hi Dave - me again

Just entered Don Farian's fix into view.php (above) and it works fine now.  I hadn't done that because I thought this fix was in the version (0.9) that I downloaded - whoops blush sorry.

Ali 

In reply to Alison Wright

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Ali,

Can you post the fix you used, because I thought they were all in the 0.9 version also. I want to make sure I have all the fixes in there.

Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Alison Wright -

Hi Dave,

Have attached view.php

The code was from Don Farions post in this thread:

1) Open certificate/mod/view.php and find the lines of code that are bracketed by the following comments:

/// Activity Locking
"code"
///End activity locking.

2) Replace this entire block of code with the following:

/// Activity Locking ///
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course ID was incorrect');
}
require_once($CFG->libdir.'/locklib.php');
check_locks($cm);
/// End Activity Locking


The module is great! You're a star big grin

Ali

In reply to Alison Wright

Re: Certificate Module 0.8 for 1.5

by Jay S -
Warning: main(/moodle/lib/locklib.php): failed to open stream: No such file or directory in /moodle/mod/certificate/lib.php on line 4

What is going on here?
In reply to Jay S

Re: Certificate Module 0.8 for 1.5

by David T. Cannon -

Do you have the activity module also? Certificate works with the activity module.


Dave.

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Jay S -
I just looked at my old stuff and never seen the a mod called activity, It has been so long since I installed it so I guess its back to the forums I go.

I wish there was a nice readme file for the instalation of certificate module
In reply to Jay S

Re: Certificate Module 0.8 for 1.5

by Don Farion -
Jason
If you want to use the Certificate Module without the activity locking you can get rid of the error message by editing /Mod/Certificate/view.php.

Find the lines that look something like this:
// Activity Locking ///
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course ID was incorrect');
}
require_once($CFG->libdir.'/locklib.php');
check_locks($cm);
/// End Activity Locking

Put double back slashes in front of all of the lines to comment out the entire code so that it looks like this:
// Activity Locking ///
//if (! $course = get_record('course', 'id', $cm->course)) {
//error('Course ID was incorrect');
//}
//require_once($CFG->libdir.'/locklib.php');
//check_locks($cm);
/// End Activity Locking

This should disable activity locking for the certificate and allow you to experiment over the week end.
I suggest that you do get around to installing the Activity Locking mod because together, these two are a powerful tool!

-Don

In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5 - Date?

by Jens Gammelgaard -
Picture of Translators
Hi David,

Is it me that is stuck in time, or should the Certificate be dated 1969 wink - when it comes out on PDF?

Sorry if my question came to early.
In reply to Jens Gammelgaard

Re: Certificate Module 0.8 for 1.5 - Date?

by Don Farion -
Jens
You should modify your certificate/view.php file as mentioned by David in his previous 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.

Dave."

This should give you the correct date.

- Don


In reply to David T. Cannon

Re: Certificate Module 0.8 for 1.5

by Livetek Software Consulting Services -
I've tried downloading the file from http://whatalife.com/certificate.zip but the error message 'Page not found' is displayed. Kindly suggest from where should I downlaod this great contribution.