## Forum archive 2000-2006

### Davide P. Cervone - New macros and examples for essay questions

by Arnold Pizer -
Number of replies: 0
 New macros and examples for essay questions topic started 8/25/2006; 5:55:49 PMlast post 8/27/2006; 10:57:51 AM
 Davide P. Cervone - New macros and examples for essay questions  8/25/2006; 5:55:49 PM (reads: 269, responses: 5) Recently I was asked about how to handle essay-type questions where the answer is graded by the professor (rather than WeBWorK) after the assignment is due. It turns out that this is non-trivial to do, so I put together a macro package that should help. You can find the answerEssay.pl file and an example at  http://cvs.webwork.rochester.edu/viewcvs.cgi/union_problib/examples/answerEssay/?cvsroot=Union+College  The .pl file contains some documentation, so look there for details. This is how it works: the students get a type-in area where they can enter their answer and submit it. They are told that the professor will grade the problem after the due date. When the set has closed, the professor can act as a student to view his or her response. The problem will also display a new type-in area (not available to the student) where the professor can enter the score for the essay. Submitting the answers will record the score. After the problem is graded, the student can view the score either in the problem list for the homework set (where the scores for all problems are shown) or by viewing the particular problem. All of this is possible without changes to WeBWorK, but you will need to change the values of some of the permission levels in global.conf (or in a course's course.conf file). This is because the default setting is to NOT allow professors to submit answers after the due date, so that would prevent the professor from saving the grades. (See the comments in the .pl file for details.) Another setting that you might want to change is the one that controls whether previous answers are shown for students after the due date. This is off by default (so the students can go back and redo the problems for review without seeing their previous solutions), but this also means they would not see their essays and scores when they view the page after it is graded. Alternatively, you can tell the students to check the "show saved answers" box in the options panel at the left in order to see their essay. In the long run, it would be nice for the professor to have "next student" and "previous student" buttons to make it easier to go from one student to the next, but that would either require changes to WeBWorK (or at least a new module), or the use of a data file that contains the student ids, which would have to be generated before the professor grades the problems. Anyway, some of you might find this useful, so check it out. <| Post or View Comments |>

 Michael Gage - Re: New macros and examples for essay questions  8/25/2006; 8:06:03 PM (reads: 317, responses: 0) Hi, Just for reference, in case someone goes further with this, the module Preflight.pm -- never completed, is also an attempt in this direction. It might be a useful to have that code as reference in designing a module to accomplish grading essay questions. The preflight module was a response to a request to have the student's answer saved to a file in the database or on the disk (or just in the lastAnswer facility that already exists in WeBWorK) and then providing an instructor interface for quickly browsing the answers in order to grade them. The original request was to allow multiple choice questions followed by an essay question. The instructor would be able to select and browse the essay questions based on responses to the multiple choice question. e.g. What is a derivative? Explain your answer  1. The slope of the graph of the function 2. Bring down the exponent and subtract one 3. A way to get rich quickExplanation here: By making this due shortly before class an instructor would have an idea of which concepts the students were clear on and which ones needed more explanation. I'd love to have a unit that did this nicely. I already have an example problem that allows a student to enter primitive tex in the explanation box and have it previewed. -- Unfortunately none of this is available at the moment so your macro file is really welcome. -- Mike <| Post or View Comments |>

 Michael Gage - Re: New macros and examples for essay questions  8/25/2006; 9:43:21 PM (reads: 303, responses: 1) For reference here is the hack I came up with -- the grading portion of the problem was not yet operational, but you've solved that. -- Mike DOCUMENT(); $inputs_ref->{myAnswer} =~ s/~~~~/~~~~~~~~/g; #hack to handle backslashesloadMacros(PG.pl,PGbasicmacros.pl,PGchoicemacros.pl,PGanswermacros.pl,PGauxiliaryFunctions.pl);sub NAMED_TEX_BOX { my($name,$row,$col) = @_; my $essay_name = "${name}_ESSAY_BOX"; $row = 10 unless defined($row); $col = 80 unless defined($col); $essay_name = RECORD_FORM_LABEL($essay_name); my $len = 0.07*$col; my $height = .07*$row; my $answer_value = '';$answer_value = $inputs_ref->{$essay_name} if defined( $inputs_ref->{$essay_name} ); $answer_value =~ tr/$@`//d; ## make sure student answers can not be interpolated by e.g. EV3 my $print_string =$answer_value ||''; $print_string =~ s/+/\/g; # prevent weirdness with backslashes$answer_value =~ s/+//g; my $out = M3( qq!vskip$height in hrulefillquad !, qq!begin{rawhtml}