I am using webwork 2.17 and am looking to create some questions containing graphs in tables with multiple choice radio buttons as appears in
This is my first problem of this sort, and I want to make sure I've got a good approach before making more.
In FindIsomorphism.pg, creating the table (containing 3 graphs) with radio buttons relies on the line
($table,$ans) = radio_table([@pics], [0,0,1], geometry => [1,3]);
[0,0,1] means that the 3rd option is correct. [1,3] means the table has 1 row and 3 columns.
I found the command
radio_table in the macro PGnauGraphics.pl which is loaded by PGnauGraphtheory.pl
When I try to use the
radio_table command, I ended up with an extra row. Note that I have 4 graphs, not 3. I used the line
($table,$ans) = radio_table([ @image], [@indices], geometry => [2,2], border => 1);
@indices has 1 in the position corresponding to the correct answer and 0 elsewhere. I have some randomization in my problem. [2,2] means I want a 2x2 table of graphs.
See below for screen shot.
I have attached my code in 12_2_Polish_rtable.pg
I also tried a version of this question according to the guidelines posted at https://webwork.maa.org/wiki/GraphsInTables using popups for selecting the correct graph. See below for a screen shot. I used niceTables.pl and LayoutTable instead of unionTables.pl and BeginTable.
I have attach my code for this version in 12_2_Polish.pg
Now for my questions:
Why am I getting an extra line using
radio_table? In the code for
radio_table, they use unionTables.pl and BeginTable and AlignedRow.
- What is the "modern" approach for multiple choice and graphs in tables: using
radio_table, or using popups with an appropriately formatted table?
- If using popups with an appropriately formatted table is the modern approach, which is better for the table: niceTables.pl and LayoutTable or unionTables.pl and BeginTable?