Development update: August 2020

We’re continually working on Numbas, fixing bugs and adding new features. I thought that it would be a good idea to post more regularly about updates to the Numbas software, rather than waiting until each year’s major version release to list everything that’s changed.

I’m going to go into a bit more detail on changes than I normally would in major-release posts, to give an idea of what day-to-day development on Numbas looks like.

I’d like these posts to be monthly, but I’m about to embark on a month of paternity leave, so don’t expect another one until the end of October.

So, here’s what’s changed since Numbas v5.0 was released in June.

Numbas runtime

General

  • Enhancement: The logic around the question “how long is this variable name?” has been improved greatly. This matters when you’re using things like Greek letters, which take several characters to write in JME, but are displayed as a single symbol. (code)
  • Enhancement: The ‘expand juxtapositions’ logic (used to implement the implicit multiplication and composition rules) makes use of this enhanced logic to better split up long names into single-letter variables. (code)
  • Bugfix: The “scientific notation” number notation style no longer puts spaces between groups of digits. (code)

Interface

  • Enhancement: Updated the translations, adding Indonesian.
  • Enhancement: When you end the exam, you’re now always shown the “results” screen – the “you may close this window” screen is no more. Whether you see the question score breakdown depends on the “show the results page” exam option. This means that students are now always shown the button to print a transcript of their exam, even if they don’t get any feedback. (code)
  • Enhancement: The default theme now has a favicon. (code)
  • Bugfix: Content areas containing only an image or an iframe no longer count as ’empty’. (code)

Marking

  • Enhancement: For part types that do some parsing (mathematical expression, number entry, matrix entry), the interpreted_answer note now fails if the student’s answer is not valid. This matters in explore mode, or in complicated gap-fill marking algorithms. (code)
  • Enhancement: The “extension” part type no longer assumes you’re going to write a custom marking script in JavaScript – you can write a JME marking algorithm instead. The GeoGebra extension now uses this, providing some JME functions to query a worksheet. (code)

JME

New functions

  • reorder and shuffle_together make it easier to take several lists and apply the same permutation to them. (issue)
  • replace_regex replaces all substrings that match the given regular expression with a given value.
  • atan2(y,x) implements the widely-used function which is equivalent to $\arctan(y/x)$, but ensures the result is in the right quadrant.

Other changes

  • Enhancement: The random function returns an integer when given a range of integers. (issue)
  • Enhancement: The functions ceil, round and floor return integer values, not number. (code, issue)
  • Enhancement: When substituting values into content areas, data types that can automatically convert to HTML do so. This makes it more convenient to use the new geogebra data type provided by the GeoGebra extension. (code)
  • Enhancement: Within a part (content areas and the marking algorithm), the JME variable part_path is now defined, giving the unique ID of the part. Interactive elements such as GeoGebra worksheets can use this value to link to the part they’re embedded in. (code)
  • Bugfix: The output of dpformat and sigformat functions is displayed as plain text when substituted using curly braces, or TeX code when substituted inside a LaTeX environment. (code)
  • Bugfix: Upper-case Greek letters in JME expressions are displayed in upper-case. Previously they were incorrectly converted to lower-case. (code)
  • Bugfix: Rational values are displayed as fractions, rather than decimals. (code)
  • Bugfix: The exec function now evaluates lazily, so it doesn’t try to evaluate function tokens. It’s still quite awkward to use, so I prefer substitute. (code)
  • Enhancement: You can define several variables at once: write a list of names separated by commas, and ensure that the definition produces a list of at least that many items. This makes it much easier to work with “scenario” questions, where you’ve got a finite list of scenarios to choose from, each with several associated variable values. (code)
Variable editor interface. The name field contains "a,b,c" and the value field "shuffle(1..10)". The description says "Three distinct numbers between 1 and 10". On the right, the variable preview shows three rows a,b and c with generated values 5, 10 and 1.
  • Bugfix: The scientificnumberlatex function marks its output as “safe”, so the curly braces around the exponent don’t get interpreted as variable substitution. (code)
  • Bugfix: Expressions with a complex number on the left-hand side, such as i*x, don’t omit the multiplication symbol. (code)

