-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
include the Bn string in a radio buttons answer hash #494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested quickly and works as intended. As there is no other use of a hash key called correct_choice
it should not interfere with anything.
@drgrice1 would you take a look - and then we can hopefully merge this... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I see nothing wrong with this pull request, I am not certain of its necessity. If a custom checker is used you can already obtain this value using $correct->value (assuming $correct is what you name the first argument passed to the checker sub routine).
I also observed that you can obtain this value from the answer hash without this pull request via the correct_value key (using |
I think @Alex-Jordan wanted to make it cleanly accessible for use in systems which use WeBWorK to render problems as a back-end, in which case the putting it at the root level of the answer hash probably makes things easier for someone parsing a JSON-ified version of the answer hash. @Alex-Jordan do you still think this proposed change is helpful? |
I also observed that you can obtain this value from the answer hash
without this pull request via the correct_value key (using
$ansHash->{correct_value}->value).
That calls the value() method on $ansHash->{correct_value}, so it's using
some perl action to get that result. The idea is to put the information
actually into the answer hash itself so that when the answer hash is in its
json form, that information is there. So to answer Tani, yes the change is
still needed for some things we are doing outside of webwork2.
…On Thu, Oct 29, 2020 at 4:26 PM Nathan Wallach ***@***.***> wrote:
I also observed that you can obtain this value from the answer hash
without this pull request via the correct_value key (using
$ansHash->{correct_value}->value).
I think @Alex-Jordan <https://github.com/Alex-Jordan> wanted to make it
cleanly accessible for use in systems which use WeBWorK to render problems
as a back-end, in which case the putting it at the root level of the answer
hash probably makes things easier for someone parsing a JSON-ified version
of the answer hash.
@Alex-Jordan <https://github.com/Alex-Jordan> do you still think this
proposed change is helpful?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#494 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEDOADOEDJC4NQ56STCTJ3SNH23PANCNFSM4PKF7WXA>
.
--
Alex Jordan
Mathematics Instructor
Portland Community College
|
Okay. Sounds good. I will merge this then. |
@Alex-Jordan -Thanks for the clarification. It's good to get some of these pending PRs merged in. |
An answer hash for radio buttons might currently look like:
Nothing indicates the value attribute of the HTML button input corresponding to the correct choice. This edit adds to the hash like: