Development update: March 2021

Here’s another update on Numbas development, covering February and March, 2021.

I’ve mainly been spending time on developing new features for Numbas v6 lately, so the published versions have mainly just had bugfixes, but there are a couple of new things.

Notable changes include the ability for students to choose their own colours in the default theme, and some new marking methods for “choose several from a list” and “match choices with answers” parts.

New “Getting Started” exam

I had a look at our old “Getting Started” exam, which is supposed to show students how Numbas works and how to enter their answers. I don’t think it had been changes since it was written nearly a decade ago, so it was time for a rewrite!

I started from scratch so I could best make use of newer Numbas features like the menu navigation mode for exams, and explore mode questions.

I’ve published the new exam on the mathcentre editor. Please give it a go, and offer it to your own students if you think it would be helpful. Write a comment on the editor if you spot any problems, or have a suggestion on how it can be improved.

It’s written under the assumption that students will access exams through the Numbas LTI tool, so some of the information about how data is saved is not accurate for exams delivered standalone or through a generic SCORM player.

A demo of how to extract data from a Numbas exam

Over the years, a few people have asked about getting data out of a Numbas test without running it inside a VLE or the LTI tool.

I’ve made a small demo showing how to embed a Numbas exam in a page, then in the parent page I’ve reused the SCORM API from the Numbas LTI tool to record data from the Numbas exam. The exam package has to be hosted on the same domain as the containing page, so it’s not quite as simple as using the embed URL that the Numbas editor gives you.

The demo is at https://extract-data-from-numbas-exam.glitch.me/.

It doesn’t save the data anywhere – that’s something you’d have to set up yourself, either reusing the code from the LTI tool, or by writing your own.

Think carefully before attempting this: the LTI tool does a lot of stuff, like managing user accounts, handling connection problems and applying availability date restrictions, that you’d have to reimplement.

Numbas runtime

I’ve tagged v5.4 of the Numbas runtime on GitHub.

Enhancements

  • The default theme now includes a “display options” dialog box, which allows the student to choose the colour used for the page background, as well as the colour and size of most text. (issue)
Dialog box. "Use these controls to change the appearance of the exam". Colour picker widgets labelled "background colour" and "text colour", then a number input labelled "text size". Buttons "Reset to defaults", "Cancel", "OK".
Students can now change the background colour, and the colour and size of text.
  • The “choose several from a list” and “match choices with answers” part types now have a “marking method” setting. The options are “sum ticked cells” (the old behaviour), “score per matched cell” (the student’s score is proportional to the number of options whose state matches the corresponding option in the expected answer), and “all-or-nothing” (the student only gets the marks if their answer matches the expected answer exactly). (issue, documentation)
  • The iterate_until function now has an optional argument max_iterations, to avoid infinite loops. (documentation)
  • The default number notation used when rendering numbers as strings matches the convention used in the exam’s current locale. (issue)
  • Compiled exam packages now contain the URL to edit the exam. (code)

Changes

  • Feedback to do with an invalid input to a part is always shown under the “submit part” button, even if all other feedback is turned off. (code)
  • When substituting strings marked “safe” into content areas, slashes are not stripped out. (code)

Bugfixes

  • The rational and imaginary variable name annotations used in pattern-matching are now rendered in LaTeX. (code)
  • In Numbas.jme.expandJuxtapositions, function names are treated as case-insensitive. (issue)
  • Answer input boxes expand properly when opening an attempt in review mode. (issue)
  • Restored the correct styling on “expected answer” and disabled inputs in the default theme. (code)
  • In a “number entry” part, when checking if the student has used the correct precision, the notation style used doesn’t matter. (code)
  • When a part is set to use the “always replace variables” adaptive marking strategy but there are no variable replacements, only the standard marking is applied. (code)
  • When one or both of the minimum or maximum accepted values for a “number entry” part is $\pm \infty$, a reasonable expected answer is shown. (code)
  • Brackets are correctly applied in nested multiplications involving unary minus. (code)

The Indonesian translation is now complete. Thanks to everyone who contributed!

Numbas editor

I’ve tagged v5.4 of the Numbas editor on GitHub.

Enhancements

  • The instance of the question used for testing part answers in the “marking algorithm” tab is only recreated when that part is open. This greatly speeds up the editor on questions with lots of parts. (code)
  • The theme editor has been improved: new themes now come with a style.css file, along with some CSS variables to easily change the main colours. There’s also a drop-down box to change a file from the default theme, so you don’t need to look at the source code repository. (code, documentation)

Changes

  • The default set of allowed number notation styles for “number entry” parts follows the convention in the user’s current locale. (code)
  • Variable values are always shown as JME code, rather than using the tokenToDisplayString method, which now uses the locale’s convention for number notation. (code)

Bugfixes

  • The button to lock a variable’s value in the editor works again. (issue)
  • Removed a couple of duplicated fields for part settings. (code)
  • When a custom function which should return a value of type number returns a complex number, the editor no longer shows a warning. (issue)
  • The text editor for a comment in the editing history box is cleared after the comment is saved. (issue)
  • After an exam is created, the editor saves its content immediately, so that the content saved in the database contains all the required values. (code)

Documentation

Numbas LTI provider

I’ve tagged v2.12 of the Numbas LTI provider on GitHub.

Enhancements

  • I think I fixed the problem with Chrome and Safari’s cross-site security policies blocking the LTI provider’s session cookie on launch. (code)
  • The list of exam packages associated with a resource now includes download links for each package. (code)
  • The “replace exam package” page now shows a link to open the exam in the editor. (code)

Changes

  • The process for storing attempt suspend data records as diffs of more recent values is changed, so hopefully it won’t clog up all the worker processes any more. (code, issue)

Bugfixes

  • The “email completion receipts” setting isn’t shown when the LTI provider is not configured to send email receipts. (issue)