Features & Development

Hardcopy Theme Change

Hardcopy Theme Change

by Mahidher Duraisamy Krishnan -
Number of replies: 2

I have manipulated the html(GatewayQuiz.pm) and css(math4 CSS theme) so that the quiz problems have watermark embedded in them.But when I print a hardcopy,none of these changes seem to be there.I want these changes to be reflected in the hardcopy as well.Any suggestions on how to do that?

I have attached the screenshot of the changes I've made.

Watermark in gateway quiz


In reply to Mahidher Duraisamy Krishnan

Re: Hardcopy Theme Change

by Timothy Prescott -
Have you verified that the background not printing is due to WeBWorK? My experience has been that getting a background to print is difficult because browsers don't like to cooperate in that regard. My assumption would be that if you can nail down the css required to have a background appear, then that should carry over to WeBWorK as well. But I've not gone through the work of making that happen to be sure.
In reply to Mahidher Duraisamy Krishnan

Re: Hardcopy Theme Change

by Danny Glin -

The hardcopy generation is a completely separate process than the on-screen display, so it is not affected by the CSS theme.  Instead there are hardcopy themes that can be customized.

In /opt/webwork/webwork2/conf/snippets/hardcopyThemes, make a copy of one of the existing theme folders (twoColumn is the default theme, so you could make a copy of that folder called twoColumnWithWatermark).  You can then make changes to the LaTeX code added to every hardcopy in your new theme.  In particular, you could add the draftwatermark package and set a watermark in hardcopyPreamble.tex (you would need to make sure the package is installed on your WW server).

You would then need to override the available hardcopy themes for your course/server by adding the following to either course.conf (for one course) or localOverrides.conf (for the whole server).

$hardcopyThemeNames = {

        twoColumnWithWatermark => 'Two Columns',

};

# This is needed to enforce an order that the options are presented when making a hardcopy

$hardcopyThemes = [

        'twoColumnWithWatermark',

];

# Change default Hardcopy theme

# Be sure to choose one that is enabled!

$hardcopyTheme = "twoColumnWithWatermark";

I haven't actually tested any of this, so report back if it works for you.