WeBWorK Main Forum

Dynamic tables

Re: Dynamic tables

by Glenn Rice -
Number of replies: 0

Yes, the number of rows and columns of the table can be variable depending on the random parameters.  Arrays can be dynamically created in numerous ways.  You can push or unshift elements in loops, or just assign to a particular index (even an index that doesn't already exist in the array).  You can even have a variable number of answer rules.  You will probably need additional arrays to contain answer rules in that case.