Wiris

Documentation / LearningLemur

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • LearningLemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • LearningLemur
                      • Using LearningLemur
                      • Creating Questions in LearningLemur
                      • Creating Questions in LearningLemur

                      Create a randomized right-triangle hypotenuse question with tolerance

                      Reading time: 4min

                      In this tutorial, you will create a randomized geometry question where students must compute the hypotenuse of a right-angled triangle. You will learn how to:

                      • Generate random triangle dimensions.
                      • Compute the hypotenuse automatically.
                      • Accept approximate answers using tolerance.

                      Outcome: By the end of this tutorial, your question will generate different right triangles and accept answers that are numerically close to the correct result.

                      To better understand how questions, evaluation, and randomization work together, see: How LearningLemur concepts connect

                       

                      Before you begin

                      Prerequisites

                      • You should be familiar with basic right-triangle geometry.
                      • You should have completed Create a right-triangle hypotenuse question with units.

                      Requirements

                      • A teacher account with permission to create questions in LearningLemur, accessed through learninglemur.com or your LMS.

                      Steps

                      Step 0 — Create or open a quiz

                      Why: LearningLemur organizes all questions inside quizzes, so creating a quiz first provides the workspace where you will add and manage your questions.

                      1. Open LearningLemur.
                      2. Open an existing quiz or create a new one.

                      Checkpoint: You should now see the quiz workspace with options to add questions.

                      Step 1 — Add a new question

                      Why: LearningLemur allows you to create questions either manually or with the help of AI. In this tutorial, we will create the question manually to understand how the editor works.

                      1. Inside the quiz, click Add question.
                      2. In the creation dialog, choose Manually.
                      3. Select the Open answer question.

                      This question type allows students to enter a mathematical expression using the math editor.

                      Checkpoint: You should see the Open Answer question editor, including fields for the title, statement, and answers.

                      Step 2 — Write the question statement

                      Why: The statement explains the problem students must solve. It will use variables instead of fixed values.

                      1. Enter a Question title, for example: Hypotenuse of a random right triangle.
                      2. In the Question statement, write the exercise text (these letters will later be defined as random variables).

                      You can use the MathType editor to format mathematical expressions if needed.

                      Checkpoint: The question statement should display the variables (#a, #b) instead of fixed numbers.

                      Step 3 — Define the random variables

                      Why: Random variables allow LearningLemur to generate a different version of the question each time.

                      1. Open Question settings.
                      2. Locate the Random variables section.
                      3. Add the following variables as random numbers:
                      Variable Value
                      a random integer from 2 to 7 in steps of 1
                      b random integer from 2 to 7 in steps of 1

                      These variables will define the numerators and denominators of the two fractions.

                      Checkpoint: The variables should appear listed in the Random variables section.

                      Step 4 — Define the random expression (solution)

                      Why: Instead of defining the answer directly, LearningLemur allows you to compute the correct result using a random expression based on the generated variables.

                      Define the exact expression

                      1. In the Random variables panel, go to Random expressions.
                      2. Click Add random expression.
                      3. Create the following expression:

                      This expression calculates the hypotenuse using the generated values. LearningLemur evaluates expressions in exact mode by default, so results are expressed symbolically when possible.

                      Preview the result

                      1. Click the Preview button next to the random expression definition.
                      2. A pop-up with a sample-generated value should be displayed.

                      You may see results such as 6·2 instead of a decimal number.

                      (Optional) Show the result as a decimal

                      In some cases, you may prefer students to see a decimal approximation instead of a symbolic expression.

                      1. Edit the expression:
                      sol = 1.0 * sqrt(a^2 + b^2)

                      Multiplying by 1.0 forces the calculation to use decimal values.

                      Preview again

                      1. Click the Preview button next to the random expression definition.
                      2. A pop-up with a sample-generated value should be displayed, now showing the result in decimal form.

                      When building randomized questions, it is recommended to compute intermediate results using Random expressions, and reference them later in the Answers section. This keeps the question logic clearer and makes the question easier to maintain and modify.

                       

                      Checkpoint: The variable sol should appear under Random expressions, and the preview shows either a symbolic or decimal result depending on how the expression is defined.

                      Step 5 — Define the correct answer with units

                      Why: LearningLemur needs to know the expected solution in order to evaluate student responses.

                      1. Scroll to the Answers section.
                      2. In the first answer field, enter the expression #sol with the corresponding units of measure.
                      3. Mark this answer as a Correct answer.

                      Using #sol ensures the answer corresponds to the computed result of the random expression. LearningLemur will compare student responses with this expression using the mathematical evaluation engine.

                      Checkpoint: You should see the answer marked as a correct answer (100%).

                      Step 6 — Enable units of measure

                      Why: LearningLemur must recognize the unit and prefix you use in the answer. Otherwise, the unit will be treated as plain text instead of a supported unit of measure.

                      1. Open Question settings.
                      2. Go to Units of measure.
                      3. Enable the units you want to support.
                      4. Go to Unit prefixes.
                      5. Enable the prefixes you want to support.
                      6. For this example, make sure the settings allow centimeters.

                      If it is more convenient, use the option All to select all units and don't need to look for the particular ones.

                       

                      Checkpoint: The unit is now recognized by the editor in the answer field. For example, cm appears as a recognized unit instead of plain text.

                      Step 7 — Allow tolerance for approximate answers

                      Why: By default, LearningLemur evaluates answers using exact mathematical comparison. In this tutorial, we will allow answers that are numerically close to the correct result.

                      1. Click Edit in the Evaluation options section.
                      2. Ensure Mathematically equal is selected.
                      3. In the Error Margin field, enter a tolerance value (for example, 0.1)
                      4. Choose how the tolerance is applied (you can choose between absolute error and % error).

                      This setting allows small differences between the student's answer and the correct result. For example, if the answer is , and we have set the tolerance to 0.1 of absolute error61 ≈ 7.81

                      Student answer Result
                      7.81 ✅ Correct
                      7.76 ✅ Correct
                      7.92 ❌ Incorrect

                      61 ≈ 7.81m > nIf you want greater precision, use a smaller error margin.

                      Checkpoint: The evaluation summary should indicate that an error margin is defined.

                      Step 8 — Preview the question

                      Why: Previewing allows you to verify that the question generates different values and that LearningLemur evaluates the corresponding result correctly each time.

                      1. Click Preview question.
                      2. Note the generated values for a and b in the question.
                      3. Try entering several answers, such as:
                        1. the exact value (if available).
                        2. a rounded value (e.g. 2 decimal places).
                      4. Verify that correct answers are accepted.

                      LearningLemur automatically saves your changes while you edit the question. You do not need to manually save the question.

                       

                      Checkpoint: Each preview can yield different triangles, and the correct answer is evaluated based on the values shown in that preview.

                      You're done

                      You have created a randomized geometry question that accepts approximate answers, in which students must compute the hypotenuse of a right triangle and include the unit in their answer. You learned how to:

                      • Generate random variables.
                      • Compute results dynamically.
                      • Accept approximate answers using tolerance.
                      • Combine numerical evaluation with units.

                      Next, you can continue learning with the following tutorials:

                      • Create partial scoring when units are missing

                      You can also create more complex randomized questions using advanced logic. For example, you can ensure that each generated right-angled triangle form a (possibly scaled) Pythagorean triple, ensuring all side lengths are integers. You can find more details here.

                       

                      Troubleshooting

                      The question always displays the same values.
                      Check that the question uses random variables and not fixed values.

                      Correct answers are marked as incorrect.
                      Check that:

                      • The answer uses the computed expression (#sol).
                      • The tolerance is enabled.
                      • The evaluation option is set to Mathematically equal, not Literally equal.

                      Approximate answers are rejected.
                      Check that:

                      • Tolerance is enabled.
                      • The tolerance value is large enough.
                      • The answer is expressed in the expected unit.

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Random
                      • Elementary math
                      • Combinatorics

                      Create a randomized right-triangle hypotenuse question with tolerance

                      Before you begin Steps Step 0 — Create or open a quiz Step 1 — Add a new question Step 2 — Write the question statement Step 3 — Define the random variables Step 4 — Define the random expression (solution) Step 5 — Define the correct answer with units Step 6 — Enable units of measure Step 7 — Allow tolerance for approximate answers Step 8 — Preview the question You're done Troubleshooting

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Learning Lemur

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand