Conversation
still be a final result from the AnswerHints postfilter.
drgrice1
left a comment
There was a problem hiding this comment.
I suppose this is okay.
I have mixed feelings about this though.
Your example code in the linked issue should set $tmp = 0 and then wrap the $tmp = $student->eval(x => 0) in a perl eval. Then the answerHint macro will work as expected and give the message that the condition requested in the problem is not satisfied. This pull request will hide this error, and make it harder to see that the hints are not working in the intended way.
On the other hand, it doesn't hurt to catch errors from special cases don't matter that are accidentally missed by the author.
called by AnswerHints dies.
|
@drgrice1 @pstaabp - Thanks. Perltidy changes are in the third commit.
Thanks. I fixed the real problem (was more detailed, but the core error was the occurrence of a divide by zero error for a student answer at the initial condition point). I had not considered the need to such until this occurred. I thought it would be helpful to document this in the Wiki, but the Wiki problems technique page about AnswerHints does not even mention the use of a subroutine test, so explaining there that evaluation at a test point could potentially lead to such an issue seems overboard there.
Good point. I added a fixed "error message" (as a result table message) for when the I tried unsuccessfully to use the value of |
drgrice1
left a comment
There was a problem hiding this comment.
The perltidy result is a little different with the remove options added back in, but it will do for now.
I am not sure that I agree with displaying the "error during AnswerHints processing" as an answer message. I think of those messages as informative messages for the student. I think it might be better if that were a simple warn statement so that it appears with the information about reporting the issue to the professor and such. This is really an issue with the problem. In any case, this is will do for now also.
I am not sure why $@ is not being set exactly. It most likely has to do with the $SIG{__WARN__} handling inside the translator though. The way that you dealt with it seems to be working well though.
|
This looks good now. I agree with @drgrice1 about the message. We could say something along the lines of "An error occurred in this problem. Please inform your instructor." |
Sounds good to me, but I would like to somehow mention AnswerHints in the message, to provide a hint to whoever debugs it of where to look. How about: "An error occurred in this problem. Please inform your instructor. (die in AnswerHints subroutine)"? |
drgrice1
left a comment
There was a problem hiding this comment.
I found an issue with the eval approach. See my comment.
AnswerHints test "wrong" subroutine used to trigger hints returns a zero. Change the text of the error message issued when the "eval" fails, and make it a "warn" instead of a results table "answer message".
Upon additional consideration, I changed the error message to a Since it is now a |
Patch AnswerHints so that if a subroutine in the list "dies" there will still be a final result from the AnswerHints postfilter.
This is mean to address #679.