WeBWorK Main Forum

format answer using contextPercent.

format answer using contextPercent.

by Son Duong -
Number of replies: 0

Hello everyone, this is my first post so I hope it's going to the right forum.

I have a few questions about using percentContext.

It accepts answer in 3 different form: fraction, decimal, and percentage value. However they are not in any specific format. I wonder if I can apply these 3 specific format to the answer:

- Fractions must be in reduced form. (by default percentContext takes any mathematically correct fraction value)

- Decimal values must be rounded to 3 decimal places.

- Percent values must be rounded to 3 decimal places.

Separately, I can set these individually for 3 different answer box, but is it possible to apply them all at once? Alternatively, is there a way to set up an answer that will accept multiple 'hard' values? My research on this (mostly result of past discussion on this forum) only came across way to set up formula instead of hard values.

Thanks.