STACK Issue with micrometers

STACK Issue with micrometers

by Joshua Bragg -
Number of replies: 4

I'm trying to make a question using STACK that tests basic metric unit conversions.  To that end, I'm pulling random units from a list to go into the problem itself.  The entry in the list for μm is causing problems in the display of the question.  The entry in the list is 

l1: [cm,mm,km,\mu*m]

This gives me things like this in the display when it gets used:


Any suggestions?

Average of ratings: -
In reply to Joshua Bragg

Re: STACK Issue with micrometers

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Joshua,

Sorry about this confusion.  I think (without testing this....) that the problem is caused by the \mu in your list.

The prefix for "micro" is just "u".  See https://github.com/maths/moodle-qtype_stack/blob/master/stack/maxima/stackunits.mac#L32

So, your list should be

l1:[cm,mm,km,um]

See also note (5) in https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/Authoring/Units.md

If this doesn't fix the problem, please let me know.

Chris


In reply to Christopher Sangwin

Re: STACK Issue with micrometers

by Joshua Bragg -

That works fine for students entering "um" as their units.  They do indeed get interpreted and displayed as μm.

However, in the question display that doesn't seem to work.  Instead I get just "um" displayed:


That's better than where I was before but still not ideal.

In reply to Joshua Bragg

Re: STACK Issue with micrometers

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry Joshua,

I should have thought more carefully about this answer. You need to add the following to the start of your question variables.

stack_unit_si_declare(true)

This is documented under the "units", but could have been more prominent.

Chris

In reply to Christopher Sangwin

Re: STACK Issue with micrometers

by Joshua Bragg -

Aha.  That worked perfectly.

I see where that is in the documentation now.  From a usability standpoint, could that function just be automatically called whenever the Unit input type is used?