WeBWorK Main Forum

Essay questions and live preview

Essay questions and live preview

by Robert Mařík -
Number of replies: 0

Hello all.

I use (as many others) WeBWorK as a part of final grading and like also the essay questions. Many students do not answer these questions and I think that the reason is that LaTeX is new for them and they prefer computational questions. (Despite the fact that they get simple questions worth a good amount of points. But this is another story.)

In order to simplify writing the answer I tried to enable the live preview. The code is in fact taken from http://bandicoot.maths.adelaide.edu.au/MathJax/test/sample-dynamic-2.html

The result and the demo pg file is in the attached zip file. You have to load the file PGessayLivePreview.pl in the preamble and add the command "tlacitko" after "essay_box". This creates a new button "Zivy nahled zapnout/vypnout" which means "Live preview on/off". Clicking this button shrinks the textarea and opens the live preview.

There are some limitations, such as fixed name of the field, but it seems to be suitable for my requirements just now.

Someone could find this also useful so I am sharing the code. Any improvements or suggestions are welcome. Feel free to use/modify/extend/customize.

The file left.css just aligns the text in the preview table to the left (it is centered by default which makes the text looking strange).

Essay with live preview