How do I create a calculated question?

A calculated question is similar to numeric response in that it presents students with a sentence, paragraph, or formula that includes text boxes where they will enter numbers to fill in the blanks.  Unlike numeric response, calculated questions can have different numbers and answers for each student who takes the assessment.

There are four parts to a calculated question that you define (three required and one optional):

  1. Question text,
  2. Variable(s) in the question,
  3. Formula(s),
  4. Calculation(s) (optional).

The steps in this article assume that you have already gone to the Tests & Quizzes tool and selected an assessment, but if you need more help completing these steps, open the links below.

Go to Tests & Quizzes.

Select the Tests & Quizzes tool from the Tool Menu of your site.

Select an assessment.

Questions may be added to a new or existing assessment, or added directly to a question pool as described in How do I add a question to a question pool?

Create a new assessment.

Create from Scratch with assessment builder selected

For steps to create a new assessment, see How do I create an assessment?

Or edit an existing assessment.

Select Edit from the Action drop-down menu for the assessment.


  • Assessment editing must take place in the Working Copies tab or in the Published Copies tab before anyone accesses the assessment to take it.
  • Changes made to assessments in Working Copies do not affect assessments in Published Copies, and vice versa.

Select Calculated Question from the Add Question menu.

Use the Add Question drop-down menu to select a question type, and choose Calculated Question.

Set the point value for the question.

Enter an Answer Point Value into the text box.

Tip: An assessment's total point value is the sum of all its questions' point values (e.g., an assessment with 10 questions worth 10 points each will be worth 100 total points).

Display point value while students are taking the exam.

To Display Point Value while student is taking the exam, leave the default value of Yes.  To hide the point value, select No.

Note: To hide the point values for ALL questions in your assessment, it is recommended to select this option in the assessment Settings rather than for individual questions.

Enter the question text.

Following the formatting described in the examples below, Basic Question Structure and Advanced Calculations, enter the Question Text into the Rich-Text Editor.

Basic Question Structure

To display a variable value in your question text, enter the variable letter in curly brackets { }, for example: {x}. When a student takes the assessment, a number randomly selected from a range you will define replaces the variable.

Insert a letter in double curly brackets {{ }}, for example: {{z}}, within the question text to define a text box where a student will enter a response.

Basic Question Examples

Question Text Variable Values
Formula(s) Tolerance Sample Student View
{x} - {y} = {{z}}
x = Min: 1, Max: 10, Decimal Places: defaults to 3

y = Min: 1, Max: 5, Decimal Places: defaults to 3
z = {x} - {y}
Defaults to 0.01. 5.012 - 1.950 = ___
Kevin has {x} apples. Jane eats {y}. Now Kevin has {{z}} apples.
x = Min: 5, Max: 10, Decimal Places: 0

y = Min: 1, Max: 5, Decimal Places: 0
z = {x} - {y}
0 to require the exact number with no decimal places. Kevin has 5 apples. Jane eats 1. Now Kevin has ___ apples.

Advanced Calculations

You can also add a calculation in double square brackets [[ ]], for example: [[{a}+{b}]].  A calculation is a numerical value constructed from variables.  Some uses of calculations include:

  • Students must solve for each variable in the calculation.
  • Calculations are part of a variable data set.  Students must solve for the union and intersection of the set.
  • Students use the calculation's value to solve for mean and standard deviation of a variable data set.

Advanced Question Examples

Question Text Variable Values
Formula(s) Tolerance Sample Student View
[[({a} + {b} + {c} + {d})/4]] is the mean of the following sequence: {a}, {b}, {c}, D.  D = {{x}}
a = Min: 1, Max: 10, Decimal Places: 0

b = Min: 11, Max: 15, Decimal Places: 0

c = Min: 16, Max: 20, Decimal Places: 0

d = Min: 21, Max: 25, Decimal Places: 0
x = {d} Defaults to 0.01. 15.25 is the mean of the following sequence: 5, 13, 20, D.  D = ___
A couple spends {x}% of their monthly income on food.  Their combined monthly income is $[[{y} + {z}]].  The husband eats twice as much food as his wife. The wife eats ${{w}} worth of food per month.

The cost of food she eats comprises [[(100*(({x}/100)*({y} + {z}))/3)/{y}]]% of her monthly income. Her monthly income is {{a}}. Her husband's monthly income is {{b}}.
x = Min: 9, Max: 17, Decimal Places: 0

y = Min: 3000, Max: 4000, Decimal Places: 2

z = Min: 3000, Max: 4000, Decimal Places: 2
a = {y}

b = {z}

w = (({x}/100)*({y} + {z}))/3
0.01 to allow for rounding.

For example, if the correct answer is $3032.755, setting a tolerance of 0.01 accepts any value in the range of $3032.74 to $3032.76 as the correct answer.
A couple spends 14% of their monthly income on food. Their combined monthly income is $7723.65. The husband eats twice as much food as his wife. The wife eats $___  worth of food per month.

The cost of food she eats comprises 9.34799% of her monthly income. Her monthly income is ___. Her husband's monthly income is ___.

Add attachment(s). (Optional)

To provide additional resources related to the question or to include question text in an attached document, select Add Attachments to browse for and upload a file.

Select the Extract Variables, Calculations, and Formulas from Question Text button.

After you extract the variables and formulas, you will be able to define ranges of values for each variable and the formula that will generate each correct answer.

Define ranges of variable values.

Under Variables, for each variable in the question text:

  1. In the Min column, enter each variable's minimum value.
  2. In the Max column, enter each variable's maximum value.
  3. Under Decimal Places, select how many decimal places you want the number to have (0 to 10).  The default is 3 Decimal Places.

When each student takes the test, a randomly selected number in the range of values will display for a given student.  For example:

Question text: {x} + {y} = {{z}}

The Min value for x is 20, the Max value for x is 50, and 3 Decimal Places are selected.

The Min value for y is 10, the Max value for y is 30, and 3 Decimal Places are selected.

One student's question: 40.015 + 25.025 = ___

Another student's question: 30.123 + 14.345 = ___

Enter the formula(s).

  1. Enter the mathematical expression for each Formula, inserting the variables where needed as letters in between curly brackets { }.  For example:

    The question text is Kevin has {x} apples. Jane eats {y}. How many does Kevin have now? {{z}}

    The Formula for z is {x} - {y}
  2. Enter the desired Tolerance. The correct answer to a calculated question is the Formula's value calculated by Tests & Quizzes plus or minus the Tolerance.  The default Tolerance is 0.01.  For example, if the correct answer is 2.055, the default accepts any value between 2.04 and 2.06 as correct.
  3. Select how many Decimal Places students must include in their answer.  The default is 3 Decimal Places.

Note: Your formulas can contain the following math operators, functions, and constants:

  • Operators: + - * / ^ ( )
  • Constants: PI (3.14...) and e (2.718...)

Review Calculations, if any were entered.

If you added any Calculations in the question text, you can review a sample of how one might look in the test under Calculations.

Assign to a part. (Optional)

If the assessment has more than one part, you may use the Assign to Part drop-down menu to choose the Part where the question will be added.

Assign to a question pool. (Optional)

To add the question to a question pool, Select a pool name from the Assign to Question Pool drop-down menu.

Adding a question to a pool places a copy of the question in the pool and leaves a copy of the question in the current assessment.  For more information on question pools, see What is a question pool?

Provide answer feedback. (Optional)

You may add Correct or Incorrect Answer Feedback which you can make available to students.

Note: If you include feedback here, you will also need to make it available to students in the Feedback Settings for students to access it.

Select Save.