From 4a67396cf5b2b7f22021a888cff32972ffa99b70 Mon Sep 17 00:00:00 2001 From: Christian Lawson-Perfect Date: Tue, 29 Nov 2022 13:21:22 +0000 Subject: [PATCH] some documentation fixes --- runtime/scripts/jme-display.js | 6 +++--- runtime/scripts/math.js | 3 ++- themes/default/files/scripts/mathjax.js | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/runtime/scripts/jme-display.js b/runtime/scripts/jme-display.js index 4d535cf5f..00c939348 100644 --- a/runtime/scripts/jme-display.js +++ b/runtime/scripts/jme-display.js @@ -973,7 +973,7 @@ JMEDisplayer.prototype = { /** Display a complex decimal. * * @abstract - * @param {decimal} n + * @param {Numbas.math.ComplexDecimal} n * @param {Numbas.math.niceNumber_settings} options * @returns {*} * @see Numbas.jme.display.JMEDisplayer#decimal @@ -984,7 +984,7 @@ JMEDisplayer.prototype = { /** Display a decimal as a fraction. * * @abstract - * @param {decimal} n + * @param {Decimal} n * @param {Numbas.math.niceNumber_settings} options * @returns {*} * @see Numbas.jme.display.JMEDisplayer#decimal @@ -995,7 +995,7 @@ JMEDisplayer.prototype = { /** Display a decimal as a decimal. * * @abstract - * @param {decimal} n + * @param {Decimal} n * @param {Numbas.math.niceNumber_settings} options * @returns {*} * @see Numbas.jme.display.JMEDisplayer#decimal diff --git a/runtime/scripts/math.js b/runtime/scripts/math.js index 93e42834a..708746e59 100644 --- a/runtime/scripts/math.js +++ b/runtime/scripts/math.js @@ -1148,7 +1148,8 @@ var math = Numbas.math = /** @lends Numbas.math */ { /** Get the significand and exponent of a number written in exponential form. * * @param {string} str - * @returns {object} `{significand: number, exponent: number}` + * @param {boolean} [parse=true] - Parse the significand and exponent values to numbers, or leave them as strings? + * @returns {object} `{significand: number, exponent: number}` if `parse` is true, or `{significand: string, exponent: string}` */ parseScientific: function(str, parse) { var m = /(-?\d[ \d]*(?:\.\d[ \d]*)?)e([\-+]?\d[ \d]*)/i.exec(str); diff --git a/themes/default/files/scripts/mathjax.js b/themes/default/files/scripts/mathjax.js index 7f84c6b4c..3a6b6684c 100644 --- a/themes/default/files/scripts/mathjax.js +++ b/themes/default/files/scripts/mathjax.js @@ -3,6 +3,11 @@ Numbas.queueScript('mathjax-hooks',['display-base','jme','jme-display'],function return; } + /** Wrap a variable substitution inside `\simplify` with the `texify_simplify_subvar` function so it can be evaluated. + * + * @param {string} expr + * @returns {string} + */ function wrap_subvar(expr) { var sbits = Numbas.util.splitbrackets(expr,'{','}'); var out = '';