Spreadsheet Extension and Quantities.

7 views
Skip to first unread message

William Haynes

unread,
Oct 20, 2025, 10:29:00 AM (13 days ago) Oct 20
to Numbas Users
I would like to use the spreadsheet extension, where the expected answers are quantities.

Is this possible?    

If I  put qty(1,"cm") into a cell, it seems to be marked as text, so "1 cm" works,  but "1.0 cm"  and "1cm" are marked as  incorrect.

Thanks,
Will

Christian Lawson-Perfect

unread,
Oct 21, 2025, 12:05:47 PM (12 days ago) Oct 21
to numbas...@googlegroups.com
Yes, it's possible!
You'll have to write a custom marking algorithm, though.
I deliberately designed the spreadsheet part type so that this kind of thing wouldn't be too difficult. I've made an example at https://numbas.mathcentre.ac.uk/question/182270/quantities-in-a-spreadsheet/. It changes the marking algorithm to parse quantities in cells, so they can be compared as quantities instead of as text.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/numbas-users/b9c00032-0f41-4619-9138-10288f8f5acbn%40googlegroups.com.

William Haynes

unread,
Oct 21, 2025, 3:11:22 PM (12 days ago) Oct 21
to numbas...@googlegroups.com
Thanks! That's a big help.  I'll study how you did it for the next time.
  
Will

Reply all
Reply to author
Forward
0 new messages