WeBWorK Main Forum

(Non-fatal) error using 'Email Instructor' in a scaffolded problem

(Non-fatal) error using 'Email Instructor' in a scaffolded problem

by Sean Fitzpatrick -
Number of replies: 1
I've had a few complaints of errors from students trying to email me using the help button in a WeBWorK problem.
Finally one of them decided to be helpful and send me a screenshot of the error!

My guess is that the bug is with the scaffolding code.
The scenario is that the question has three answer blanks.

Two are in the first part of the problem. The third remains hidden until they get the first two correct.

If the student gets stuck on the first part and uses the Email Instructor button, the email goes out to me as it should, but they get an error message:

Use of uninitialized value $last_answer{"AnSwEr0003"} in concatenation (.) or string at
/usr/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 506.
In reply to Sean Fitzpatrick

Re: (Non-fatal) error using 'Email Instructor' in a scaffolded problem

by Glenn Rice -
I can confirm this issue does occur. I don't think it is a bug in the scaffolding code though. It is a bug in line 506 of ContentGenerator/Feedback.pm. That code should check for undefined keys. The database stores all of the answer blanks and null values if the part has not been answered. This is not a new bug to 2.15. I also tested this with 2.14, and the same issue occurs.

I believe that this is caused by the answer blanks being hidden by the scaffold. As such their values are not submitted with the problem form. I have another type of problem that disables inputs in another way, and the same thing happens with those.