WeBWorK Problems

Getting answer text from new_checkbox_multiple_choice

Getting answer text from new_checkbox_multiple_choice

by Todd Clements -
Number of replies: 3

Hello everyone -

I am relatively new to Webwork (and a Chemist rather than a mathematician). I am designing a series of chemistry problems with significant student feedback and have written a lot of custom code to do so. It works great for numerical problems (I check for common mistakes and give students detailed feedback about what mistake they made and how to fix it, and a chance to try again). For various reasons I am not using AnswerHints, but my own code.

My difficulty is when I have multiple select problems (and would have the same problem with multiple choice problems). I can set them up and get them to run. I am currently using new_checkbox_multiple_choice to generate the multiple select problems and then print_q() and print_a() to display them to the student. When the student submits their answer and I look at it to generate my hints, it only tells me (for example) that the student answered "ACF" and that the correct answer is "ABF".

However, in order to give students good feedback, I need to know what the text of each answer is. If they answered C but weren't supposed to, I need to know that C was "electrons" so I can put in that feedback and talk about why electrons wasn't a good answer. Since new_checkbox_multiple_choice randomizes the order of answers (and I want to keep that functionality), I haven't figured out how to know what answer C is. I could parse the text from print_a() but that has all the formatting information in it and I was hoping there was a more direct route.

Thanks for any insights!

Cheers,
Todd


In reply to Todd Clements

Re: Getting answer text from new_checkbox_multiple_choice

by Glenn Rice -

Unfortunately, at this point the only way to see the what the letters mean is to open the student's problem and look at it.

With the next release of webwork/pg this will change.  First, you will be able to stop using the old style new_checkbox_multiple_choice method.  That will be considered deprecated.  Instead you can use the new parserCheckboxList.pl macro (already accepted into the pg develop branch).  Furthermore, when using that macro you will be able to set descriptive values for the answers (although that is not merged yet -- see https://github.com/openwebwork/pg/pull/778).

Of course, that does not benefit you now.  However, you can use the single problem grader now.  With that you can navigate through the students problems relatively quickly, while viewing correct answers.  In addition you can give the students direct feedback for the problem.  This is assuming you are using WeBWorK 2.16 or newer.

In reply to Glenn Rice

Re: Getting answer text from new_checkbox_multiple_choice

by Todd Clements -

Glenn - Thank you for the answer. Good to know that I wasn't just missing something obvious. The feedback I am giving my students is immediate (these are formative type problems), so using the problem grader to give feedback is not as useful.

I'll have to consider how I can do what I want moving forward. I may have to just parse the print_a for now.

Cheers,
Todd


In reply to Todd Clements

Re: Getting answer text from new_checkbox_multiple_choice

by Danny Glin -

Another option is to use a multiAnswer object made up of popUps.  Instead of having checkboxes you could put a yes/no dropdown next to each answer, and then use a custom grader to provide the custom feedback.  It would also give you more flexibility around the grading, so you could award partial credit if you want.