Features & Development

request trigDegrees context

Re: request trigDegrees context

by Dick Lane -
Number of replies: 1
Attached problem has two parts requiring exact expression that are checked in a context where radian-vs-degree distinction is irrelevant and one part where DEGREE is enforced.  I will welcome suggestion about ways to improve this.


In the meantime (i.e., prior to having a genuine trigDegree context), I would like to note two minor discordant things.

a)  If a decimal value is entered for 1st or 3rd item, the message says "You are not allowed to type decimal numbers in this problem".  Since my code plays games with context for each item (i.e. preventing a decimal answer in two cases but allowing it in two others), I would prefer that message to be something of the form "A decimal answer is not acceptable for this item" because the prohibition is not global.

b)  Although any reasonable use of arctan, arcsin, arccos will be scored as correct for the exact angle-size item, the "Entered" display shows the radian value rather than the degree value.  FWiW: I added the subsequent "good decimal approximation" item for smallest angle to distract attention from that minor discordance.  (Asking that for the hypotenuse length was done to have a parallel structure in the problem statement.)


I will welcome suggestions, clever or kludgie, to work-around the current lack of a trigDegree context.
In reply to Dick Lane

Re: request trigDegrees context

by Michele Titcombe -

See WeBWorK wiki page (updated July 2021) : https://webwork.maa.org/wiki/TrigFunctionsDegrees1

Sample PG code shows how to use the context TrigDegrees to redefine trigonometric functions so they evaluate in degrees rather than radians.