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
199 stars 118 forks source link

JME Input and spaces #32

Closed BillFoster closed 13 years ago

BillFoster commented 13 years ago

For jme input (x+3)/(x+1), for example, has the brackets stripped off for display but brackets are still recorded as input which is fine. However, it would seem to be sensible, if possible, not to display spaces, as is done at oresent, but not count these as input as far as length is concerned. This would give the length restriction far more application via some form of canonical form of an answer.

christianp commented 13 years ago

I'm not sure this is a hugely good idea. Length restrictions are only a hack around not being able to look at the answer in more detail, any way.

BillFoster commented 13 years ago

Exactly the point - I have been struggling with being able to differentiate between algebraic answers (e.g. question 10 in TestA) which do not lead to marking some correct and some wrong even though they really are the same e.g. in an answer such as (4(x-4)+9(x-4))/((x-4)(x-7)) or equivalently (4x-16+9x-36)/((x-4)(x-7)) where we are looking for (13x-52)/((x-4)(x-7)) I cannot differentiate at present other than using length, and it is sensible not to penalise someone for putting in spaces in the correct answer. Until and if we can find a way around these - probably by more detailed planning of questions leading to more difficulty in authoring.

christianp commented 13 years ago

Note for myself: I'm going to amend Numbas.jme.display.treeToJME so that asterisks for multiplication are only used when necessary.

BillFoster commented 13 years ago

So this means that: a) spaces are not counted b) if a student enters say 2x then this is of length 2, but includes * for multiplication then this is of length 3 c) if enters (1+x)(2+x) then of length 10, if includes * then of length 11 d) if enters x(x+1) then a warning appears and asks if a multiplication is intended and when amended by including * this is of length 7 What happens to x y?

christianp commented 13 years ago

a) yes b) no, in both cases the * disappears c) no again d) yes, but that's not to do with this issue e) x y becomes x*y

BillFoster commented 13 years ago

That works fine for multiplication as far as my testing goes. Brackets seem to be a problem. For example, Q10 in testA if you include a redundant set of brackets eg something like (3x+2)/((x-1)((x)+2)) then these count in the length but the display does not have the redundant brackets. However, if you write (3x+2)/(((x-1)(x+2))) then the redundant brackets are not counted or displayed.

BillFoster commented 13 years ago

Forget the last comment on brackets and length, I was wrong - it works fine with extra brackets - I had forgotten that I had another check in looking for strings such as )+