numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
200 stars 118 forks source link

Recognising equivalent forms of trigonometric powers #844

Closed Tarang74 closed 2 years ago

Tarang74 commented 3 years ago

I have an issue with a quiz answer:

sec^2(theta) // Correct answer

I tried:

1. sec(theta)^2 // Marked incorrect

which was incorrect, but I understand writing a power like that is ambiguous, so I tried:

2. (sec(theta))^2 // Marked incorrect even though it should be correct

instead, which was surprisingly also marked as incorrect.

Does the parser not recognise that the second form is equivalent to the correct answer?

christianp commented 3 years ago

Hi, Numbas doesn't recognise the sec^2(theta) notation as equivalent to sec(theta)^2, by design. It's inconsistent with other uses of superscripts. Numbas interprets sec^2(theta) as sec^2 * theta. We have an open issue at #478 about whether to allow this notation as an option. There's a page describing the problems with the notation at https://whystartat.xyz/wiki/Powers_of_trigonometric_functions.

Tarang74 commented 3 years ago

Thanks @christianp, so do you recommend only using (sin(theta))^2 from here onwards?

christianp commented 2 years ago

@Tarang74 yes, that's what I'd use.