JavaScript:

  • Bugfix: The question signal HTMLAttached only fires after all the question’s HTML has been attached, including parts. (code)
  • Bugfix: When loading a mathematical expression part, the ‘answer simplification string’ setting has a default value. (code)
  • Bugfix: Part.markAlternatives copes with the marking function returning an invalid result. (This affected old questions with custom JavaScript marking scripts) (code)
  • Enhancement: When a JME marking algorithm produces an error, it’s exposed in the result object. This allows the editor to show the error in detail rather than just “the answer is invalid”. (code)
  • Bugfix: jme.calculus.differentiate now checks for compatible types, rather than being fixed to the ‘number’ data type. This makes it work on the number-like types such as integer, rational and decimal. (code)
  • Bugfix: … and I fixed the partial differentiation rules, which never properly worked. (code)
  • Enhancement: JME function signature definitions can label arguments, to make it easier to establish which optional arguments have been provided. (code)
  • Enhancement: Within a JME function signature, you can specify a list with optional entries. (code)
  • Bugfix: When casting the arguments to a function to match a signature, list elements are also cast. (code)

Extensions

  • I almost entirely rewrote the GeoGebra extension. You can now create a GeoGebra worksheet entirely in JME or from a .ggb file uploaded as a question resource, rather than loading a worksheet from geogebra.org. The link between worksheets and parts has been improved – you can fill in the input for a number entry or matrix entry part with the value of a GeoGebra variable, and you can query a GeoGebra worksheet from within a part’s marking algorithm. (Documentation, demo questions)
  • I spent some time improving the JSXGraph extension, but didn’t get quite as far as I did with GeoGebra. You can now create a JSXGraph diagram entirely in JME, or using JSXGraph’s JessieScript language. (Documentation, demo questions)
  • I fixed a couple of bugs in the Eukleides extension.
  • I added some new functions to the permutations extension, and a custom part type which assesses a permutation written in cycle notation. I don’t have a public demo of this extension, sorry!
  • Prompted by a request on the numbas-users list, I wrote a small extension which provides a function to write a number out in words. (Documentation, demo)

Outstanding issues

There are 93 open issues on GitHub, 18 of which were added after v5.0 was released.

Numbas editor

Enhancements

  • Superusers no longer see every extension in the question editor. (This is an enhancement for me, because I was seeing dozens!) (code)
  • When testing a part’s marking algorithm, errors in the mark note are caught and displayed, rather than just saying “your answer is invalid.” This makes it easier to debug marking algorithms. (code)
  • In the non-editing view of a gap-fill part’s prompt, gaps are displayed nicely as boxes with the gap’s name, rather than a number inside square brackets. (issue)
  • When you upload an image as a question resource, you’re asked to give a text alternative for anyone who can’t see the image. (issue)
Screenshot of editor interface. On the left is an image, and on the right are two fields labelled "URL" and "Text alternative"
  • There’s now a “long plain text string” definition template for variables. This makes it easier to store strings that span multiple lines. I’m always keen to add new templates for the variable editor. (issue)
  • The editor now uses Django 3.1 and other Python dependencies are up to date. (code)

Bug fixes

  • When editing a new file in an extension, it’s included in the list of files. (issue)
  • The list of files in an extension is shown when viewing the Options and Access tabs. (issue)
  • The item preview and embed views now have a favicon like other pages. (code)
  • When you click to write a comment, the rich text editor loads immediately, rather than requiring another click. (issue)
  • Fixed the help link for the mathematical expression part setting “pattern student’s answer must match”. (issue)
  • The “Parts mode” select box when creating a question is now styled the same as other select boxes. (code)

Outstanding issues

There are 42 open issues on GitHub, 6 of which were opened after v5.0 was released.

Numbas LTI provider

We released version 2.7 of the LTI provider. It adds a global dashboard view, an option to only show completed attempts when viewing the statistics for a resource, client-side completion receipt codes for attempts, and some bug fixes around time zone handling, sending email receipts on attempt completion, cross-site security and text formatting.

There are 32 open issues on GitHub, one of which was opened after v5.0 was released.

Documentation


That’s it for now. See you in October!