Development log: February 2015

We’ve just updated the Numbas editor with a “Licence” field on both questions and exams, which lets you specify the licence under which you allow other people to use your work. To begin with, you can pick from “All rights reserved” or any of the Creative Commons licences.

When you search for questions or exams, you can filter the results by what you’re allowed to do with them – freely reuse, modify, or reuse commercially. If you apply any of these filters, content with no licence specified will be excluded, so please make sure you specify a licence for your material!

Happily, everything produced at Newcastle University and uploaded to the mathcentre Numbas editor is available under a CC BY (free to reuse with attribution) licence.

Note that these licences aren’t enforced by the software – they’re just there to help people do the right thing when compiling open-access resources. If you don’t want your material to be publicly available, the solution is still to use the access controls to make your questions and exams hidden by default.

Since I’m here, I’ll do a general development log as well.

In case you missed them, two big new features are the variable testing tools and the matrix entry part.

Other changes

The Numbas runtime:

  • LaTeX strings generated in JME expressions are now handled better (code)
  • MathJax processing errors are caught when the exam starts, and a big error message is shown. They used to slip by silently, which meant they could slip by testing. (code)
  • Fixed Numbas.math.niceNumber when rounding to a given number of significant figures. (code)
  • Numbas.math.niceNumber on -pi doesn’t include a “1” any more. (code)
  • When resuming an exam, gapfill parts are recorded as answered if any of their gaps have been answered (previously, all gaps had to be answered). (code)
  • There’s now a set data type in JME (code, documentation)
  • Added a few functions emulating Python’s itertools methods, such as product, combinations, etc. (documentation)
  • There’s now an in operator, to test if an element belongs to a given list, set or range. (code, documentation)
  • You can now map over a list of lists (such as a Cartesian product of two lists), assigning a different name to each element. (code, documentation)
  • I’ve changed the way Numbas.math.precround works so it should introduce fewer errors. (code)
  • There were some cases in rendering a TeX expression when you could have two distinct numbers next to each other without a times symbol. That shouldn’t happen any more. (code)
  • MathJax now runs on the exam’s title, so any TeX there will be typeset. (code)
  • Numbas.jme.display.texName, the function which renders a JME variable name as LaTeX, is no longer private, so it can be used in extensions and custom scripts. (code)
  • The pattern-matching syntax can now deal with “either something or nothing” terms. (code)
  • Numbas.jme.lazyOps and Numbas.jme.synonyms, two dictionaries which define how the JME expression compiler works, are now public. In future they should become part of the JME Scope object, but for now you can modify them this way in extensions. (code)
  • precround and siground now work on matrices – each element is rounded to the given precision. (code)
  • Added Numbas.math.mod, which always returns a positive number, unlike JavaScript’s % operator. (code)
  • You can now construct a matrix from a list of vectors, representing the rows. (code)
  • There’s now an option to allow the student to enter a fraction as their answer to a “number entry” part. There’s also a separate option to display the correct answer as a fraction. (code, documentation)
  • In JME, you can now divide matrices or vectors by scalars. Previously, you had to multiply by the reciprocal. (code)
  • You can now use negative indices on matrices and vectors (e.g., m[-1] gives the last row of a matrix) (code)
  • You can now do max(list) and min(list), to find the maximum or minimum element of a list. (code)

The Numbas editor:

  • The results in the question search tab when editing an exam now show you when each question was last modified. (code)
  • The list of data types available when defining a custom JME function is generated from Numbas.jme.types, so types provided by extensions are available. (code)
  • Ungrouped variables stay in the same order when you reload the question editing page. (code)
  • There’s now a button to sort the variables in a group by name. (code)
  • Fixed the “replace with gapfill” button so steps aren’t lost. (code)
  • The editor now uses TinyMCE 4 for content areas. It’s got a lot of improvements, the most notable of which is that the editing area automatically grows to fit the content, and there are lots more formatting options. (code)
  • When writing the prompt for a gapfill part, gaps are now represented by special placeholder elements instead of code. There’s a button in the editor to insert a gap placeholder, and double-clicking on a placeholder will open a dialogue box to change the gap it refers to. (code)
  • Dave Gabrielson fixed a broken link. (code) Thanks!
  • The editor now runs on Django 1.7. If you’re running your own installation, you no longer need to use the South module for data migrations, since they’re now part of Django 1.7. (code)