155 results in How-tos - search across all projects.
-
QuestionThis question demonstrates how to use the \simplify command to create natural-looking randomised mathematical expressions.
-
Question
A line with random $x$- and $y$- intercepts is plotted, and you have to drag two dots over the points where the line crosses the $x$ and $y$ axes.
-
Question
Shows how the "decimal" data type can represent very small numbers with more precision than the default "number" data type.
-
Question
The student is given a number in base 10 and asked to write it in a given base, between 2 and 16. The number has at most 3 digits in the other base.
Until it's possible to derive the expected answer for a part in the marking algorithm (see the issue tracker), this question has "show expected answer" turned off, because it just shows the base 10 number.
-
Question
A couple of different ways of showing the correct answer to a single part as soon as the student submits an answer. One way allows the student to change their answer, while the other locks the part.
A third part includes a "reveal answers to this part" button, which allows the student to choose to reveal the answer to the part.
Think very carefully before using this: by revealing the answer, you are removing the opportunity for the student to later on realise they've got that step wrong, as a consequence of some further work. It's often possible to use adaptive marking to use the student's answer in place of the correct answer in later parts.
-
Question
This question shows how to pick a GeoGebra worksheet to show to the student from a list, based on the value of a question variable.
-
Question
The student is asked to find the square root of an integer of the form $\pm n^2$. If the root is not real, they should enter "nan".
A custom marking algorithm extends the built-in one to deal with "nan".
There's some custom javascript to set the expected answer correctly. In the future this will be possible in the marking algorithm - see https://github.com/numbas/Numbas/issues/856
-
Question
Given an ascending sequence of numbers, finds the index in the sequence of the first number greater than or equal to a given value.
-
Question
Obosolete: there's now a built-in function
sort_by
.Defines a custom function sort_by to sort a list of lists by the elements at the given index.
You could do a similar thing to sort lists of dictionaries.
-
Question
Because JavaScript numbers lose precision as they get bigger, you get some unexpected results.
See the variable "two" - the difference should be 2, but because the JavaScript representation of each of the two numbers is the same, it thinks the difference is 0.
Using the decimal data type, there's no loss of precision, so the correct value is produced.
-
Question
Pick from the range -5..5, but make 0 more likely.
-
Question
Demonstrates how to set up a "choose one from a list" part where the number of choices is randomised.
The part is given a list of labels for the choices as well as a list specifying the marks to award for each choice.
-
QuestionThis question shows that you can set the number of marks available for a part to a fraction. The total available for the question is 1 mark.
-
Question
A short demonstration of when the basic simplification rules are turned on, or off.
-
Question
Shows how the \text command is rendered using the plain-text font, not the LaTeX one. Useful for displaying units of measurement and English words inside equations.
-
Question
You can use LaTeX in marking comments, but remember to escape backslashes!
-
QuestionThe statement of this question demonstrates how you can control the \simplify command's behaviour by specifying the rules to use.
-
Question
Should not be used: there's now a built-in function
frequencies
.This question randomly generates a list of 100 items, each chosen from a list of strings.
It then computes the number of occurrences of each distinct item in the list. The statement shows the frequencies in a table.
-
Question
This question uses the vis.js library to plot 3D functions and data sets.
As well as JME functions to make plots, you can use javascript functions to get more control over how the plots are rendered.
-
Question
No description given
-
Question
No description given
-
Question
This question shows how to load a GeoGebra applet from geogebra.org.
-
Question
A diagram showing the difference between lines, rays and segments in Eukleides.
-
Question
Give the student a larger area to write some free-form text, which isn't marked.
-
Question
Shows how to use the JME function lpad to add zeros to the beginning of a number so it's always displayed using two digits.
-
Question
Lay out gapfills so the student has to enter either the numerator or denominator of a fraction.
-
QuestionShows how to use the sqrtSquare simplification rule to display a randomly-chosen fraction involving surds on either the top or bottom.
-
Question
This shows how to use variable name annotations inside \simplify to display a 3D vector in terms of the standard unit vectors $\boldsymbol{i}$, $\boldsymbol{j}$, $\boldsymbol{k}$
-
Question
The student is asked to write a number with a certain property, or tick a box labelled "this is impossible" if it can't be done.
A custom marking algorithm on the gap-fill part first checks if the student ticked the box. If they did, their answer is marked correct if it really is impossible. If they didn't tick it, their number is checked against the required property.
-
Question
Demo showing how to write a custom function in javascript.