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
202 stars 117 forks source link

Comments in variable fields #251

Closed BillFoster closed 11 years ago

BillFoster commented 11 years ago

Although the editor happily accepts // as inputting a comment on a line and outputs the value under regenerating values, when run Numbas reports for the first variable n in the question:

https://numbas-editor.mas.ncl.ac.uk/question/658/template-1-for-workshop/

Numbas Error: Invalid expression: //total number of observations random(1200..2300#2)

i.e. considered as one line even though the two lines are distinguished by different text colours in the editor.

christianp commented 11 years ago

Oh fun, another Old Python bug. The version of xml.ElementTree included with Python 3.1 doesn't support newlines in tag attributes, while the version in Python 3.2 does. The version in Python 3.1 is from 2004!

BillFoster commented 11 years ago

If this cannot be fixed by Tuesday, for the purposes of the workshop, I can get rid of all the comments (I should have checked before I put them in!) and explain verbally what they are - but not optimum!! I am preparing another version of this question where I use other means of generating data as a sort of orthogonal approach to the first template where they just change labels. But I can leave off comments here as well.

christianp commented 11 years ago

BE PATIENT! I've spent ten minutes on it so far.

BillFoster commented 11 years ago

No problems, really appreciate this - it is the weekend after all!!