Skip to content

Commit

Permalink
some documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Nov 29, 2022
1 parent 23503fe commit 4a67396
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions runtime/scripts/jme-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion runtime/scripts/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions themes/default/files/scripts/mathjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down

0 comments on commit 4a67396

Please sign in to comment.