Can Stack assign SI units to variables? Or can Stack evaluate (g/(g/mol)) as (mol)?

Can Stack assign SI units to variables? Or can Stack evaluate (g/(g/mol)) as (mol)?

by Armand Majer -
Number of replies: 3

My question is whether it is possible to make Stack assign SI units to variables. For instance, we would have m (as mass in grams) and M (as molar mass in g/mol). Firstly, I want the student to enter the formula for calculating the amount of substance n (in mol). The correct formula is m/M.

Then, I require the correct unit (which is mol). How could I ensure that both mol and g/(g/mol) would be evaluated as correct? So, my question is more theoretical, but likely to be useful in the future.

Thank you in advance.

Average of ratings: Useful (1)
In reply to Armand Majer

Re: Can Stack assign SI units to variables? Or can Stack evaluate (g/(g/mol)) as (mol)?

by Martin Kraska -
In principle both can be done using algebraic input. However, if you want the units to be displayed as units (roman) and the variables as variables (italic) in the validation, then you need to use the units input type for the unit question. Note, that multipart questions with mixed algebraic and units input are not supported. Make two questions, one for the formula and the other for the units.
Average of ratings: Useful (2)
In reply to Martin Kraska

Re: Can Stack assign SI units to variables? Or can Stack evaluate (g/(g/mol)) as (mol)?

by Armand Majer -
Thank you for your advice. smile Now, I understand.
Average of ratings: Useful (1)
In reply to Martin Kraska

Re: Can Stack assign SI units to variables? Or can Stack evaluate (g/(g/mol)) as (mol)?

by Miro Iliaš -
Thanks for your answer, Martin !

"...multipart questions with mixed algebraic and units input are not supported" ... fine , we will (with Armand) deal with units separately.

Best, Miro