WeBWorK Main Forum

parserRadioButtons.pl - order (last, first) and checked.

Re: parserRadioButtons.pl - order (last, first) and checked.

by Davide Cervone -
Number of replies: 0
I hadn't considered the case where the shortened labels would not be distinct (or perhaps I did and expected you would provide your own more meaningful ones that were still short, but distinct). I don't remember.

In any case, I would (and did) consider it a bug, and so have fixed it. Just as putting the percent sign into the labels too early was a mistake, shortening the labels too early is also a mistake. So I've remove the makeLabel() call from choiceHash() and added a postprocessor for the answer checker that shortens the student's response. Since we only did that as a means of preventing the answer and answer preview from being too large anyway, that is a better way to handle it in any case. I renamed the routine labelText() since "makeLabel" wasn't really appropriate anymore.

Anyway, check out the new version in the CVS repository.

Davide

PS, the reason for $noCheck was to prevent the percent signs from being inserted when making the list of labels to use as strings to add to the String context. It was a symptom of having included the percent signs too early, and should have been a warning sign that there was a design flaw. As I recall, I wrote the radio button object pretty fast, and so maybe didn't think everything through so well.