WeBWorK Problems

Absolute Value in Logarithmic Functions Student Answers

Re: Absolute Value in Logarithmic Functions Student Answers

by Davide Cervone -
Number of replies: 0
Forgot to answer the second half of the question.

Does it mean that the limits for a are [1, 3] and the limits for x are [2,6]
OR does it mean the limits for a are [1,2] and the limits for x are [3,6]?

It is the first of the two.

Note, however, that for a FormulaUpToConstant(), there is also a variable C that is added to the context automatically. Since the variables are handled in ASCII order, they are C, a, x, so in this case, you have set C to [1,3] and a to [2,6], and because you don't give a third set, x gets the first value in your list, [1,3].

For this reason, it is often best to set the limits in the context rather than in with() calls, as I indicated above:

Context()->variables->set(a => {limits => [1,3]});

This may also affect the coordinates of the test points, but I haven't checked (and it has been many years since I wrote that section of the code, so can't remember of the top of my head).