64 results in How-tos - search across all projects.
-
Question
The student must write a percentage, using the % symbol. An alternative answer checks the cases where they forgot the percent sign (e.g. 55), or entered the corresponding scalar (e.g. 0.55).
-
Question
This demonstrates how to render a set of tuples such as $\{(1,2),(3,4)\}$ in LaTeX, starting with a list of pairs of numbers.
-
Question
Shows how to enter a logarithm to an arbitrary base, in a mathematical expression part.
-
Question
Ask for the squares of five randomly-chosen numbers between 0 and 15.
The shuffle function puts a list in random order.
-
Question
A table showing how to substitute raw LaTeX code into question text.
NOTE: You probably don't want to do this! There's usually a more robust way, where you get Numbas to make the expression for you.
-
Question
Demonstrates how to create variables containing LaTeX commands, and how to use them in the question text.
-
Question
This question shows how to use the
currencyfunction to display amounts of currency with the correct symbols. -
Question
This question shows how to display a number like "1234" as "1,234", or "1 234", using the formatNumber function.
-
Question
A method of randomly choosing variable names - use the
expression()JME function to create a variable name from a randomly chosen string.(This question also uses a custom marking script to check that the student has simplified the expression)
-
Question
Demonstrating that \$ produces a normal dollar sign.
-
Question
Use attributes of the form
eval-<name>to dynamically set an attribute on an element based on question variables. -
Question
Use the CSS preamble to give a bit more space between multiple choice answers.
-
Question
A randomised table is contained in a div tag with the id
#sales-table, so it can be styled using the CSS preamble. -
Question
CSS classes "english" and "cymraeg" apply different background colours to English and Welsh portions of text.
-
Question
Example of displaying a randomly chosen image.
-
Question
There are copious comments in the definition of the function eqnline about the voodoo needed to have a JSXGraph diagram interact with the input box for a part.
-
Question
The student is shown two number entry gaps on either side of a 'less than' sign. Their answer is marked correct if the first number is less than the second, using a custom marking algorithm.
This shows how to mark the gaps in a gap-fill part together, rather than independently.
-
Question
A demonstration of how to use the "variable list of choices" option for a "choose one from a list" part to shuffle only some of the choices, and always have the same "I don't know" choice at the end of the list.
-
Question
This question uses the linear algebra extension to generate a system of linear equations which can be solved.
We want to produce an equation of the form $\mathrm{A}\mathbf{x} = \mathbf{y}$, where $\mathrm{A}$ and $\mathbf{y}$ are given, and $\mathbf{x}$ is to be found by the student.
First, we generate a linearly independent set of vectors to form $\mathrm{A}$, then freely pick the value of $\mathbf{x}$, and calculate the corresponding $\mathbf{y}$.
To generate $\mathrm{A}$, we generate more vectors we need, then pick a linearly independent subset of those using the
subset_with_dimensionfunction. -
Question
The student's answer is a fraction of two polynomials. First check that the student's answer is a fraction, then check that the numerator is of the form $x+a$.
To find the script, look in the Scripts tab of part a.
-
Question
An all-or-nothing marking scheme for a gap-fill part: the student must answer every gap correctly to get all the marks. If any gap is incorrect they get 0 marks for the whole part.
-
Question
This question shows how to load a GeoGebra applet in JavaScript, avoiding the JME functions. This allows you to do some more complicated manipulation of the worksheet than simply redefining objects.
-
Question
The student is asked to factorise a quadratic $x^2 + ax + b$. A custom marking script uses pattern matching to ensure that the student's answer is of the form $(x+a)(x+b)$, $(x+a)^2$, or $x(x+a)$.
To find the script, look in the Scripts tab of part a.
-
Question
No description given
-
Question
Choose from one of several pre-defined scenarios, and set variables to the corresponding values.
This question has three variables:
city,population, andpercent_like_chocolate. These differ for each city. -
Question
Display a number as a mixed fraction when appropriate, using the mixedFractions display option.
-
Question
The custom function
rectangle(width,height)draws a rectangle with the given dimensions, along with some labels. -
Question
Just showing how to use the stdev function from the stats extension to calculate the standard deviation of a list of numbers.
-
Question
A function which renders the factorisation of a number in LaTeX.
-
Question
Show a list of the factors of a number.
Works by testing each number up to $n$ for divisibility by $n$, so won't do well with really big numbers. Certainly fast enough for numbers up to 4 or 5 digits.