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

Different input widgets for number entry #375

Open christianp opened 9 years ago

christianp commented 9 years ago

If the number entry part accepts numbers in different formats, we should offer special input widgets to suit those formats.

Fraction

Two input boxes on top of each other, with a horizontal line between them.

I've hacked together a question at https://numbas.mathcentre.ac.uk/question/8269/fraction-input-with-custom-css/ using the matrix input part. That's inconvenient because it needs some custom CSS, and the "correct answer" is a matrix - ideally, it should just be a number.

image

Options:

Complex number

Two input boxes, with a plus sign in between and i after the second one.

image

Options:

christianp commented 8 years ago

This relates to #380

christianp commented 7 years ago

Pressing the up or down arrow keys should move between the boxes, and while we're at it, pressing the / key while in the top box should move you to the bottom box.

christianp commented 5 years ago

Just had another look at this. I don't think the complex number input is good, particularly because it'll look odd when the imaginary part is negative.

I can see the fraction input being useful for early arithmetic, when the student might not have made the connection that \frac{x}{y} has the same meaning as x \div y, or x / y written inline. In fact, on some devices the / key is much harder to find than the digits.