WeBWorK Problems

Context issues with parserMultiAnswer.pl

Context issues with parserMultiAnswer.pl

by Nikola Kuzmanovski -
Number of replies: 3

I am trying to make problems that offer partial credit to students. I have attached a file with a problem I made. There are a couple issues that appear:

1. Here is a video https://use.vg/GGy72U going over how the problem I attached works. More details on my issues in the next two items.

2.  If the student enters something not defined in context then the entire answer checker doesn't run. I would like to award credit for answers that the student doesn't mess up. For example, the student gets one of the first two formulas correct, but enters the string "blabla" in the third answer box, the answer checker never runs. I would like to still award points for the first 2 correct answers and even for later answers, just skip this bad input in one of the answer blanks. There is the option of splitting things into multiple answer checkers, but then I can't award the partial credit like I do now because I can't access the other student answers without MultiAnswer.

3. I tried to to use contextArbitraryString.pl. However, I get another problem here. It seems I can't use math objects now. For example. I would like to make formulas from the student answers, but this doesn't seem to work based on my testing. If I can't make formulas then the method I used in the problem attached is useless.

I would also like to edit formulas if I can somehow. For example, look at the string of a student answer and remove any commas from numbers, and then make a math object like a real or formula.

I am sorry if this is written down somewhere, but I have spent a lot of time and haven't been able to figure it out.

In reply to Nikola Kuzmanovski

Re: Context issues with parserMultiAnswer.pl

by Glenn Rice -

One way to do this is to do the grading in a post filter, instead of directly in the answer checker.  This can be done with the answerHints.pl macro, or by directly writing your own post filter subroutine.

See https://webwork.maa.org/wiki/AnswerHints for how to use the answerHints.pl macro.

I can't find any examples in the documentation on using post filters right now, but I have used them to do this sort of thing.  The single argument of the post filter is the answer hash.  That contains everything that you are used to dealing with in the usual checker.  See https://webwork.maa.org/pod/pg/lib/AnswerHash.html for documentation on the answer hash, and the things that it contains.

In reply to Glenn Rice

Re: Context issues with parserMultiAnswer.pl

by Nikola Kuzmanovski -
Do you think you can give me a short example of post filters? I keep getting "Can't call method "withPostFilter" without a package or object reference". I also am wondering about a few things:

1. Does the post filter run after the problem checker?
2. Should I still use multians, but just move all the code for checking the correct answers into the post filter?
3. I would update the student score by using the answer hash?
4. I would get all the student inputs from the answer hash because I am using multians?
In reply to Nikola Kuzmanovski

Re: Context issues with parserMultiAnswer.pl

by Nikola Kuzmanovski -

I was able to figure out how to deal with all of this. Here is a wiki page on it https://webwork.maa.org/wiki/FormalRubrics

One can use the ideas here to create many different problems.