Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with radio buttons and numeric correct answers. #283

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Aug 31, 2016

Fix issue with radio buttons not giving an error if the index is out of range, and add noindex option to prevent numeric value from being used as an index.

http://bugs.webwork.maa.org/show_bug.cgi?id=3718

includes one example of this. You can also test it by using

loadMacros("parserRadioButtons.pl");
TEXT(RadioButtons([1,2,3],2)->{data}[0],",");
TEXT(RadioButtons([1,2,3],2,noindex=>1)->{data}[0]);

This should give you B2,B1 as the result after the patch (before it should be B2,B2).

Also

loadMacros("parserRadioButtons.pl");
TEXT(RadioButtons([1,2,3],5));

should produce an error about the correct answer index being outside the range of choices. (Before the patch, it produces a warning about $value not being defined).

…f range, and add noindex option to prevent numeric value from being used as an index.
@goehle
Copy link
Member

goehle commented Sep 1, 2016

Fixes work as advertised.

@goehle goehle merged commit d92a4e1 into openwebwork:develop Sep 1, 2016
@dpvc dpvc deleted the patch-radiobuttons branch May 19, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants