643 results authored by Christian Lawson-Perfect - search across all users.
-
Exam (3 questions) in How-tos
These questions show how to use JSON data to represent structured information.
-
Question in How-tos
Create a list of records for randomly-generated people. Each record contains the person's name, age, and list of hobbies.
The names and hobbies are generated from JSON data.
-
Question in How-tos
A function which renders the factorisation of a number in LaTeX.
-
Question in How-tos
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.
-
Question in How-tos
Choose from one of several pre-defined scenarios, and set variables to the corresponding values, defined in lists.
This question has three variables:
city
,population
, andpercent_like_chocolate
. These differ for each city. We've defined a list for each variable, with the corresponding values. A variable calledscenario
picks a random position in the list, so the value ofcity
, for example, iscities[scenario]
. -
Question in How-tos
Some clever variable-substitution trickery to randomly pick two sides of a right-angled triangle to give to a student, and ask for the other.
The sides are set up so they're always Pythagorean triples, and the opposite side is always odd.
As ever, most of the tricky stuff is in the advice.
Because this was created quickly to show how to set up the randomisation, there's no diagram. It would benefit greatly from a diagram.
-
Question in How-tos
One method of randomly choosing names for variables. For each variable, we have 4 options. Create a list of 4 numbers, which is 1 for the name we want to use, and 0 otherwise.
Then, whenever we use that variable, multiply each of the possible names by the corresponding number in the list. When the expression is simplified, the unwanted names will cancel to 0, leaving only the name we want.
This is quite clunky!
(This question also uses a custom marking script to check that the student has simplified the expression)
-
Question in How-tos
Load data about members of the Scottish parliament from a JSON object, and display a table of 5 randomly picked MSPs.
-
Question in How-tos
Load data on some items held in the Cooper Hewitt collection, and show a table of 5 randomly picked items.
-
Question in How-tosShows how to safely include LaTeX in a string variable.
-
Exam (5 questions) in Christian's workspace
Identify parts of statistical formulas, and answer questions about how changing one variable affects the statistic.
-
Question in How-tos
This question adds a CSS rule to hide the brackets around the matrix input.
-
Question in How-tos
Some custom CSS restyles the matrix input so it looks like a fraction, with input boxes on top and bottom.
Ideally, there should be a fraction input part type, or an option for the number entry part to display a fraction input.
-
Question in How-tosThe student must expand an expression of the form $(x+a)(x+b)(x+c)$. A pattern restriction ensures there are no brackets in their answer.
-
Question in How-tos
Numbas can now understand and use several different styles of notation for numbers.
This question shows off all the supported styles, both for display in text and in the answers to number entry parts.
-
Question in How-tos
Show one of several blocks of text depending on the value of a question variable.
As well as a simple check for the value of a variable, the condition to display a block of text can be a complex expression in any of the question variables - in this example, depending on the discriminant of the generated quadratic.
-
Question in How-tos
Student is given a few numbers to choose from. They must pick at least two, and then give the sum of their chosen numbers.
-
Question in How-tos
This question asks the student to give a function with a particular root. It then asks them to divide by (x-{root}), and uses adaptive marking to mark against the previous answer.
This uses the "expression" data type, which is currently undocumented and experimental.
-
Exam (2 questions) in How-tos
This exam turns off all the feedback options, so students know nothing about how they've done.
-
Question in How-tos
This question shows how to ask for a number in scientific notation, by asking for the significand and exponent separately and using a custom marking algorithm in the gap-fill part to put the two pieces together.
Answers not in standard form, i.e. with a significand not in $[1,10)$, are accepted but given partial marks.
-
Question in How-tos
A randomly generated list of numbers is shown to the student. They must tick every occurrence of the lowest number. The number of occurrences isn't always the same - sometimes the minimum is unique and sometimes it is repeated. The
map
function makes it easy to construct a marking matrix. -
Question in How-tos
The student has to compute $a^b$ and $b^a$, then decide which of the two is bigger.
This question shows how to set up a custom marking matrix for the "choose one from a list" part, based on values used elsewhere in the question. It could use adaptive marking to use the student's incorrect values for the comparison, but doesn't at the moment.
-
Question in How-tos
A "match choices with answers" part where the student either gets all the marks or none. Any incorrect choice is penalised with a huge negative mark, so they end up with the minimum mark of 0.
-
Question in How-tos
A mathematical expression part whose answer is the product of two matrices, $X \times Y$.
By setting the "variable value generator" option for $X$ and $Y$ to produce random matrices, we can ensure that the order of the factors in the student's answer matters: $X \times Y \neq Y \times X$.
-
Question in How-tosThis question contains a single "match text pattern" part which accepts anything you type into it.
-
Question in How-tosThis question shows how to make the correct answer to a "choose one from a list" part depend on randomised question variables, in a couple of ways. The first part uses JME expressions to define the marks available for each choice. The second part uses the "custom marking matrix" option.
-
A randomised line in a GeoGebra worksheet - construct the definition of the line manually Should not be usedQuestion in How-tos
Construct a line in a GeoGebra worksheet by writing its definition string by hand.
This isn't a very neat way of doing this. It's easier to define two points in GeoGebra, then make a line through those points. You can set the positions of the points from Numbas using vectors.
-
Question in How-tos
Construct a line through two points in a GeoGebra worksheet. Change the line by setting the positions of the two points when the worksheet is embedded into the question.
-
Exam (6 questions) in Content created by Newcastle University
Practice bank of multivariable calculus questions
-
Question in Content created by Newcastle University
Gradient of $f(x,y,z)$.
Should include a warning to insert * between multiplied terms