Build a calculator
Ask for numbers, work out a result with a formula and show it on a result screen, in a Score mode project.
Before you start
You will have a calculator: people type in numbers, and the result screen shows the answer your formula works out. Use it for cost, savings, time, price or readiness calculators.
Calculators are built in Score mode: there is no separate calculator mode. If your project is in another mode, see Choose a project mode.
In this example, a visitor enters how many reports they write each week and how long each takes, and the calculator shows the minutes spent.
Ask for the numbers
- On the Projects page, click + Create Project, then Score mode, then Start from scratch.
- In the top bar, make sure the Content tab is chosen. Click Add content, then Number.
- Click the question on the canvas and type it, for example "How many reports do you write each week?"
- Under the question, click Enter label... and type a label, for example "Reports per week". Click Enter placeholder text... and type an example number, for example 5. The visitor sees the placeholder in the empty box.
- Add a second Number question the same way: "How many minutes does one report take?", label "Minutes per report", placeholder 30.
Each Number question can hold one or more number fields. Click Add field under a question to ask for another number in the same screen.
Write the formula
Above the canvas, click Formula. The Formula Builder opens. On the left, the Questions list shows each question as Q1, Q2 and each of its number fields as A1.
The formula box may already hold a sum of your number fields, such as
q1a1+q2a1. Replace it with your own formula. To use a number a visitor typed in, write Q, the question number, A, and the field number. Question 1's first field isq1a1; question 2's isq2a1. For example:q1a1*q2a1Click Save.
You can use +, -, * and /, brackets to set the order, and the buttons under the box: power, min, max, log, round, roundUp, roundDown, IF statement, IF X And Y and IF X OR Y. To wrap part of a formula in a function, select it in the box and click the function's button.
Tip
Type the formula rather than clicking the variables in the list. Clicking them puts each one at the start of the box, so a formula can come out in a different order than you meant.
Show the result
- Under the list of screens, click Add end screen. A Result screen appears. On the canvas it reads "Your result is" followed by the @Score chip. The chip shows what your formula worked out.
- Click Description (optional) and say what the number means, for example "minutes spent on reports every week".
Publish the project and try it: with 5 reports of 30 minutes each, the result screen reads "Your result is 150".
Add points from answers
A calculator can also use answers to other questions. Add a multiple choice question, such as Yes/no, then:
- In the top bar, click the Workflow tab and click the question's box.
- On the Scoring tab, leave Correct off and type points in the number field of each answer.
- Click Save.
- Use the question in the formula by its number. If it is question 3, write
q3. For exampleq1a1*q2a1+q3adds the points of the chosen answer to the result.
A Number question shows "No answers available." on the Scoring tab, because its value is the number typed in.
What happens next
Share the calculator: Share a link and a QR code. For quizzes where answers earn points and result screens depend on the total, see Set up scoring and result screens.
Related articles
- Set up scoring and result screens
Give answers points in a Score mode project, then add result screens that show a different message depending on the total score.
- Add and arrange blocks
Add questions and other blocks to a project, put them in the order you want, and copy or delete them in the Content tab.
:quality(92))
:quality(92))
:quality(92))