Development log: May 2015


We’ve just updated the Numbas editor with another long-awaited feature: a “shopping basket” to keep questions while you browse the database. You can create an exam containing the questions in your basket with one click, or select individual questions from the basket inside the question editor. This resolves a long-standing problem with the exam editor – when there can be dozens of questions with the same name, and copies of those questions, it was very hard to find the questions you want in the miniature search interface included in the question editor.

I’ve updated the “create an exam” tutorial with instructions on how to use the new “shopping basket” feature.

Other changes

The Numbas runtime:

  • Added a JME function list(range) to convert a range to a list. (docs)
  • Added a JME function filter to select only elements of a list which satisfy a predicate. (code)
  • Added JME function let to assign a variable temporarily. (docs)
  • Fixed Numbas.jme.display.treeToJME on a function with no arguments. (code)
  • Added JavaScript function and JME function zip, which zip two or more lists together. (docs)
  • Fixed a problem when substituting a string into plain text just before some TeX code. (issue)
  • div tags in question content, matrix entry inputs and correct answer displays get horizontal scrollbars when they’re too wide. (code)
  • Fixed a bug where the radio buttons in the correct answer for a “match choices with answers” part weren’t set properly. (code)
  • Part object constructor functions are now available in JavaScript through (code)
  • Fixed a bug with precround when rounding a negative number. (code)
  • Numbas.jme.wrapValue can take a type hint when passed an array, when you want a matrix or vector, for example. (code)
  • You can use the arrow keys to move between cells in the matrix input part. (code)
  • You can give a dictionary of variables to Numbas.jme.Scope.evaluate, instead of explicitly creating a new scope with those variables in. (code)
  • Fixed a bug where variable names which contain an operator name (such as in) followed by an underscore were parsed as the operator name. (code)
  • The student’s name and ID are loaded from SCORM and displayed on the results page. (code)
  • You can now specify when custom part scripts run in relation to the built-in scripts: before, after, or instead of the built-in script. (code)
  • Fixed the logic for putting brackets around complex numbers. (code)
  • Fixed the question variable made available to custom functions written in JavaScript. (code)
  • The product function doesn’t die when one of the lists is empty. (code)
  • JME string restrictions are case insensitive. (code)

The Numbas editor:

  • The variable testing tab header shows “active” when a condition is defined. (code)
  • Fixed a problem with case-sensitivity in the variable dependency list. (issue)
  • The various errors that can arise when generating variables are handled better. (code)
  • When trying to find a set of variables satisfying the condition, we only generate the variables required to evaluate the condition. (code)
  • The default value in the “insert gapfill” dialog is one more than the maximum gap number already present. (code)
  • There’s now a “conditional visibility” button in the editor, which lets you specify a condition in JME for showing a section of text. (code)