I've been trying to use various methods of printing out a 'certificate' from the Thank You page of an Online Quiz.
I seem to have success in Firefox but not IE.
First method that I tried was to load the contents of a div, hidden on the Thank you page with display:none, into a thickbox (jquery modal popup box like a lightbox - http://jquery.com/demo/thickbox/) and use this script http://www.bennadel.com/blog/1591-Ask-Ben-Print-Part-Of-A-Web-Page-With-jQuery.htm to print it. Which worked really well in both browsers only the contents come out at about 1/3 the size it should be, regardless of how big i set the Thickbox.
I've also tried using the jQuery script above to print my hidden div straight from the Thank You Page without popping it up into a modal box. This works beautifully and prints at the correct size in Firefox… but either prints the sign-in box or the quiz questions in IE.
The other attempt I've used it is to use good ol' window.open to pop up a page with a printer friendly design. This of course can't pick up any of the keywords from the Thank You page as I've moved to another page, and won't print in IE for some godforsaken reason. Works beautifully in Firefox.
Any ideas what I might be doing wrong?
cheers
Miriam
Not really sure what your trying to do, are you trying to make a "Printer Friendly" page that prints of only the certificate?
[quote]
Not really sure what your trying to do, are you trying to make a "Printer Friendly" page that prints of only the certificate?
[/quote]
Guess I should have given a few more details, sorry.
I need to be able to print a certificate after a user has completed an online quiz. This should be printable only if the user has passed the quiz.
Rick Perry posted earlier about this and has already implemented a javascript which shows a print button if the user's score is greater than 80%.
What I need to do now is to print out a certificate, either from a separate page or as part of the Thank You page - so yes, I'm only wanting to print one div from the page.
This is working okay for me in IE only if the certificate is displayed on the Thank You page. IE seems to want content inside a window if it is going to print it - whereas Firefox is happy to print the contents of my div even if it is set to display:none.
I've switched to trying one of my forms using jqPrint which seems to work better - http://plugins.jquery.com/project/jqPrint
You can see a demo of it here - http://www.education.tas.gov.au/worksafely/quiz/auto2 - we've switched the quiz logic around for testing purposes so if you deliberately fail the quiz and get lower than 80% you'll be able to see the print button.
I'm curious as to how Squiz do their course Certificates as essentially I'm trying to do the same thing… but I'm guessing that's probably custom php and we are under a Squiz SLA.
There is a lot of ways you can do this, if thats working for you use It.
You can also had an option for a "Print My certificate" (no matter what score they get) its a very simple script.
Try setting up a seperate design for the printer friendly page, so it prints only what is essential.
But I think the problem is that the person's name doesn't appear on the certificate? Well, mine didn't when I tried anyway.
[quote]
But I think the problem is that the person's name doesn't appear on the certificate? Well, mine didn't when I tried anyway.
[/quote]
It won't at the moment because you need a logged in account to get it to pick up your username. I've just set it to public user for now so you guys could try it. Once you're logged in the user name prints up 
I'll take a look at what you suggested with a print friendly design, Ryan. The only concern I had was that I might get a blank result - I havent tried printing using a link to an alternate design using ?SQ_DESIGN_NAME on a Thank You page before, but my experience with Custom Forms was that it wouldn't print properly. I tried @media print stylesheets but they are somewhat inconsistent to say the least… not reliable enough for this purpose.
Can confirm that linking to ?SQ_DESIGN_NAME=printer_friendly from the Thank You results page doesnt work - if I append this to the URL I'll get the quiz questions printing. It's gonna have to be javascript or nowt…
If you pre-bake a page with your cert and a few well placed global get keywords you should be able to pop the page up and feed the values in from the quiz through with your js. That way you remove the reliance on maintaining the state of the page, which is where the printer friendly idea was most likely to fail.
[quote]
If you pre-bake a page with your cert and a few well placed global get keywords you should be able to pop the page up and feed the values in from the quiz through with your js. That way you remove the reliance on maintaining the state of the page, which is where the printer friendly idea was most likely to fail.
[/quote]
Hmm, I'm getting more inclined to do this.
Do you know if there is a global keyword for current user details? I seem to have lost track of which manual the global keywords are listed in (if at all). Pretty much all I'd need to do is list user first name and surname - which on a quiz is %user_details_current_user_name%
[quote]
Do you know if there is a global keyword for current user details? I seem to have lost track of which manual the global keywords are listed in (if at all). Pretty much all I'd need to do is list user first name and surname - which on a quiz is %user_details_current_user_name%
[/quote]
%globals_user_name%
Substitute name with any other keyword format, like %globals_user_attribute_first_name%.
[quote]
Do you know if there is a global keyword for current user details? I seem to have lost track of which manual the global keywords are listed in (if at all).
[/quote]
Global Keywords (and now Keyword Modifiers for 3.24.x) are included in the Concepts manual on the Matrix Documentation Page.
The Global Keywords aren’t broken down entirely, just a template with %globals_user_attribute_<attrname>% etc., as there are many possibilities for each Global Keyword type. Though, there are a few handy examples for each.
Please use the keywords mentioned by Greg above, and refer to this manual for any other combinations.
Thanks!
I can pretty much pre-bake most of it with global keywords now. Must confess that I haven't re-read the 'Concepts' manual as I've been working with Matrix for a few years now… so I'd lost where the keywords had been hiding!
Cheers
Miriam