## WeBWorK Problems

### Tailored feedback for string comparison

by Danny Glin -
Number of replies: 2
Here is what I'm looking to do:

A student enters a string (which is actually generated by a java applet, then dumped into WeBWorK). I want to compare against a correct string, but also compare against a list of predicted incorrect strings, each with a customized feedback message.

I'd like to do this using MathObjects, as most of the pieces seem to be there already. The problem I have right now is that there doesn't appear to be a String context, which allows the input of any string as a response. I can add a fixed list of acceptable strings to a context, but I want the students to be able to enter any string (and if it happens to be close to the correct answer, give them relevant feedback).

Any suggestions on how to do this?

Danny

### Re: Tailored feedback for string comparison

by Davide Cervone -
Danny:

The contextArbitraryString.pl macro file defines a context in which any string can be entered by the student, and you provide a custom checker that determines if the string is correct or not. Your custom checker could determine which message to give (and use Value->Error() to generate the message), or you could combine this with answerHints.pl to get the results you want (it allows you to give partial credit).

Davide