# Essay Questions

Essay questions are "open ended" or "paragraph" style questions which are submitted by the student and then later graded manually by the professor. The current essay questions implementation has the following features:

• Free response questions are easy to code and it is straightforward to add free response components to existing problems.
• Student answers and instructor comments can include typeset mathematics written both in calculator form and using LaTeX.
• Free response type questions can be included in problems with traditional WeBWorK questions.
• Instructors can provide feedback on student answers. Students can see instructor comments and can make revisions.
• Free response questions are compatible with problem randomization.

## Setting Up an Essay Question

All essay questions can be set up using three lines of code. At the top of your problem you should have

loadMacros("PGessaymacros.pl");


This loads PGessaymacros. It can also be included as one of the macros in every problems existing loadMacros call. In the text of your problem you should have

\{essay_box()\}


This creates the essay box. You can include character dimensions if you want to have a custom size, e.g. \{essay_box(162,48)\}. Finally, you will need an answer checker to go with your essay box. This is given by

ANS(essay_cmp());


Problems can use both essay answer boxes and comparators and tradition answer boxes and comparators. You can also use multiple essay boxes, as long as each has its own comparator.

For example, the following code shows an essay answer in a problem.

DOCUMENT();

$m = random(2,5);$b = random(20,30);
Context("Numeric");
$F = Formula("$m D + $b");$y1 = $F->eval(D=>1);$y2 = $F->eval(D=>2); BEGIN_TEXT The cost to download data using your phone is a linear function of the amount of data downloaded. Suppose it costs$y1 dollars to download 1 gigabyte of data and $y2 dollars to download 2 gigabytes of data.$PAR
Find a formula for the cost C in terms of the amount downloaded D. $BR C=\{ans_rule()\}$PAR
What do the slope and y-intercept of this function represent? $BR \{#Put an Essay Box where ever you want a essay type answer\} \{essay_box()\} END_TEXT ANS($F->cmp());
#Essay Boxs use the essay_cmp evaluator.
ANS(essay_cmp());
ENDDOCUMENT();



Essay answers are submitted like any other WeBWorK answer. Students type their answer into the box and hit submit. Unlike regular answers, the essay box will not be colored red or green, nor will it be marked correct. Rather the answer results will have a message informing students that their answers will be graded at a later time.

Student answers can have typeset mathematics. This can be done in one of two ways. First students can insert "calculator style" typsetting in between backticks (). For example

int_a^b e^x dx


This typesetting follows the AsciiMath markup language http://www1.chapman.edu/~jipsen/mathml/asciimath.html . it is reasonably intuitive, but can be a bit surprising when you do more complicated typesetting. The second approach is to use LaTeX formatting between    or    delimiters.

$$\int_a^b e^x \; dx$$


This is typeset using the MathJax LaTeX interpreter and is generally more robust. The following are some Useful tips for submitting problems:

• You can see a formatted preview of your answer by using the preview button. Do this to check your typsetting.
• You cannot use html. Any html or other code snippets will be rendered as is.
• Beware sloppy typesetting. Expressions like  $$e^x for x < 2$$ ` will render badly.

Essay answers are graded using the Manual Grader page. This can be found using any of the three links below. However these links only appear after at least one person has submitted an answer to the essay question.

• The "Needs Grading" or "Regrade" link on the set detail page for the corresponding homework set.