WeBWorK Problems

Error with Essay Question

Error with Essay Question

by Chrissy Safranski -
Number of replies: 1

See attached picture. The problem itself is short:

----------------------

DOCUMENT();

loadMacros("PG.pl",

"PGbasicmacros.pl",

"PGanswermacros.pl",

"MathObjects.pl",

"PGessaymacros.pl");


TEXT(beginproblem());webworkessayerror.png?dl=0

$showPartialCorrectAnswers = 0;

BEGIN_TEXT

$PAR

From your reading, video watching, note taking, and problem solving, name 3 things that you've learned or have questions about.

$PAR

\{essay_box(8,60)\}

$PAR

END_TEXT

ANS(essay_cmp() );

ENDDOCUMENT();

---------------------------------

I'm getting it across multiple courses, but only for some students on each assignment, not all. To make it weirder, it shows the student that they have 0 attempts for the problem, and the student can't see what they previously typed and submitted, but I can actually see their response when I go to grade all the responses. For this reason, I've mostly ignored it, but I'm sure it seems unprofessional to the students, and I've been asking a lot of free response essay questions, so I thought I'd give here a shot.

I tried changing the seed to be the same as a student who didn't get the error, but I didn't have any luck with that. I searched through this forum and found an old SRAND() command, but if there's a different method, I'll give it a try.

I've wondered if it's based on using apostrophes or other symbols in their response, because I also got a similar but separate error on an OPL problem that used a unicode arrow in a popup menu. That error disappeared when I edited the problem to have "-->" and "<-->" as the options in the popup.

My admin/server support is iffy, so bonus points for things I can try from the file manager or by editing the problem itself. But if it's a simple command or two, I can see if our IT will do it. Thanks for any ideas you have!

In reply to Chrissy Safranski

Re: Error with Essay Question

by Danny Glin -
The error message suggests that you are probably on the right track regarding special characters.

The error message references the last_answer column, so my suspicion is that because of something in the text box (probably an exotic character) WeBWorK is having trouble either writing the past answer to the database, or retrieving it from the database.

I suspect that there needs to be something in the code to sanitize the input from the text box before storing it in the database (or if there already is, it needs to be tweaked). Unfortunately this will probably require someone looking carefully at the code.